View previous topic :: View next topic |
Author |
Message |
robbinraa How do I cheat? Reputation: 0
Joined: 02 Dec 2018 Posts: 6
|
Posted: Sun Dec 02, 2018 5:49 am Post subject: Script |
|
|
Hello!
I need your help to write the mini-script.
I have an address 0019D2ED with byte type.
I need to decrease value by 2 when I press hotkey ` (lefter from 1 key).
I did it all and it works fine, but I need to add rule.
If value == 255 or value <= 2 then my hotkey do nothing with it (to let it pass new cycle from 255 to 2)
Otherwise game crashes if hotkey is pressed between 254 and 2.
Got the idea?
Thanks for your help!
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Sun Dec 02, 2018 9:24 am Post subject: |
|
|
val = readBytes(0x19d2ed, 1)
if val == 255 or val <= 2 then return end
otherwise decrease val and write it back to memory
_________________
|
|
Back to top |
|
|
robbinraa How do I cheat? Reputation: 0
Joined: 02 Dec 2018 Posts: 6
|
Posted: Sun Dec 02, 2018 10:15 am Post subject: |
|
|
Thanks for your feedback but I have 0 exp in doing this.
Can you give me complete code? Thanks in advance.
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Sun Dec 02, 2018 4:15 pm Post subject: |
|
|
Quote: | I did it all and it works fine, but I need to add rule. |
just add the "rule" I gave to the code you already did.
_________________
|
|
Back to top |
|
|
robbinraa How do I cheat? Reputation: 0
Joined: 02 Dec 2018 Posts: 6
|
Posted: Sun Dec 02, 2018 5:18 pm Post subject: |
|
|
FreeER wrote: | Quote: | I did it all and it works fine, but I need to add rule. |
just add the "rule" I gave to the code you already did. |
But I have no code at all.
I just have table in my CE whith needed address and set hotkey for it to decrease the value when I press it.
Trying to execute just your string doesn't gives any result.
I am newbie in this theme at all.[img][/img]
Description: |
|
Filesize: |
52.92 KB |
Viewed: |
2612 Time(s) |
|
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Mon Dec 03, 2018 6:13 am Post subject: |
|
|
Ah, yeah, the GUI hotkey doesn't let you add conditions and afaik you can't have it run a lua script instead/before/after. you did post in lua scripting so I assumed you had done it in lua
I just woke up but i think this would be correct.
Code: | local VK_BACK_QUOTE=192
createHotkey(function()
print('hello')
val = readBytes(0x19d2ed, 1)
if val == 255 or val <= 2 then return end
val = val - 2
writeBytes(0x19d2ed, val)
end, VK_BACK_QUOTE) |
_________________
|
|
Back to top |
|
|
robbinraa How do I cheat? Reputation: 0
Joined: 02 Dec 2018 Posts: 6
|
Posted: Mon Dec 03, 2018 4:11 pm Post subject: |
|
|
It works fine!
Thank you!
Can you help me with the option of restarting the lua script without closing CE?
When I change the line (for example to check if it works) "val = val - 2" to "val = val" and press Execute script - it still decreases the value.
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Mon Dec 03, 2018 5:36 pm Post subject: |
|
|
put it in an AA script with {$lua} at the top (so it parses lua code rather than assembly) and on enable do
some_global_hotkey_for_xxx = CreateHotkey ...
and on disable do some_global_hotkey_for_xxx.destroy()
you can move the local VK_BACK_QUOTE=192 in the function() or leave it outside or just replace VK_BACK_QUOTE with 192 and leave it out (good luck remembering what key 192 is though if you come back later and don't remember what you used lol)
_________________
|
|
Back to top |
|
|
robbinraa How do I cheat? Reputation: 0
Joined: 02 Dec 2018 Posts: 6
|
Posted: Mon Dec 03, 2018 5:37 pm Post subject: |
|
|
Did all my testing with closing / re opening CE
I guess it will be my last question.
In CE hotkeys I could set MB 5 button (extra button on my mouse) but I can't find in google which is this button as VK_
Can you help with that too?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Tue Dec 04, 2018 12:51 am Post subject: |
|
|
easiest way is create a hotkey with just mb_5 , then copy the cheat entry and paste it into notepad.
then find the keycode in there
_________________
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 |
|
|
robbinraa How do I cheat? Reputation: 0
Joined: 02 Dec 2018 Posts: 6
|
Posted: Tue Dec 04, 2018 1:57 am Post subject: |
|
|
Dark Byte wrote: | easiest way is create a hotkey with just mb_5 , then copy the cheat entry and paste it into notepad.
then find the keycode in there |
Did that you said and got that KEY is 6.
<Hotkeys>
<Hotkey>
<Action>Decrease Value</Action>
<Keys>
<Key>6</Key>
</Keys>
<Value>1</Value>
<ID>0</ID>
</Hotkey>
</Hotkeys>
local VK_MB_5=6 works fine
thanks
|
|
Back to top |
|
|
noobes Advanced Cheater Reputation: 0
Joined: 17 Dec 2018 Posts: 89
|
Posted: Fri Dec 28, 2018 12:42 pm Post subject: |
|
|
local VK_BACK_QUOTE=192
createHotkey(function()
print('hello')
val = readBytes(0x19d2ed, 1)
if val == 255 or val <= 2 then return end
val = val - 2
writeBytes(0x19d2ed, val)
end, VK_BACK_QUOTE)
|
|
Back to top |
|
|
|