View previous topic :: View next topic |
Author |
Message |
snipertarget How do I cheat? Reputation: 0
Joined: 31 Aug 2017 Posts: 6
|
Posted: Thu Aug 31, 2017 8:57 am Post subject: My Trainer Does not work |
|
|
I want to create a trainer that changes the speed I am using the following code:
Code: | function CEButton1Click(sender)
openProcess("login.exe")
speedhack_setSpeed(CETrainer_CETrackBar1.Position)
end |
but it only works if i manually execute the script from manually designer interface.
How do I make it work? pls help
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Thu Aug 31, 2017 9:11 am Post subject: |
|
|
I'm curious why you are using openProcess, does your trainer not autoattach to the process? If that's the case then you may need a delay inbetween calling openProcess and speedhack_setSpeed though using the onOpenProcess event/function may make more sense.
|
|
Back to top |
|
|
snipertarget How do I cheat? Reputation: 0
Joined: 31 Aug 2017 Posts: 6
|
Posted: Thu Aug 31, 2017 9:33 am Post subject: |
|
|
I was using this function
Code: | function CEButton1Click(sender)
openProcess("Login.exe")
speedhack_setSpeed(CETrainer_CETrackBar1.Position)
end |
But I changed to this
Code: | function CEButton1Click(sender)
onOpenProcess("Login.exe")
speedhack_setSpeed(CETrainer_CETrackBar1.Position)
end |
And I get this error
Code: | Error:[string "function CEButton1Click(sender)
..."]:2: attempt to call a nil value (global 'onOpenProcess') |
I have one trackpad and I want to use the Set Speed Button to change the speed of the game with trainer ;-;
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Thu Aug 31, 2017 9:37 am Post subject: |
|
|
of course you do, onOpenProcess isn't a function to open a process, it's a function you create that will be called on a certain event, ie. when a process is opened.
|
|
Back to top |
|
|
snipertarget How do I cheat? Reputation: 0
Joined: 31 Aug 2017 Posts: 6
|
Posted: Thu Aug 31, 2017 9:45 am Post subject: |
|
|
But i open the game myself -_- I just want to execute the lua button code when I press it because it does not work when I export my trainer. I want when I slide the trackpad and press set speed button to make program speedhack change in game pls help ;-;
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Thu Aug 31, 2017 11:10 am Post subject: |
|
|
If you open it yourself then don't use openProcess! That's why I said I was curious about why you were using it but instead of answering the question you took some advice that was given on the off chance that you knew what you were doing.
If you're already attached then you should just need
Code: | function CEButton1Click(sender)
speedhack_setSpeed(CETrainer_CETrackBar1.Position)
end |
if that alone doesn't work then try CETrainer.CETrackBar1.Position instead of an _ and if that doesn't work then print out each part and make sure it's not nil eg.
Code: | function CEButton1Click(sender)
print('_trackbar is ', CETrainer_CETrackBar1)
print('_trackbar.position is ', CETrainer_CETrackBar1.position)
-- in case _ is incorrect
print('CETrainer is ', CETrainer)
print('.trackbar is ', CETrainer.CETrackBar1)
print('.trackbar.position is ', CETrainer.CETrackBar1.position)
-- incase it is named CETrainer_CETrackBar1 but is on the CETrainer form
print('trainer._trackbar is ', CETrainer.CETrainer_CETrackBar1)
print('trainer._trackbar.position is ', CETrainer.CETrainer_CETrackBar1.position)
--speedhack_setSpeed(CETrainer_CETrackBar1.Position)
end |
|
|
Back to top |
|
|
snipertarget How do I cheat? Reputation: 0
Joined: 31 Aug 2017 Posts: 6
|
Posted: Thu Aug 31, 2017 11:43 am Post subject: |
|
|
I try what you say but it says there is error :/
Code: | Error:attempt to call a nil value
Error:attempt to call a nil value
_trackbar is 0A607E50
_trackbar.position is 1
CETrainer is 0A5481B0
.trackbar is 0A607E50
.trackbar.position is 1
trainer._trackbar is
Error:[string "function CEButton1Click(sender)
..."]:10: attempt to index a nil value (field 'CETrainer_CETrackBar1')
_trackbar is 0A607E50
_trackbar.position is 4
CETrainer is 0A5481B0
.trackbar is 0A607E50
.trackbar.position is 4
trainer._trackbar is
Error:[string "function CEButton1Click(sender)
..."]:10: attempt to index a nil value (field 'CETrainer_CETrackBar1') |
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Thu Aug 31, 2017 12:05 pm Post subject: |
|
|
Yeah, I'd expect a few errors because some of those are going to be invalid, the point was to find out for sure which are valid. During testing make sure you click 'execute code' when you change the lua script so that any changes to functions are updated (that's probably where the "Error:attempt to call a nil value" errors came from, trying to call the button event function before it'd actually been created), that's not an issue afterwards since the script is automatically run when it's opened.
Seems like the _trackbar and .trackbar prints are both valid (and point to the same trackbar), I'd guess that's some compatibility between the old CE syntax (that I never used) and the current one.
As such
Code: | function CEButton1Click(sender)
speedhack_setSpeed(CETrainer_CETrackBar1.Position)
end |
should work, since setting the speed will enable the speed hack if it wasn't already, assuming of course that the speedhack works at all and you're already attached. One final check you could do is
Code: | function CEButton1Click(sender)
print('trying to set speed to', CETrainer_CETrackBar1.Position)
speedhack_setSpeed(CETrainer_CETrackBar1.Position)
print('speed is now', speedhack_getSpeed())
end |
If it's working as expected then you should see the same number printed out.
|
|
Back to top |
|
|
snipertarget How do I cheat? Reputation: 0
Joined: 31 Aug 2017 Posts: 6
|
Posted: Thu Aug 31, 2017 12:14 pm Post subject: |
|
|
I try the code in Manually design I press execute and this is what I get:
Code: | trying to set speed to 0
speed is now 0.0
trying to set speed to 1
speed is now 1.0
trying to set speed to 4
speed is now 4.0 |
When I make generated trainer with same code and open it I get:
Code: | trying to set speed to 4
speed is now 1.0
trying to set speed to 6
speed is now 1.0
trying to set speed to 8
speed is now 1.0
trying to set speed to 0
speed is now 1.0
trying to set speed to 6
speed is now 1.0
|
I dont know why ;-;
The speed does not change at all in trainer I make...
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Thu Aug 31, 2017 12:30 pm Post subject: |
|
|
The only thing I can think of then is that speedhack wasn't checked in the "features used" section:
|
|
Back to top |
|
|
snipertarget How do I cheat? Reputation: 0
Joined: 31 Aug 2017 Posts: 6
|
Posted: Thu Aug 31, 2017 12:43 pm Post subject: |
|
|
I checked that but it only works before I generate the trainer :/ I dont know what is wrong, I think the trainer is not executing the script when I press the Set Speed Button, do you have any suggestions or script examples I could use? I need to make this work ;-;
Can I add you I need to talk to you I cant post link here or do anything ;-; I want to show you what I am doing maybe you know the problem here...
EDIT: Oh I found the problem, the process was a 32 bit ... I generated trainer in 64 bit -_- ... Thank you so much for the help, I fixed it. ^^
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Thu Aug 31, 2017 1:03 pm Post subject: |
|
|
Hm if it wasn't executing the script then you wouldn't get the prints above either (because those are in the same script/function).
Honestly I don't generally create trainers so I don't know anything else to help out here.
|
|
Back to top |
|
|
|