View previous topic :: View next topic |
Author |
Message |
Lorizzuoso Cheater
Reputation: 0
Joined: 09 Apr 2022 Posts: 27
|
Posted: Wed Apr 20, 2022 4:18 pm Post subject: Lua IF |
|
|
I would need to have an "if" that if an address value is 4 then it writes FF and it stops the "for" below but if that value is not 4 anymore than the "for" can resume.
Code: |
[ENABLE]
{$lua}
b={}
timercharactersstand = createTimer(nil, false)
timercharactersstand.Interval = 20
timercharactersstand.Enabled = true
timercharactersstand.OnTimer = function(timer)
for i=1,2 do
repeat
b[i]=math.random(70)
until not ((b[i]==0x28) or (b[i]==0x09) or (b[i]==0x0a) or (b[i]==0x0c) or (b[i]==0x11) or (b[i]==0x17) or (b[i]==0x1b) or (b[i]==0x1c)or (b[i]==0x1d) or (b[i]==0x1e) or (b[i]==0x1f) or (b[i]==0x20) or (b[i]==0x21) or (b[i]==0x22) or (b[i]==0x23) or (b[i]==0x24) or (b[i]==0x25) or (b[i]==0x26) or (b[i]==0x27) or (b[i]==0x28) or (b[i]==0x29) or (b[i]==0x2a) or (b[i]==0x2b) or (b[i]==0x2c) or (b[i]==0x2d) or (b[i]==0x2e) or (b[i]==0x2f) or (b[i]==0x30) or (b[i]==0x31) or (b[i]==0x32) or (b[i]==0x33) or (b[i]==0x34) or (b[i]==0x36) or (b[i]==0x37) or (b[i]==0x39) or (b[i]==0x3c) or (b[i]==0x3d) or (b[i]==0x3e) or (b[i]==0x3f) or (b[i]==0x40) or (b[i]==0x41) or (b[i]==0x44) or (b[i]==0x45) or (b[i]==0x35))
end
writeBytes(0x2059E084,b)
end
[DISABLE]
{$lua}
timercharactersstand.Enabled = false
if readByte(0x2059DDA0,4) then
writeBytes(0x2059E084,0xFF)
writeBytes(0x2059E085,0xFF) |
|
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 35
Joined: 16 Feb 2017 Posts: 1478
|
Posted: Thu Apr 21, 2022 1:44 pm Post subject: |
|
|
Actually, a "for" loop is also unnecessary here.
You can use it as in the example or rearrange your code.
Code: | b={}
b[1]=math.random(0x70)
b[2]=math.random(0x70)
i=1
if not ((b[i]==0x28) or (b[i]==0x09) or (b[i]==0x0a) or (b[i]==0x0c) or (b[i]==0x11) or (b[i]==0x17) or (b[i]==0x1b) or (b[i]==0x1c)or (b[i]==0x1d) or (b[i]==0x1e) or (b[i]==0x1f) or (b[i]==0x20) or (b[i]==0x21) or (b[i]==0x22) or (b[i]==0x23) or (b[i]==0x24) or (b[i]==0x25) or (b[i]==0x26) or (b[i]==0x27) or (b[i]==0x28) or (b[i]==0x29) or (b[i]==0x2a) or (b[i]==0x2b) or (b[i]==0x2c) or (b[i]==0x2d) or (b[i]==0x2e) or (b[i]==0x2f) or (b[i]==0x30) or (b[i]==0x31) or (b[i]==0x32) or (b[i]==0x33) or (b[i]==0x34) or (b[i]==0x36) or (b[i]==0x37) or (b[i]==0x39) or (b[i]==0x3c) or (b[i]==0x3d) or (b[i]==0x3e) or (b[i]==0x3f) or (b[i]==0x40) or (b[i]==0x41) or (b[i]==0x44) or (b[i]==0x45) or (b[i]==0x35))
then
print(b[1],b[2])
else
print("b1: " .. b[1])
end |
or
Code: | [ENABLE]
{$lua}
b={}
timercharactersstand = createTimer(nil, false)
timercharactersstand.Interval = 20
timercharactersstand.Enabled = true
timercharactersstand.OnTimer = function(timer)
for i=1,2 do
--repeat
b[i]=math.random(0x70)
if not ((b[i]==0x28) or (b[i]==0x09) or (b[i]==0x0a) or (b[i]==0x0c) or (b[i]==0x11) or (b[i]==0x17) or (b[i]==0x1b) or (b[i]==0x1c)or (b[i]==0x1d) or (b[i]==0x1e) or (b[i]==0x1f) or (b[i]==0x20) or (b[i]==0x21) or (b[i]==0x22) or (b[i]==0x23) or (b[i]==0x24) or (b[i]==0x25) or (b[i]==0x26) or (b[i]==0x27) or (b[i]==0x28) or (b[i]==0x29) or (b[i]==0x2a) or (b[i]==0x2b) or (b[i]==0x2c) or (b[i]==0x2d) or (b[i]==0x2e) or (b[i]==0x2f) or (b[i]==0x30) or (b[i]==0x31) or (b[i]==0x32) or (b[i]==0x33) or (b[i]==0x34) or (b[i]==0x36) or (b[i]==0x37) or (b[i]==0x39) or (b[i]==0x3c) or (b[i]==0x3d) or (b[i]==0x3e) or (b[i]==0x3f) or (b[i]==0x40) or (b[i]==0x41) or (b[i]==0x44) or (b[i]==0x45) or (b[i]==0x35))
then
writeBytes(0x2059E084,b[i]) -- not "b" , b[1] or b[2]
end
end
{$asm}
[DISABLE]
{$lua}
timercharactersstand.Enabled = false
if readByte(0x2059DDA0,4) then
writeBytes(0x2059E084,0xFF)
writeBytes(0x2059E085,0xFF) |
_________________
|
|
Back to top |
|
 |
Lorizzuoso Cheater
Reputation: 0
Joined: 09 Apr 2022 Posts: 27
|
Posted: Thu Apr 21, 2022 5:05 pm Post subject: Lua IF |
|
|
Ok solved it,thanks!
|
|
Back to top |
|
 |
Bernice How do I cheat?
Reputation: 0
Joined: 03 Apr 2022 Posts: 6
|
Posted: Thu Apr 21, 2022 8:01 pm Post subject: |
|
|
hi,
i had the same doubt and was stuck for days.
thanks for this
|
|
Back to top |
|
 |
|