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 make moving stars from left to right?

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

Joined: 31 Aug 2013
Posts: 305

PostPosted: Thu Dec 17, 2015 10:42 pm    Post subject: How make moving stars from left to right? Reply with quote

Hi Again.
How make lua script for moving stars from left to right?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Thu Dec 17, 2015 11:34 pm    Post subject: This post has 1 review(s) Reply with quote

You are an odd one, indeed.
Code:
index = 0
spaces = 40
step = 1
values = {}
for i=0,spaces do
  local text = "*"
  for j=0,i do
    text = " " .. text
  end
  values[i] = text
end
timer=createTimer(nil, false)
timer.Interval=100
timer.OnTimer=function(timer)
  if index >= spaces then
    step = -1
  elseif index <= 0 then
    step = 1
  end
  index = index + step
  UDF1.CELabel1.SetCaption(values[index])
end
timer.Enabled=true
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Fri Dec 18, 2015 5:42 am    Post subject: Reply with quote

How slow speed of text.this is very fast?
I want creating animation stars randomize colors.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Dec 18, 2015 4:46 pm    Post subject: Reply with quote

Change the Interval to speed up the "animation"
Code:
index = 0
spaces = 40
step = 1
values = {}
for i=0,spaces do
  local text = "***"
  for j=0,i do
    text = " " .. text
  end
  values[i] = text
end
--timer=createTimer(nil, false)
timer.Interval=100
timer.OnTimer=function(timer)
  if index >= spaces then
    step = -1
  elseif index <= 0 then
    step = 1
  end
  index = index + step
  UDF1.CELabel1.SetCaption(values[index])
  local color = 0
  for i=0,3 do
    color = color * 10 + math.random(255)
  end
  UDF1.CELabel1.Font.Color = color
end
timer.Enabled=true
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Mon Dec 21, 2015 6:26 am    Post subject: Reply with quote

okay , but colors have fast speed , how to down speed of colors.
And , how to make script for create lable in any locations with lua.
and, script for show form.
Thanks.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Mon Dec 21, 2015 7:36 am    Post subject: Reply with quote

Maybe spend some time learning LUA?
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Mon Dec 21, 2015 7:49 am    Post subject: Reply with quote

from where learn lua?
is hard lua learn?this is very hard?
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Mon Dec 21, 2015 7:53 am    Post subject: Reply with quote

1. I used Google.

2. After using google for 2 seconds, I found this.
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Mon Dec 21, 2015 7:58 am    Post subject: Reply with quote

LUA learning is easy or hard?
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Mon Dec 21, 2015 10:53 am    Post subject: Reply with quote

Learning is always subjective, isn't it? If you expect to be spoon-fed everything without putting forth any effort, it will be very difficult for you to learn.
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