View previous topic :: View next topic |
Author |
Message |
Lorizzuoso Cheater
Reputation: 0
Joined: 09 Apr 2022 Posts: 27
|
Posted: Mon Apr 18, 2022 12:19 pm Post subject: Lua Math |
|
|
Is it possible to make a math.random in writebytes? |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25778 Location: The netherlands
|
Posted: Mon Apr 18, 2022 12:21 pm Post subject: |
|
|
if you describe better what you want perhaps _________________
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 |
|
 |
Lorizzuoso Cheater
Reputation: 0
Joined: 09 Apr 2022 Posts: 27
|
Posted: Mon Apr 18, 2022 12:25 pm Post subject: Lua Math |
|
|
So I want to make a randomizer in an address which contains a group of 8 FF'S but without certain values so everytime I hit the script I would like to randomize those 8 bytes with random values without certain values because the game would not load certain values for example 1C or 2A so basically a range without those two possible values |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25778 Location: The netherlands
|
Posted: Mon Apr 18, 2022 12:40 pm Post subject: |
|
|
Code: |
b={}
for i=1,8 do
repeat
b[i]=math.random(255)
until not ((b[i]==0x1c) or (b[i]==0x2a))
end
writeBytes(address,b)
|
_________________
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 |
|
 |
Lorizzuoso Cheater
Reputation: 0
Joined: 09 Apr 2022 Posts: 27
|
Posted: Mon Apr 18, 2022 1:09 pm Post subject: Lua Math |
|
|
Thanks,but what if it's more than two values? |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25778 Location: The netherlands
|
Posted: Mon Apr 18, 2022 1:27 pm Post subject: |
|
|
Code: |
until not ((b[i]==0x1c) or (b[i]==0x2a) or (b[i]==0x2b) or (b[i]==0x2c) or (b[i]==0x2d) or (b[i]==0x2e))
|
etc...
you can also use a table with invalid values and compare against that if you like _________________
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 |
|
 |
Lorizzuoso Cheater
Reputation: 0
Joined: 09 Apr 2022 Posts: 27
|
Posted: Mon Apr 18, 2022 4:00 pm Post subject: Lua Math |
|
|
For some reason it still puts those values |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25778 Location: The netherlands
|
Posted: Mon Apr 18, 2022 4:41 pm Post subject: |
|
|
are you sure there's no other code that writes those values ?
you can of course do a :
Code: |
for i=1,8 do
if (b[i]==0x1c) or (b[i]==0x2a) then
print("it's in!!!")
end
end
|
_________________
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 |
|
 |
Lorizzuoso Cheater
Reputation: 0
Joined: 09 Apr 2022 Posts: 27
|
Posted: Mon Apr 18, 2022 5:07 pm Post subject: Lua Math |
|
|
Ok I solved it |
|
Back to top |
|
 |
|