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 


How to do this in lua?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Sat Mar 10, 2012 1:03 pm    Post subject: How to do this in lua? Reply with quote

Sorry I couldn't think of a suitable topic for this.
Code:

       
         f.checkbox2=checkboxes(f.form,10,30)
         f.checkbox3=checkboxes(f.form,10,50)
         f.checkbox4=checkboxes(f.form,10,70)
         f.checkbox5=checkboxes(f.form,10,90)


I want to perform above effect using for loop how to do that.

Code:
     

         m=10
         for i=1,4 do

             f.checkbox..i+1=checkbox(f.form,10,m)
             m=m+10
         end

This code is not working. Even using paranthesis like f.(checkbox..1+1) gives me error
Back to top
View user's profile Send private message Send e-mail
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8517
Location: 127.0.0.1

PostPosted: Sat Mar 10, 2012 1:24 pm    Post subject: Reply with quote

You could do something like this:

Code:

local form = createForm( true );

local checkBoxes = {};
checkBoxes[1] = createCheckBox( form );
checkBoxes[2] = createCheckBox( form );
checkBoxes[3] = createCheckBox( form );
checkBoxes[4] = createCheckBox( form );
checkBoxes[5] = createCheckBox( form );

for x = 1, #checkBoxes do
    control_setCaption( checkBoxes[x], "This is checkbox " .. tostring( x ) );
    control_setPosition( checkBoxes[x], 10, x * 20 )
end

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
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