| View previous topic :: View next topic |
| Author |
Message |
HamidReza555 How do I cheat?
Reputation: 0
Joined: 15 Dec 2019 Posts: 6
|
Posted: Mon Dec 23, 2019 5:19 am Post subject: My script don't work |
|
|
Hello.
I am beginner in LUA scripting and I want to write a simple script.
I want to know what is the problem of this script:
| Code: | function EN()
if(readInteger(20538502) == readInteger(204E0368)) then
writeBytes(20538505, readBytes(20538505)-1)
end
end
createHotkey(EN, VK_CTRL)
|
Thanks.
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25821 Location: The netherlands
|
Posted: Mon Dec 23, 2019 6:29 am Post subject: |
|
|
hexadecimal numbers start with 0x in front. e.g 0x20538502
_________________
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 |
|
 |
HamidReza555 How do I cheat?
Reputation: 0
Joined: 15 Dec 2019 Posts: 6
|
Posted: Thu Dec 26, 2019 8:38 am Post subject: |
|
|
| Dark Byte wrote: | | hexadecimal numbers start with 0x in front. e.g 0x20538502 |
Thanks for reply. Now it's working.
But, one more question. Why when I use "VK_CTRL" it doesn't work?
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25821 Location: The netherlands
|
Posted: Thu Dec 26, 2019 10:13 am Post subject: |
|
|
because VK_CTRL doesn't exist.
You likely mean VK_CONTROL
_________________
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 |
|
 |
HamidReza555 How do I cheat?
Reputation: 0
Joined: 15 Dec 2019 Posts: 6
|
Posted: Thu Dec 26, 2019 10:21 am Post subject: |
|
|
| Dark Byte wrote: | because VK_CTRL doesn't exist.
You likely mean VK_CONTROL |
Thanks. It works now.
Excuse me, but I have another question.
How can I check if a timer is enabled or disabled?
|
|
| Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1532
|
Posted: Thu Dec 26, 2019 1:11 pm Post subject: |
|
|
| HamidReza555 wrote: |
Excuse me, but I have another question.
How can I check if a timer is enabled or disabled? |
| Code: | function TimerCheck()
if UDF1.CETimer1.Enabled == true then --You Timer name?
print("Timer is working")
else
print("Timer not working")
end
end
TimerCheck() |
_________________
|
|
| Back to top |
|
 |
HamidReza555 How do I cheat?
Reputation: 0
Joined: 15 Dec 2019 Posts: 6
|
Posted: Thu Dec 26, 2019 4:05 pm Post subject: |
|
|
| Aylin wrote: | | HamidReza555 wrote: |
Excuse me, but I have another question.
How can I check if a timer is enabled or disabled? |
| Code: | function TimerCheck()
if UDF1.CETimer1.Enabled == true then --You Timer name?
print("Timer is working")
else
print("Timer not working")
end
end
TimerCheck() |
|
Thanks. I have another question. How can I check if a value reach a specific number in a timer?
I mean how can I check if a value reach a number in a timer?
|
|
| Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1532
|
Posted: Thu Dec 26, 2019 6:39 pm Post subject: |
|
|
Here's an example:
https://forum.cheatengine.org/viewtopic.php?t=610218
or:
| Code: | local TimerValue = 0
UDF1.CETimer1.Interval = 1000
UDF1.CETimer1.Enabled = true
function TimerCheck()
if UDF1.CETimer1.Enabled == true then --You Timer name?
TimerValue = TimerValue + 1000
else
print("Timer not working") end
if TimerValue==5000 then
print("Timer is working")
UDF1.CETimer1.Enabled = false
end
end
function UDF1_CETimer1Timer(sender)
TimerCheck()
end |
or use this archive. There's more there.
https://forum.cheatengine.org/search.php
_________________
|
|
| Back to top |
|
 |
HamidReza555 How do I cheat?
Reputation: 0
Joined: 15 Dec 2019 Posts: 6
|
Posted: Wed Jan 01, 2020 12:26 pm Post subject: |
|
|
| Aylin wrote: | Here's an example:
| Code: | local TimerValue = 0
UDF1.CETimer1.Interval = 1000
UDF1.CETimer1.Enabled = true
function TimerCheck()
if UDF1.CETimer1.Enabled == true then --You Timer name?
TimerValue = TimerValue + 1000
else
print("Timer not working") end
if TimerValue==5000 then
print("Timer is working")
UDF1.CETimer1.Enabled = false
end
end
function UDF1_CETimer1Timer(sender)
TimerCheck()
end |
|
Hi again. Thanks for reply. I mean that I want to check if a value of an address reaches a value. The example you wrote wasn't the thing that I wanted to know.
| Code: | function CU()
if(readBytes(0x20538502) == readBytes(0x204E0368)) then
writeBytes(0x205384FF, readBytes(0x205384FF)+7)
timer_setEnabled(Timer, false)
end
end |
I want to change it to:
| Code: | | if(readBytes(0x20538502) reaches readBytes(0x204E0368)) |
|
|
| Back to top |
|
 |
|