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 


Read information from Listbox

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
jacky15
How do I cheat?
Reputation: 0

Joined: 09 Feb 2016
Posts: 4

PostPosted: Fri Feb 12, 2016 1:30 pm    Post subject: Read information from Listbox Reply with quote

In listbox have some information. How to make so that it reads a line in listbox.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Fri Feb 12, 2016 1:48 pm    Post subject: Reply with quote

ListBoxObject.Items.Count returns the number of lines

ListBoxObject.Items[0] returns the first line
ListBoxObject.Items[ListBoxObject.Count-1] returns the last line
ListBoxObject.Items[ListBoxObject.ItemIndex] returns the selected line

If no line is selected ListBoxObject.ItemIndex will be -1, which is invalid, so check for that

_________________
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
jacky15
How do I cheat?
Reputation: 0

Joined: 09 Feb 2016
Posts: 4

PostPosted: Sat Feb 20, 2016 4:19 am    Post subject: Reply with quote

Okay. thx.
How do I get the address value equal to the line number.
Back to top
View user's profile Send private message
LastExceed
Expert Cheater
Reputation: 1

Joined: 05 Nov 2014
Posts: 130

PostPosted: Sun Feb 21, 2016 5:36 am    Post subject: Reply with quote

Can you explain what you are looking for a little more detailed?
Back to top
View user's profile Send private message
jacky15
How do I cheat?
Reputation: 0

Joined: 09 Feb 2016
Posts: 4

PostPosted: Sun Feb 21, 2016 6:59 am    Post subject: Reply with quote

Yep, i can.
Look, let's say the game is a a list of items. There is an address. 00B51FA0.

If the value of the game is 0 then it will be in the label to write 1 line, that is nothing. If the value is 1, then 2 line - that is the key. And etc...



name0.png
 Description:
 Filesize:  50.89 KB
 Viewed:  4882 Time(s)

name0.png


Back to top
View user's profile Send private message
LastExceed
Expert Cheater
Reputation: 1

Joined: 05 Nov 2014
Posts: 130

PostPosted: Sun Feb 21, 2016 7:15 am    Post subject: Reply with quote

So you want the label to show the ListBox line that is given by the address 00B51FA0, did I get that right?

For this you need to use a timer that constantly looks up the value of the given address. Let's assume your form, Label and ListBox are called 'UDF1', 'CELabel1' and 'CEListBox1' (the default names).
Code:
t=createTimer()
t.OnTimer=function(sender)
  UDF1.CELabel1.caption=UDF1.CEListBox1.Items[readInteger('00B51FA0')]
end
t.interval=10
t.enabled=true


Remember that the first line in the list is line 0, NOT line 1.

Also make sure that the value of that address is never higher than the amount of items in the listbox, because if e.g. the value is 123123, it tries to find line 123123 in the listbox, which doesn't exist and therefore returns an error (or just nil, I'm not sure tbh).
Back to top
View user's profile Send private message
jacky15
How do I cheat?
Reputation: 0

Joined: 09 Feb 2016
Posts: 4

PostPosted: Sun Feb 21, 2016 10:44 am    Post subject: Reply with quote

Thank you, yes I know that counting starts from 0, it is just at hand.
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