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] about set CEEdit

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

Joined: 09 Feb 2013
Posts: 5

PostPosted: Sat Feb 09, 2013 12:06 am    Post subject: [help] about set CEEdit Reply with quote

if i want
Code:

control_setCaption(CE_CEEdit1,"1")
control_setCaption(CE_CEEdit2,"2")
control_setCaption(CE_CEEdit3,"3")
control_setCaption(CE_CEEdit4,"4")
         .
         .
         .
         .
control_setCaption(CE_CEEdit100,"100")

how can i do ?
Back to top
View user's profile Send private message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Sat Feb 09, 2013 1:05 am    Post subject: Reply with quote

What do you want to do? I really didn't understand you...
What you wrote is working fine..

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
Moonbluelegend
How do I cheat?
Reputation: 0

Joined: 09 Feb 2013
Posts: 5

PostPosted: Sat Feb 09, 2013 1:10 am    Post subject: Reply with quote

Flashacking wrote:
What do you want to do? I really didn't understand you...
What you wrote is working fine..


i want to use for write

for i=1,100 do
control_setCaption(CE_Edit1~100,i)
end
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: Sat Feb 09, 2013 3:08 am    Post subject: Reply with quote

Place those edits inside an Panel and then get then enumerate through the components in the panel object(component_getComponentCount and component_getComponent) and call control_setCaption for those components.

or just create an array with references to the objects once and reuse it each time
Code:

edits={}
edits[1]=CE_CEEdit1
edits[2]=CE_CEEdit2
edits[3]=CE_CEEdit3
....
edits[10000000000]=CE_CEEdit10000000000
....
for i=1,10000000000 do
  control_setCaption(edits[i],i)
end

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

Joined: 09 Feb 2013
Posts: 5

PostPosted: Sat Feb 09, 2013 10:59 am    Post subject: Reply with quote

Dark Byte wrote:
Place those edits inside an Panel and then get then enumerate through the components in the panel object(component_getComponentCount and component_getComponent) and call control_setCaption for those components.

Thanks !

Code:

editnameid=0
function CEButton1Click(sender)
   for i=0,component_getComponentCount(CE)-1 do
      if checkEditName(i) then
          control_setCaption(component_getComponent(CE,i),editnameid)
      end
   end
end

function checkEditName(num)
local temp={}
   for myi=1,100 do
      temp[myi]=myi
   end
   for myj=1,#temp do
       if component_getName(component_getComponent(CE,num))=="CEEdit"..temp[myj] then
          editnameid=myj
          return true
       end
   end
return false
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 -> 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