View previous topic :: View next topic |
Author |
Message |
lothe23 Advanced Cheater
Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Wed Jul 06, 2016 6:04 pm Post subject: trackbar |
|
|
Hello, how do i use a trackbar?
I want it to be disabled when my checkbox is unticked and enabled when it is ticked, i set it to four stages. One stage for different Integer values. (it is the same adress just different values)
so for an example: checkbox unticked -> set value to x.
checkbox ticked -> activate the trackbar, and set value to wherever the trackbar is set.
i hope i made myself understood properly, cheers!
|
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Wed Jul 06, 2016 7:18 pm Post subject: |
|
|
Code: | {$lua}
[ENABLE]
UDF1.CETrackBar1.Enabled = true
[DISABLE]
UDF1.CETrackBar1.Enabled = false |
|
|
Back to top |
|
 |
lothe23 Advanced Cheater
Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Thu Jul 07, 2016 9:28 am Post subject: |
|
|
Zanzer wrote: | Code: | {$lua}
[ENABLE]
UDF1.CETrackBar1.Enabled = true
[DISABLE]
UDF1.CETrackBar1.Enabled = false |
|
But how do i use it? would something like this work?
Code: |
function CETrackBar1Change(sender)
if (trackBar_getState(CETrainer.CETrackBar1) == 0) then
writeInteger("game.exe+0084E4BC", 2)
if (trackBar_getState(CETrainer.CETrackBar1) == 1) then
writeInteger("game.exe+0084E4BC",3)
if (trackBar_getState(CETrainer.CETrackBar1) == 2) then
writeInteger("game.exe+0084E4BC", 4)
if (trackBar_getState(CETrainer.CETrackBar1) == 3) then
writeInteger("game.exe+0084E4BC", 5)
end
end |
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4699
|
Posted: Thu Jul 07, 2016 9:43 am Post subject: |
|
|
Code: | function CECheckbox1Change(sender)
writeInteger(address,0)
UDF1.CETrackBar1.Enabled = sender.Checked
end
function CETrackBar1Change(sender)
if sender.Position == 0 then
writeInteger(address,1)
elseif sender.Position == 1 then
writeInteger(address,2)
elseif sender.Position == 2 then
writeInteger(address,3)
else
writeInteger(address,4)
end
end |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
lothe23 Advanced Cheater
Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Thu Jul 07, 2016 10:35 am Post subject: |
|
|
ParkourPenguin wrote: | Code: | function CECheckbox1Change(sender)
writeInteger(address,0)
UDF1.CETrackBar1.Enabled = sender.Checked
end
function CETrackBar1Change(sender)
if sender.Position == 0 then
writeInteger(address,1)
elseif sender.Position == 1 then
writeInteger(address,2)
elseif sender.Position == 2 then
writeInteger(address,3)
else
writeInteger(address,4)
end
end |
|
When i did it like this the speedhack checkbox wrote fine, however the trackbar still did nothing (yes i assigned the trackbar aswell)
Code: | function CETrainerCheckbox47Change(sender)
CETrainer.CETrackBar1.Enabled = sender.Checked
end
function CETrainerTrackBar1Change(sender)
if sender.Position == 0 then
writeFloat(0x0639AD14,2)
elseif sender.Position == 1 then
writeFloat(0x0639AD14,3)
elseif sender.Position == 2 then
writeFloat(0x0639AD14,4)
elseif sender.Position == 3 then
writeFloat(0x0639AD14,5)
else
writeFloat(0x0639AD14,1.5)
end
end |
I removed the writeFloat from the checkbox since i dont think ill need that, however the trackbar still doesent change anything. (max is "3" on the trackbar, so it got four positions)
i also changed it to Float since its a float value and not a 4byte (my bad)
any more suggestions to what i can change?[/code]
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4699
|
Posted: Thu Jul 07, 2016 10:42 am Post subject: |
|
|
Code: | function CETrainerTrackBar1Change(sender)
print(sender.Position)
end |
Move the trackbar from one end to the other and let me know what this outputs.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
lothe23 Advanced Cheater
Reputation: 0
Joined: 28 May 2016 Posts: 51
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4699
|
Posted: Thu Jul 07, 2016 10:57 am Post subject: |
|
|
It works fine for me. You either didn't execute the script or didn't exit the form designer before testing it.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
lothe23 Advanced Cheater
Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Thu Jul 07, 2016 11:03 am Post subject: |
|
|
ParkourPenguin wrote: | It works fine for me. You either didn't execute the script or didn't exit the form designer before testing it. |
i generated it and nothing happened
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4699
|
Posted: Thu Jul 07, 2016 11:08 am Post subject: |
|
|
Open this .CT, execute the Lua script, and figure out the difference between your code and this.
Description: |
|
 Download |
Filename: |
Trackbar Example.CT |
Filesize: |
515 Bytes |
Downloaded: |
789 Time(s) |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
lothe23 Advanced Cheater
Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Thu Jul 07, 2016 11:21 am Post subject: |
|
|
ParkourPenguin wrote: | Open this .CT, execute the Lua script, and figure out the difference between your code and this. |
oh so this is what screws the trackbar up
Code: | CETrainerTrackBar1Change |
It works when its like this
Stupid mistake lol, thx!
and btw, how do i add so i writeFloat 1.5 when the checkbox is unchecked?
Currently looks like this:
Code: | function CETrainerCheckbox47Change(sender)
CETrainer.CETrackBar1.Enabled = sender.Checked
end
function CETrackBar1Change(sender)
if sender.Position == 0 then
writeFloat(0x0639AD14,2)
elseif sender.Position == 1 then
writeFloat(0x0639AD14,3)
elseif sender.Position == 2 then
writeFloat(0x0639AD14,4)
elseif sender.Position == 3 then
writeFloat(0x0639AD14,5)
else
writeFloat(0x0639AD14,1.5)
end
end
|
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4699
|
Posted: Thu Jul 07, 2016 11:25 am Post subject: |
|
|
Similar to my original post:
Code: | function CECheckbox1Change(sender)
UDF1.CETrackBar1.Enabled = sender.Checked
if not sender.Checked then writeFloat(address,1.5) end
end |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
lothe23 Advanced Cheater
Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Thu Jul 07, 2016 11:30 am Post subject: |
|
|
ParkourPenguin wrote: | Similar to my original post:
Code: | function CECheckbox1Change(sender)
UDF1.CETrackBar1.Enabled = sender.Checked
if not sender.Checked then writeFloat(address,1.5) end
end |
|
Okay, thank you for all your help, i really do apprechiate it
|
|
Back to top |
|
 |
|