Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Help Combobox Trainer with cheat engine
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Jun 05, 2016 2:07 pm    Post subject: This post has 1 review(s) Reply with quote

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
View user's profile Send private message
mausi125
Advanced Cheater
Reputation: 1

Joined: 05 Jun 2014
Posts: 86

PostPosted: Sun Jun 05, 2016 2:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Jun 05, 2016 2:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
mausi125
Advanced Cheater
Reputation: 1

Joined: 05 Jun 2014
Posts: 86

PostPosted: Sun Jun 05, 2016 2:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Jun 05, 2016 2:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
mausi125
Advanced Cheater
Reputation: 1

Joined: 05 Jun 2014
Posts: 86

PostPosted: Sun Jun 05, 2016 2:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Jun 05, 2016 2:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
mausi125
Advanced Cheater
Reputation: 1

Joined: 05 Jun 2014
Posts: 86

PostPosted: Sun Jun 05, 2016 2:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Jun 05, 2016 2:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
mausi125
Advanced Cheater
Reputation: 1

Joined: 05 Jun 2014
Posts: 86

PostPosted: Sun Jun 05, 2016 3:03 pm    Post subject: Reply with quote

My button ( Caption = Test / Name = Teleport )

( Test.Teleport.ItemIndex ) ?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Jun 05, 2016 3:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
mausi125
Advanced Cheater
Reputation: 1

Joined: 05 Jun 2014
Posts: 86

PostPosted: Sun Jun 05, 2016 3:11 pm    Post subject: Reply with quote

Error:[string "function Test(sender)
..."]:2: attempt to index a nil value (global 'Teleport')

sorry to be so silly
Sad
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Jun 05, 2016 3:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
mausi125
Advanced Cheater
Reputation: 1

Joined: 05 Jun 2014
Posts: 86

PostPosted: Sun Jun 05, 2016 3:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites