|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Spavid04 Newbie cheater Reputation: 0
Joined: 30 May 2009 Posts: 15
|
Posted: Sat Feb 24, 2024 6:14 pm Post subject: Executing a second AA script if a first one fails |
|
|
Hey all!
How could I achieve the following flow: try the A autoassembler script, and if it fails, try B. They are fairly different scripts, including the code that is injected, and they can't both be active at the same time.
Script A will sometimes fail (intentionally) because of an assert inside of it. If afterwards, script B fails aswell, then "everything" fails.
Currently, I have two separate rows in the scripts list; I enable the first one, and if it fails, I enable the second one. This is pretty clunky, though...
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25298 Location: The netherlands
|
Posted: Sat Feb 24, 2024 6:43 pm Post subject: |
|
|
something like this (untested, just wrote this out of my head but you might get the idea)
Code: |
[enable]
{$lua}
if scriptDisableInfo==nil then
scriptDisableInfo={}
end
local r,di=autoAssemble([[yourscriptEnablePartOnly
...
]])
if r then
scriptDisableInfo[memrec]={}
scriptDisableInfo[memrec].di=di
scriptDisableInfo[memrec].disableScript=[[yourscriptDisablePartOnly
...]]
else
r,di=autoAssemble([[yourOtherscriptEnablePartOnly
...
]])
if r then
scriptDisableInfo[memrec]={}
scriptDisableInfo[memrec].di=di
scriptDisableInfo[memrec].disableScript=[[yourOtherscriptDisablePartOnly
...]]
end
end
if r==false then
error('both scripts failed. I give up')
end
{$lua}
[disable]
{$lua}
autoAssemble(scriptDisableInfo[memrec].disableScript,scriptDisableInfo[memrec].di)
{$asm}
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Spavid04 Newbie cheater Reputation: 0
Joined: 30 May 2009 Posts: 15
|
Posted: Sun Feb 25, 2024 7:52 am Post subject: |
|
|
Yup, that seems to have done it. Thank you very much!
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|