View previous topic :: View next topic |
Author |
Message |
sjl002 Master Cheater Reputation: 0
Joined: 31 Aug 2013 Posts: 305
|
Posted: Sun Jul 03, 2016 1:18 pm Post subject: AutoAssembly AutoDisable by Timer |
|
|
Hi
Maybe,I ask this question or request.
How to make lua script Timer for auto uncheck checkbox(disable) in Script2:
This is health script for cheat engine 6.4 Tutorial Program:
Script1: Code: | [Enable]
alloc(HEALTH,2048)
label(RETURNHERE_HEALTH)
label(PLAYERH_1)
label(PLAYERH_FLAG)
registersymbol(PLAYERH_FLAG)
label(ENEMYH_1)
label(ENEMYH_FLAG)
registersymbol(ENEMYH_FLAG)
label(HEALTH_ORIG)
HEALTH:
cmp [ebx+10],1
je PLAYERH_1
jmp ENEMYH_1
PLAYERH_1:
cmp [PLAYERH_FLAG],0
je HEALTH_ORIG
mov [ebx+04],000003E7
fstp dword ptr [ebp-30]
jmp RETURNHERE_HEALTH
PLAYERH_FLAG:
dd 0
ENEMYH_1:
cmp [ENEMYH_FLAG],0
je HEALTH_ORIG
fadd dword ptr [ebx+04]
fstp dword ptr [ebp-30]
jmp RETURNHERE_HEALTH
ENEMYH_FLAG:
dd 0
HEALTH_ORIG:
fsubr dword ptr [ebx+04]
fstp dword ptr [ebp-30]
jmp RETURNHERE_HEALTH
"Tutorial-i386.exe"+27D7D:
jmp HEALTH
nop
RETURNHERE_HEALTH:
[Disable]
dealloc(HEALTH)
"Tutorial-i386.exe"+27D7D:
fsubr dword ptr [ebx+04]
fstp dword ptr [ebp-30]
unregistersymbol(PLAYERH_FLAG)
unregistersymbol(ENEMYH_FLAG) |
Script2: Code: | [Enable]
{$lua}
//--Lua script here
{$asm}
PLAYERH_FLAG:
dd 1
[Disable]
{$lua}
//--Lua script here
{$asm}
PLAYERH_FLAG:
dd 0
|
Thanks for your answers
*SJL002*
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Jul 03, 2016 2:09 pm Post subject: |
|
|
Code: | {$lua}
if syntaxcheck then return end
[ENABLE]
writeInteger("PLAYERH_FLAG", 1)
if mytimer == nil then
mytimer = createTimer(nil, false)
mytimer.Interval = 1000
mytimer.OnTimer = function(timer)
getAddressList().getMemoryRecordByDescription("Script2").Active = false
end
end
mytimer.Enabled = true
[DISABLE]
mytimer.Enabled = false
writeInteger("PLAYERH_FLAG", 0) |
|
|
Back to top |
|
|
sjl002 Master Cheater Reputation: 0
Joined: 31 Aug 2013 Posts: 305
|
Posted: Sun Jul 03, 2016 2:16 pm Post subject: |
|
|
Thanks Zanzer this lua script work perfectly.
Q1:
This script make this Error and not uncheck script:
Error:[string "local syntaxcheck=......"]:8: attempt to index a nil value
My description is (Infinite Health) and i think this error for my description but when put in "Description" (Script2) my problem solve.Why?
Q2:
Ican use only from Description "Script2" and not can use other text .Why?
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Jul 03, 2016 3:48 pm Post subject: |
|
|
Save, close, and reopen the table.
By surrounding the code in that IF statement, it didn't recreate the function with your new name after you first tested it.
|
|
Back to top |
|
|
sjl002 Master Cheater Reputation: 0
Joined: 31 Aug 2013 Posts: 305
|
Posted: Sun Jul 03, 2016 10:45 pm Post subject: |
|
|
This lua script work perfectly.
Thanks for your great helping Zanzer.
|
|
Back to top |
|
|
|