| View previous topic :: View next topic |
| Author |
Message |
CodeKiller Advanced Cheater
Reputation: 0
Joined: 30 Jun 2009 Posts: 87
|
Posted: Thu Mar 12, 2020 6:37 am Post subject: Simple Lua ASM script |
|
|
Hello,
Do you know why the first "IF" does not work ?
| Code: | GOLD=inputQuery('Gold address', 'What it the current gold address ?','')
if GOLD then
local scriptStr = [[
alloc(GOLD,8)
registersymbol(GOLD)
GOLD:
dq ]] .. GOLD .. [[
]]
if autoAssemble(scriptStr) then
print('The auto assembler script was successful.')
else
print('There was an error with the auto assembler script.')
end
end |
Thanks !
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25833 Location: The netherlands
|
Posted: Thu Mar 12, 2020 8:40 am Post subject: |
|
|
define "not working"
if you click cancel the if doesn't go, but if you click ok it does
_________________
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 |
|
 |
CodeKiller Advanced Cheater
Reputation: 0
Joined: 30 Jun 2009 Posts: 87
|
Posted: Thu Mar 12, 2020 8:55 am Post subject: |
|
|
I mean if the var is empty it continues and I want to avoid miss click/return.
But yes "Escape" or "Cancel" works as intended.
I found the code I needed in fact.
Sorry for topic, it helps me investigate myself.
| Code: | GOLD=inputQuery('Gold address', 'What it the current gold address ?','')
if not GOLD == nil or not GOLD == '' then
local scriptStr = [[
alloc(GOLD,8)
registersymbol(GOLD)
GOLD:
dq ]] .. GOLD .. [[
]]
if autoAssemble(scriptStr) then
print('The auto assembler script was successful.')
else
print('There was an error with the auto assembler script.')
end
end |
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25833 Location: The netherlands
|
Posted: Thu Mar 12, 2020 9:10 am Post subject: |
|
|
you can rewrite
| Code: |
if not GOLD == nil or not GOLD == '' then
|
into
| Code: |
if gold and gold~='' then
|
_________________
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 |
|
 |
|