|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sun Oct 25, 2015 9:09 am Post subject: Testing Looping Text Display in pure lua |
|
|
Hi guys,
I try make a test to displaying a text (in iterating letter) by a timer function.
With long way method :
Code: |
function text_looper()
reset()
c=createTimer(nil)
c.Interval=1000
c.OnTimer=function(c)
control_setVisible(UDF1.CELabel1, true)
control_setCaption(UDF1.CELabel1, 'H')
end
c.Enabled=true
o1=createTimer(nil)
o1.Interval=2000
o1.OnTimer=function(o1)
control_setVisible(UDF1.CELabel2, true)
control_setCaption(UDF1.CELabel2, 'a')
end
o1.Enabled=true
r1=createTimer(nil)
r1.Interval=3000
r1.OnTimer=function(r1)
control_setVisible(UDF1.CELabel3, true)
control_setCaption(UDF1.CELabel3, 'c')
end
r1.Enabled=true
r2=createTimer(nil)
r2.Interval=4000
r2.OnTimer=function(r2)
control_setVisible(UDF1.CELabel4, true)
control_setCaption(UDF1.CELabel4, 'k')
end
r2.Enabled=true
o2=createTimer(nil)
o2.Interval=5000
o2.OnTimer=function(o2)
control_setVisible(UDF1.CELabel5, true)
control_setCaption(UDF1.CELabel5, 'i')
end
o2.Enabled=true
d=createTimer(nil)
d.Interval=6000
d.OnTimer=function(d)
control_setVisible(UDF1.CELabel6, true)
control_setCaption(UDF1.CELabel6, 'n')
end
d.Enabled=true
e=createTimer(nil)
e.Interval=7000
e.OnTimer=function(e)
control_setVisible(UDF1.CELabel7, true)
control_setCaption(UDF1.CELabel7, 'g')
end
e.Enabled=true
r3=createTimer(nil)
r3.Interval=8000
r3.OnTimer=function(r3)
control_setVisible(UDF1.CELabel8, true)
control_setCaption(UDF1.CELabel8, 's')
end
r3.Enabled=true
cl=createTimer(nil)
cl.Interval=9000
cl.OnTimer=function(cl)
reset()
end
cl.Enabled=true
reset()
end
function reset()
control_setVisible(UDF1.CELabel1, false)
control_setVisible(UDF1.CELabel2, false)
control_setVisible(UDF1.CELabel3, false)
control_setVisible(UDF1.CELabel4, false)
control_setVisible(UDF1.CELabel5, false)
control_setVisible(UDF1.CELabel6, false)
control_setVisible(UDF1.CELabel7, false)
control_setVisible(UDF1.CELabel8, false)
end
---- test
text_looper()
|
When it run, text "Hackings" displaying letter by letter in right sequential with a time difference of 1 second displays each letter, but after reset() function, the text display not in the order. Does someone should help to fix the problem ?
Next, if use :
Code: |
text=tostring("Hackings")
a = string.sub(text,1) --- give result "Hackings"
print(a)
|
How to put "for..do" and give timer (/1 seconds every iterate letters) to display in order ?
Sorry for bad explanation in bad English
Regards
Description: |
Test to display a text. Iterating letter by letter |
|
Download |
Filename: |
CRDR_Test_Text_Looping.CT |
Filesize: |
2.59 KB |
Downloaded: |
752 Time(s) |
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Oct 25, 2015 9:21 am Post subject: |
|
|
Code: | text = "Hacking"
index = 1
c=createTimer(nil)
c.Interval=1000
c.OnTimer=function(c)
if index <= #text then
control_setVisible(UDF1.CELabel1, true)
control_setCaption(UDF1.CELabel1, text:sub(1,index)
index = index + 1
end
end
c.Enabled=true
function reset()
index = 1
end |
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sun Oct 25, 2015 10:29 am Post subject: |
|
|
Thank so much Zanzer, I really appreciate it.
I just make little modified with the code and now it's working fine.
Code: |
text = "Hacking"
index = 1
c=createTimer(nil)
c.Interval=1000
c.OnTimer=function(c)
if index <= #text then
control_setVisible(UDF1.CELabel1, true)
control_setCaption(UDF1.CELabel1, text:sub(1,index))
index = index + 1
else
control_setVisible(UDF1.CELabel1, false)
index = 1
end
end
c.Enabled=true
|
Regards
|
|
Back to top |
|
|
|
|
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
|
|