View previous topic :: View next topic |
Author |
Message |
plagiator Newbie cheater
Reputation: 0
Joined: 16 Oct 2013 Posts: 14
|
Posted: Thu Oct 17, 2013 12:43 pm Post subject: how to automatically change value via timer |
|
|
Hello,
I have found the pointer to a value (double). I have defined a hotkey "time1". now whenever I press it the value becomes 1 as I "set Value to: 1". I have also created a trainer which works fine.
Now I would like to have this done automatically when the value becomes 100 it should be changed automatically without any interaction by me to 1.
How is this exactly done? I assume I need a timer control?
Thank You for helping me out. |
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Thu Oct 17, 2013 1:02 pm Post subject: |
|
|
Code: | cmp [time1],(double)100
jl originalcode
mov [time1],(double)1 |
|
|
Back to top |
|
 |
plagiator Newbie cheater
Reputation: 0
Joined: 16 Oct 2013 Posts: 14
|
Posted: Fri Oct 18, 2013 12:43 pm Post subject: |
|
|
thank you for you help.
unfortunately I don't understand how to use the code.
my idea was to create a timer control to execute every 100 secs
my defined hotkey. How would I do that?
meanwhile I found an intricate work-around myself via a batch file and nircmd. to avoid such endeavor I'd be happy to learn how to do this in CE.
anyway here is my work-around, maybe it's of interest to someone else:
Code: | @echo off
REM start game
start "" "D:\game.exe"
REM wait 3 sec
ping 192.0.2.2 -n 1 -w 3000 > nul
REM start trainer
START /MIN "" "d:\trainer.exe"
REM Loop
:loop
REM check if game is running
tasklist /FI "IMAGENAME eq game.exe" 2>NUL | find /I /N "game.exe">NUL
if "%ERRORLEVEL%"=="0" (
REM then wait for 100 sec
ping 192.0.2.2 -n 1 -w 100000 > nul
REM auto execute hotkey in CE trainer, press "t"
START /MIN "" "D:\nircmdc.exe" sendkeypress 0x54
REM Goto Loop Start
GOTO loop)
REM game is not running
ELSE (
REM kill trainer
taskkill /f /im trainer.EXE
REM Quit loop
GOTO quit
)
GOTO loop
:quit
exit
|
|
|
Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Fri Oct 18, 2013 1:13 pm Post subject: |
|
|
Code: | t = createTimer(nil,false);
t.Interval = 100; -- 100 ms
t.onTimer = function () if readInteger(0x400000,100) then writeInteger(0x400000, 1); end end;
t.Enabled = true; |
Sets value back to 1 after every check (checks intervals are 100ms which is 0.1 second)
Here's an bit FASTER way, that sets the value to 1, remove the readinteger, and the value will be like 'permanently' set to 1.
Code: | function SetValue()
while 1==1 do
if readInteger(0x03BB5BA8,100) then
writeInteger(0x03BB5BA8, 1);
end
end
end
createNativeThread(SetValue); |
Edit:
Ran a testing how many times the operation is being repeated every 0.5 seconds.
Results:
Quote: | 602382
1202405
1794120
2414634
3029669
3651795
4192094
4802502
5411333
6026395
6643624
7262650
7882146
8497946 |
Using
Code: | i = 0
function SetValue()
while 1==1 do
i = i + 1;
writeInteger(0x0E0A9E58, 100);
end
end
createNativeThread(SetValue);
t = createTimer(nil,false);
t.onTimer = function () print(i); end;
t.Inteval = 500;
t.Enabled = true; |
_________________
I'm rusty and getting older, help me re-learn lua. |
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sat Oct 19, 2013 10:33 am Post subject: |
|
|
Paste your script here, and I can show you how to do it in assembly.
The general idea:
Code: |
newmem:
cmp [enabled],1
jne originalcode
cmp [timer],0
je set
sub [timer],1
jmp originalcode
set:
mov [time1],(double)1
mov [timer],100000
jmp originalcode
|
Simply set a hotkey that will enable the cheat (and) set the value for [timer] as 100000. |
|
Back to top |
|
 |
|