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 


Using setMethodProperty to return input values from user

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Ludwig
Advanced Cheater
Reputation: 0

Joined: 10 Jan 2016
Posts: 68

PostPosted: Wed Sep 14, 2016 3:18 pm    Post subject: Using setMethodProperty to return input values from user Reply with quote

Gooda day...
im trying a piece from another users script to see how it works...but cant seem to get it to return data that the user is iputting,,,
it starts like...

Code:
 self.editu = createEdit(self.form);
   self.editu.Caption = '';
   self.editu.Top = 67;
   self.editu.Left = 95;
   self.editu.Width = 305;
   self.editu.Height = 20;

   self.editp = createEdit(self.form);
   self.editp.Caption = '';
   self.editp.Top = 118;
   self.editp.Left = 95;
   self.editp.Width = 305;
   self.editp.Height = 20;
   setProperty(self.editp,"PasswordChar", "*");
   setProperty(self.editp,'EchoMode','emPassword');


where the username and pasw should be entered...then...he used
Code:
   setMethodProperty(self.editu, "OnKeyPress", function (sender,key) key_hex = string.byte(key); if key_hex==13 then key = nil; self:login(); return key; end; return key; end);
    setMethodProperty(self.editp, "OnKeyPress", function (sender,key) key_hex = string.byte(key); if key_hex==13 then key = nil; self:login(); return key; end; return key; end);

print('='..self.editu.Caption..'='..self.editp.Caption..'=')

but i cant get it to return the data
all i get on the print is "==="

it looks like a petty neat method...but i cant figure out why its not returning anything...
i have used
Code:
uname = inputQuery("Player name to search :", " ",nil);
control_setCaption(self.update_name,uname);


before, but would like this method aswell
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Wed Sep 14, 2016 3:41 pm    Post subject: Reply with quote

edit controls don't have a Caption field, they have a Text field so self.editu.Text and self.editp.Text

also, you can just do:
Code:

self.editu.OnKeyPress=function (sender,key) key_hex = string.byte(key); if key_hex==13 then key = nil; self:login(); return key; end; return key; end);


(of course, instead of looking for the enter key, you can just add a Login button on the form, and set it's Default property to true. Enter keypresses then press that button instead)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Ludwig
Advanced Cheater
Reputation: 0

Joined: 10 Jan 2016
Posts: 68

PostPosted: Wed Sep 14, 2016 4:38 pm    Post subject: Reply with quote

thnx DB...Smile
this will hlp...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
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