View previous topic :: View next topic |
Author |
Message |
Reclaimer Shawn Advanced Cheater Reputation: 0
Joined: 09 Jun 2015 Posts: 77
|
Posted: Wed Aug 24, 2016 9:10 pm Post subject: Nesting Ifs Within a Checkbox Timer |
|
|
All of my other Cheat Engine statements just involve infinite writes seem to work. This code randomly generates values within a certain range and writes them to the game. When this code is ran, my trainer immediately closes. It also seems to close when using multiple timers as well.
Last edited by Reclaimer Shawn on Sat Aug 27, 2016 12:36 pm; edited 1 time in total |
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Wed Aug 24, 2016 9:26 pm Post subject: |
|
|
Instead of continuing to add complexity to your script, why don't you fix whatever has been causing it to crash first.
Anyway, your IFs are wrong. Each IF requires an END. Don't just toss a bunch together until it stops giving you errors.
|
|
Back to top |
|
|
Reclaimer Shawn Advanced Cheater Reputation: 0
Joined: 09 Jun 2015 Posts: 77
|
Posted: Wed Aug 24, 2016 10:15 pm Post subject: |
|
|
Zanzer wrote: | Instead of continuing to add complexity to your script, why don't you fix whatever has been causing it to crash first.
Anyway, your IFs are wrong. Each IF requires an END. Don't just toss a bunch together until it stops giving you errors. |
My trainer still crashes. Here is all of the code so far:
In case you're wondering what I mean by "crash", my UDF1 form opens and then immediately closes. Works fine if I don,the include this or use it without ifs. It must be a scripting fault on my end somehow... To ask, if this code is right, then could it be a Form issue?
Last edited by Reclaimer Shawn on Sat Aug 27, 2016 12:36 pm; edited 1 time in total |
|
Back to top |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Thu Aug 25, 2016 1:52 am Post subject: |
|
|
first of all I'd recommend using lua tables (arrays) to avoid many copy-paste and many other simple typos, since you have many if and else's.
Now the checkbox function is less likely to be cause of the crash unless you call the checkbox function as soon as you start up, so if you try to define the checkbox function and it does not crashes then everything is fine, it's not that function that causing the trouble.
You will need to debug and see at which part it crashes.
About the script I wouldn't recommend is defining function inside of a function, as code function is being defined only as soon as you tick the checkbox, that means if you somehow try to call it earlier (e.g timer or start up script) it might crash or throw errors.
_________________
|
|
Back to top |
|
|
Reclaimer Shawn Advanced Cheater Reputation: 0
Joined: 09 Jun 2015 Posts: 77
|
Posted: Fri Aug 26, 2016 7:45 pm Post subject: |
|
|
DaSpamer wrote: | first of all I'd recommend using lua tables (arrays) to avoid many copy-paste and many other simple typos, since you have many if and else's.
Now the checkbox function is less likely to be cause of the crash unless you call the checkbox function as soon as you start up, so if you try to define the checkbox function and it does not crashes then everything is fine, it's not that function that causing the trouble.
You will need to debug and see at which part it crashes.
About the script I wouldn't recommend is defining function inside of a function, as code function is being defined only as soon as you tick the checkbox, that means if you somehow try to call it earlier (e.g timer or start up script) it might crash or throw errors. |
Figured out my problem... I was using an extra parenthesis in the if statements... That was IT. I feel a bit dumb now.
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Fri Aug 26, 2016 7:58 pm Post subject: |
|
|
Yea... that was not the problem.
As long as there's both an opening and closing, it doesn't matter how many parenthesis you throw in there.
Code: | myvar = true
if ((myvar) == true) then
print("1")
end
if (((((((myvar)))) == ((true))))) then
print("2")
end |
|
|
Back to top |
|
|
|