Looking for help
Forum rules
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
Looking for help
Is this possible?
process name: dark.exe
Hotkey F1 - Ammo
Hotkey F2 - Hp Potion
Hotkey F3 - Mp potion
Address of ammo (pointer): "dark.exe"+00621668 offset:50
Address of Hp: 0x00A880C4
address of mp: 0x00A880C8
ammo keep changing address. if i just use normal search address. have to find the pointer so it wont change everytime i login.
what i want is that is it possible to heal once the value of my health or mana reach below 50%?
and possible to reload my ammo if the ammount of ammo is lower than value of 10?
Thanks. I play window mode. So if my health goes down while im browsing youtube or internet it wont interupt the hotkey F1 (Help) in windows? only send the Hotkey F1 through dark.exe
process name: dark.exe
Hotkey F1 - Ammo
Hotkey F2 - Hp Potion
Hotkey F3 - Mp potion
Address of ammo (pointer): "dark.exe"+00621668 offset:50
Address of Hp: 0x00A880C4
address of mp: 0x00A880C8
ammo keep changing address. if i just use normal search address. have to find the pointer so it wont change everytime i login.
what i want is that is it possible to heal once the value of my health or mana reach below 50%?
and possible to reload my ammo if the ammount of ammo is lower than value of 10?
Thanks. I play window mode. So if my health goes down while im browsing youtube or internet it wont interupt the hotkey F1 (Help) in windows? only send the Hotkey F1 through dark.exe
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Looking for help
Yes, it can be done. Very easily, even. First, see this tutorial on finding pointers: https://solarstrike.net/phpBB3/viewtopic.php?f=5&t=65
Once you've got your pointers, all you need to do is run a loop, read the contents of those addresses, and then send a hotkey if needed.
If you're doing this with MicroMacro2 (1.9 on the download page while it is still in beta), your script should look something like this:
That's just a rough idea. Of course you'll have to adjust the numbers a bit.
Once you've got your pointers, all you need to do is run a loop, read the contents of those addresses, and then send a hotkey if needed.
If you're doing this with MicroMacro2 (1.9 on the download page while it is still in beta), your script should look something like this:
Code: Select all
local win;
local procId;
local proc;
local exeName = "dark.exe";
function macro.init()
win = window.find("the title of the window");
procId = process.findByExec(exeName);
proc = process.open(procId);
darkExeAddress = process.getModuleAddress(procId, exeName);
assert(win);
assert(proc);
assert(darkExeAddress);
end
local timeSinceLastAction = 0;
function macro.main(dt)
timeSinceLastAction = timeSinceLastAction + dt;
if( timeSinceLastAction > 1 ) then
local HP = process.read(proc, "int", 0x00A880C4);
local MP = process.read(proc, "int", 0x00A880C8);
local ammo = process.readPtr(proc, "int", darkExeAddress + 0x621668, 50);
if( HP < 80 ) then
keyboard.virtualPress(win, key.VK_F2);
timeSinceLastAction = 0;
end
if( MP < 50 ) then
keyboard.virtualPress(win, key.VK_F3);
timeSinceLastAction = 0;
end
if( ammo < 10 ) then
keyboard.virtualPress(win, key.VK_F1);
timeSinceLastAction = 0;
end
end
return true;
end
Re: Looking for help
Could not get it to work..
- My UAC is off
- Run both files in Admin.
- Using Windows 8
dark.exe is running
but when i save the code into test.lua inside the Script folder and try to run it. I get this error
Yes those are the Address of HP and MP they are single pointer address (does not change, stay permanent).
Only the Ammo change, when I go in different map or exit the game. But I manage to find out the pointer through Cheat Engine by following your guide. and that was this. This address stay
0x00621668 + 50 will always point to <some changing address>
<some changing address> + 50 points to my Ammo
Could not post image. So I dont know how this look like.
The Red Address is the Ammo that keep changing. but the Pointer address always point to my ammo.
0x00621668 + 50 is a static address
- My UAC is off
- Run both files in Admin.
- Using Windows 8
dark.exe is running
but when i save the code into test.lua inside the Script folder and try to run it. I get this error
Code: Select all
2015-04-11 18:27:04 : Failed to run init function, err code: 7 (Runtime error)
test.lua:7: attempt to call a nil value (field 'findByExec')
stack traceback:
test.lua:7: in function <test.lua:5>
Only the Ammo change, when I go in different map or exit the game. But I manage to find out the pointer through Cheat Engine by following your guide. and that was this. This address stay
0x00621668 + 50 will always point to <some changing address>
<some changing address> + 50 points to my Ammo
Could not post image. So I dont know how this look like.
The Red Address is the Ammo that keep changing. but the Pointer address always point to my ammo.
i also change "the title of the window" to " dknb " there 2 space at the beginning of the title, i used autoit and ahk window spy. show same result.<?xml version="1.0" encoding="utf-8"?>
<CheatTable>
<CheatEntries>
<CheatEntry>
<ID>5</ID>
<Description>"pointerscan result"</Description>
<LastState Value="231" Activated="0" RealAddress="0C834E30"/>
<Color>80000008</Color>
<VariableType>4 Bytes</VariableType>
<Address>"dark.exe"+00621668</Address>
<Offsets>
<Offset>50</Offset>
</Offsets>
</CheatEntry>
</CheatEntries>
</CheatTable>
0x00621668 + 50 is a static address
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Looking for help
Sorry, the function is findByExe, not findByExec.
The code I provided should lookup the module address for dark.exe, so it should actually work the way I have it, but that code was entirely off the top of my head and untested.
The code I provided should lookup the module address for dark.exe, so it should actually work the way I have it, but that code was entirely off the top of my head and untested.
Re: Looking for help
Edited.. Works on HP and MP.
Cant get it to work on Ammo.
Cant get it to work on Ammo.
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Looking for help
What happens when you try this:
Code: Select all
print("exe + offset1, ptr:", darkExeAddress + 0x621668);
print("exe + offset1, addr:", process.read(proc, "int", darkExeAddress + 0x621668));
Re: Looking for help
Administrator wrote:What happens when you try this:Code: Select all
print("exe + offset1, ptr:", darkExeAddress + 0x621668); print("exe + offset1, addr:", process.read(proc, "int", darkExeAddress + 0x621668));
I get a huge dump of this..it just keep going non stop.
should it suppose to show the Ammo ADDRESS "that keep changing" from Static Pointer?. it doesnt seem to match tho.
When i added the Pointer Address on CE manually. it show different address of the ammo..
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Looking for help
That is outputting in decimal. You'd want to output in hex. Try this:
Please just copy and paste the output instead of posting screenshots of text data.
Code: Select all
local ptr = process.read(proc, "int", darkExeAddress + 0x621668);
printf("ptr: 0x%X\n", ptr);
local value = process.read(proc, "int", ptr);
printf("Value: %d (0x%X)\n", value, value);
Re: Looking for help
I added those line below
after adding that. I get this error
Code: Select all
local ammo = process.readPtr(proc, "int", darkExeAddress + 0x621668, 50);
Code: Select all
Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script> 1test
Running '1test'
ptr: 0xC267A88
Value: 9058332 (0x8A381C)
Error in main loop. Error code 7 (Runtime error)
1test.lua:39: attempt to compare nil with number
stack traceback:
1test.lua:39: in function <1test.lua:18>
Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script>
Re: Looking for help
Thank you for your help.
After i follow your CE Guide to get the Pointer.
I tried another Memory Software like Art Money. and follow your Guide again. It works like a charmed.
And release capslock state function off *Capslock off*.
After i follow your CE Guide to get the Pointer.
I tried another Memory Software like Art Money. and follow your Guide again. It works like a charmed.
How do i add by pressing Capslock then it would hold down Right Click mouse button?local ammo = process.readPtr(proc, "int", darkExeAddress + 0x621668, 80);
And release capslock state function off *Capslock off*.
Code: Select all
local win;
local procId;
local proc;
local exeName = "dark.exe";
function macro.init()
win = window.find(" dknb ");
procId = process.findByExe(exeName);
proc = process.open(procId);
darkExeAddress = process.getModuleAddress(procId, exeName);
assert(win);
assert(proc);
assert(darkExeAddress);
end
local timeSinceLastAction = 0;
function macro.main(dt)
timeSinceLastAction = timeSinceLastAction + dt;
if( timeSinceLastAction > 1 ) then
local HP = process.read(proc, "int", 0x00A880C4);
local MP = process.read(proc, "int", 0x00A880C8);
local ammo = process.readPtr(proc, "int", darkExeAddress + 0x621668, 80);
if( HP < 1000 ) then
keyboard.press(key.VK_F2);
timeSinceLastAction = 0;
end
if( MP < 100 ) then
keyboard.press(key.VK_F3);
timeSinceLastAction = 0;
end
if( ammo < 250 ) then
keyboard.press(key.VK_F1);
timeSinceLastAction = 0;
end
end
return true;
end
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Looking for help
Here's the keyboard module documentation: https://solarstrike.net/wiki/index.php? ... ard_Module
To check if Capslock is on, you'll use keyboard.getToggleState():
I suppose setting the toggle state directly isn't supported yet (so I'll have to add that), but you can just press it to toggle:
To check if Capslock is on, you'll use keyboard.getToggleState():
Code: Select all
capsOn = keyboard.getToggleState(key.VK_CAPSLOCK);
Code: Select all
if( capsOn ) then
keyboard.press(key.VK_CAPSLOCK);
end
Re: Looking for help
EDIT: Got it fix. turn out to be
i was thinking it would be similar format.
Is there a way to add pressing caps again after 190 seconds?
Code: Select all
mouse.hold(2)
Code: Select all
keyboard.press(key.VK_CAPSLOCK)
mouse.hold(number.VK_2)
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Looking for help
It is. Those names just stand for numbers. 2 just happens to be the right mouse button. You should probably use key.VK_RMOUSE though.
The full list of virtual keys (vks) is here: http://www.solarstrike.net/wiki/index.p ... Key_Module
Some keys contain multiple aliases. ie. VK_CAPITAL and VK_CAPSLOCK are the same thing.
To have it automatically toggle the capslock key again after some time, you can use a timer in one of two ways.
Method 1, the long method:
Now, wherever you want to start the countdown:
Method 2, the clean method:
At the top of your script, add this:
To start the timer:
In your main loop, check if it is triggered:
Realistically, these both work the same way. The difference is that we use the Timestamp class to handle most of the work for us and to just make the code cleaner and easier to use. Additionally, instead of a second variable to tell whether it was already triggered and reset or not, we just set the timestamp to nil to signal that we aren't running the timer right now.
The full list of virtual keys (vks) is here: http://www.solarstrike.net/wiki/index.p ... Key_Module
Some keys contain multiple aliases. ie. VK_CAPITAL and VK_CAPSLOCK are the same thing.
To have it automatically toggle the capslock key again after some time, you can use a timer in one of two ways.
Method 1, the long method:
Code: Select all
local timeLeft = 0;
local triggered = false;
function macro.main(dt)
if( timeLeft > 0 ) then
timeLeft -= dt;
else
if( not triggered ) then
-- Just triggered it now, so do something about it.
triggered = true;
keyboard.press(key.VK_CAPSLOCK);
end
end
end
Code: Select all
timeLeft = 190; -- Time in seconds until activated
triggered = false; -- Reset the triggered state
Method 2, the clean method:
At the top of your script, add this:
Code: Select all
require('timestamp');
Code: Select all
actionTimestamp = Timestamp:now():addSeconds(190); -- 190 = time in seconds from now
Code: Select all
if( actionTimestamp and not actionTimestamp:isFuture() ) then
-- Triggered!
keyboard.press(key.VK_CAPSLOCK);
actionTimestamp = nil;
end
Re: Looking for help
Thanks.. I also been looking at those Module. Went to see Timing Module. but only showed Time/Date format.
But cant find an example how to send/press a key button every X seconds.
tried this
it seems this code timeleft affect everything..I wanted it only start the timeleft when i press capslock
But cant find an example how to send/press a key button every X seconds.
tried this
Code: Select all
function macro.init()
timeLeft = 200;
Code: Select all
function macro.main(dt)
timeSinceLastAction = timeSinceLastAction + dt;
timeLeft = timeLeft - dt;
if( timeLeft < 0 ) then
print("200 seconds have elapsed.");
timeLeft = 200; -- Now reset it
keyboard.press(key.VK_CAPSLOCK);
end
Last edited by kurapicas on Sun Apr 12, 2015 1:52 pm, edited 1 time in total.
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Looking for help
I should also add that if you just want to continually trigger that every 190 seconds instead of only 190 seconds after some event (user input?) you can do this:
Code: Select all
actionTimestamp = Timestamp:now():addSeconds(190);
function macro.main(dt)
if( not actionTimestamp:isFuture() ) then
keyboard.press(key.VK_CAPSLOCK);
actionTimestamp = Timestamp:now():addSeconds(190); -- Reset it
end
end
Re: Looking for help
cant seem to get that actionTimestamp to work. i added it below function macro.init()
Code: Select all
Failed to run init function, err code: 7 (Runtime error)
dnbk.lua:10: attempt to index a nil value (global 'Timestamp')
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Looking for help
Ah, right. That's my fault. I forgot to include the lib folder with the releases.
In the main micromacro folder (the one with micromacro.exe), create a new folder named lib. Save the attached file (timestamp.lua) into that folder. Now it should work.
In the main micromacro folder (the one with micromacro.exe), create a new folder named lib. Save the attached file (timestamp.lua) into that folder. Now it should work.
- Attachments
-
- timestamp.lua
- (5.64 KiB) Downloaded 218 times
Re: Looking for help
Sorry for late reply, couldn't test it right away..
put the timestamp.lua inside this folder i created lib
run the script and still get error.
put the timestamp.lua inside this folder i created lib
Code: Select all
C:\Users\teemo\Downloads\micromacro.1.91.41_x64\micromacro\lib
Code: Select all
2015-04-12 17:28:54 : Failed to run init function, err code: 7 (Runtime error)
test.lua:10: attempt to index a nil value (global 'Timestamp')
stack traceback:
test.lua:10: in function <test.lua:5>
Last edited by kurapicas on Sun Apr 12, 2015 4:34 pm, edited 2 times in total.
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Looking for help
Did you put require('timestamp') at the top of your script?
Re: Looking for help
didnt know that require function would be needed. now its fixed. script running great...
Who is online
Users browsing this forum: No registered users and 23 guests