View previous topic :: View next topic |
Author |
Message |
ParkourPenguin I post too much Reputation: 138
Joined: 06 Jul 2014 Posts: 4275
|
Posted: Sun Jun 05, 2016 2:07 pm Post subject: |
|
|
In the form designer, click on the button, go to the "Events" tab in the object inspector, and assign some function to the OnClick event. That function will now be called when you click on the button.
To add stuff to the combo box, click on it, go to the "Properties" tab in the object inspector, go to "Items", click on the ellipsis (...) button, and put the values of the combo box there. If you exit out of the form designer, you'll be able to click on it and see the different options.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
mausi125 Advanced Cheater Reputation: 1
Joined: 05 Jun 2014 Posts: 86
|
Posted: Sun Jun 05, 2016 2:12 pm Post subject: |
|
|
ParkourPenguin wrote: | In the form designer, click on the button, go to the "Events" tab in the object inspector, and assign some function to the OnClick event. That function will now be called when you click on the button.
To add stuff to the combo box, click on it, go to the "Properties" tab in the object inspector, go to "Items", click on the ellipsis (...) button, and put the values of the combo box there. If you exit out of the form designer, you'll be able to click on it and see the different options. |
Oneclick event = teleportClicked ( with this )
autoAssemble("globalalloc(Coordinates, 30)", true)
ExampleForm.show()
ExampleForm.OnClose = function()
closeCE()
return caFree
end
function teleportClicked(sender)
local i = ExampleForm.LocationComboBox.ItemIndex
if i == 0 then
writeFloat("[[[[UnityEngine.dll+014817B4]+30]+0]+428]+78", 809.243103)
writeFloat("[[[[UnityEngine.dll+014817B4]+30]+0]+428]+7C", 459.3176575)
elseif i == 1 then
writeDoubleLocal("Coordinates", -123)
writeDoubleLocal("Coordinates+8", -523)
elseif i == 2 then
writeDoubleLocal("Coordinates", 273)
writeDoubleLocal("Coordinates+8", -1738)
elseif i == 3 then
writeDoubleLocal("Coordinates", -871)
writeDoubleLocal("Coordinates+8", 157)
elseif i == 4 then
writeDoubleLocal("Coordinates", 10923)
writeDoubleLocal("Coordinates+8", 199239)
end
end
if updateT then updateT.destroy() end
updateT = createTimer(ExampleForm, true)
updateT.Interval = 100
updateT.OnTimer = function(sender)
ExampleForm.XEdit.Text = tostring(readDoubleLocal("Coordinates"))
ExampleForm.YEdit.Text = tostring(readDoubleLocal("Coordinates+8"))
end
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 138
Joined: 06 Jul 2014 Posts: 4275
|
Posted: Sun Jun 05, 2016 2:19 pm Post subject: |
|
|
What? No. Half of that is code that won't work with your form. Just use something like I showed previously:
Code: | function CEButton1Click(sender)
local i = UDF1.CEComboBox1.ItemIndex
if i == 0 then
writeFloat("[[[[UnityEngine.dll+014817B4]+30]+0]+428]+78", 809.243103)
writeFloat("[[[[UnityEngine.dll+014817B4]+30]+0]+428]+7C", 459.3176575)
elseif i == 1 then
writeFloat("[[[[UnityEngine.dll+014817B4]+30]+0]+428]+78", 583.2)
writeFloat("[[[[UnityEngine.dll+014817B4]+30]+0]+428]+7C", 123.45)
-- etc...
end
end |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
mausi125 Advanced Cheater Reputation: 1
Joined: 05 Jun 2014 Posts: 86
|
Posted: Sun Jun 05, 2016 2:25 pm Post subject: |
|
|
Combobox added
Teleport Button added but when i click = Error:[string "function CEButton1Click(sender)
..."]:2: attempt to index a nil value (global 'UDF1')
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 138
Joined: 06 Jul 2014 Posts: 4275
|
Posted: Sun Jun 05, 2016 2:26 pm Post subject: |
|
|
Rename UDF1 to whatever the name of your form is. Same thing for CEComboBox1.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
mausi125 Advanced Cheater Reputation: 1
Joined: 05 Jun 2014 Posts: 86
|
Posted: Sun Jun 05, 2016 2:30 pm Post subject: |
|
|
ParkourPenguin wrote: | Rename UDF1 to whatever the name of your form is. Same thing for CEComboBox1. |
No error now but when i click ( nothing ) no teleport / no error
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 138
Joined: 06 Jul 2014 Posts: 4275
|
Posted: Sun Jun 05, 2016 2:34 pm Post subject: |
|
|
Are you sure you assigned the right function (CEButton1Click in the previous example) to the OnClick event?
Are you sure you selected something valid in the combo box?
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
mausi125 Advanced Cheater Reputation: 1
Joined: 05 Jun 2014 Posts: 86
|
Posted: Sun Jun 05, 2016 2:45 pm Post subject: |
|
|
ParkourPenguin wrote: | Are you sure you assigned the right function (CEButton1Click in the previous example) to the OnClick event?
Are you sure you selected something valid in the combo box? |
Yes sure, ( UDF1.CEComboBox1.ItemIndex ) to Teleport.Teleport.ItemIndex
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 138
Joined: 06 Jul 2014 Posts: 4275
|
Posted: Sun Jun 05, 2016 2:52 pm Post subject: |
|
|
Your form name and button name shouldn't be the same. I didn't even ask about that, but you should change that as well.
Please verify and explicitly state that you are doing both of the things I asked you about.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
mausi125 Advanced Cheater Reputation: 1
Joined: 05 Jun 2014 Posts: 86
|
Posted: Sun Jun 05, 2016 3:03 pm Post subject: |
|
|
My button ( Caption = Test / Name = Teleport )
( Test.Teleport.ItemIndex ) ?
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 138
Joined: 06 Jul 2014 Posts: 4275
|
Posted: Sun Jun 05, 2016 3:06 pm Post subject: |
|
|
The name of the form comes first. Not the name of your button.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
mausi125 Advanced Cheater Reputation: 1
Joined: 05 Jun 2014 Posts: 86
|
Posted: Sun Jun 05, 2016 3:11 pm Post subject: |
|
|
Error:[string "function Test(sender)
..."]:2: attempt to index a nil value (global 'Teleport')
sorry to be so silly
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 138
Joined: 06 Jul 2014 Posts: 4275
|
Posted: Sun Jun 05, 2016 3:20 pm Post subject: |
|
|
The name of your form.
Look near the top of the object inspector.
Look for something that has ": TCEForm" at the end of it.
That is your form. The string to the left of that is your form name.
To verify, click on it, go to the "Properties" tab, and scroll down to the "Name" property. That is the thing you should use to reference the form in the Lua script.
Now find out the name of the combo box as well the same way (click on the combo box to select it quickly). Do NOT use the button's name; I don't know where you got that idea.
In the code, instead of "UDF1.CEComboBox1.ItemIndex", put down FormName.ComboBoxName.ItemIndex. Replace FormName with whatever the name of your form is and replace ComboBoxName with whatever the name of your combo box is.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
mausi125 Advanced Cheater Reputation: 1
Joined: 05 Jun 2014 Posts: 86
|
Posted: Sun Jun 05, 2016 3:23 pm Post subject: |
|
|
Now work Form = trainer name
function Teleport(sender)
local i = CETrainer.LocationComboBox.ItemIndex
if i == 0 then
writeFloat("[[[[UnityEngine.dll+014817B4]+30]+0]+428]+78", 809.243103)
writeFloat("[[[[UnityEngine.dll+014817B4]+30]+0]+428]+7C", 459.3176575)
elseif i == 1 then
writeFloat("[[[[UnityEngine.dll+014817B4]+30]+0]+428]+78", 583.2)
writeFloat("[[[[UnityEngine.dll+014817B4]+30]+0]+428]+7C", 123.45)
-- etc...
end
end
|
|
Back to top |
|
|
|