View previous topic :: View next topic |
Author |
Message |
Starter_But Advanced Cheater Reputation: 0
Joined: 26 Oct 2021 Posts: 53
|
Posted: Tue Oct 26, 2021 11:56 am Post subject: Lua scripts |
|
|
how to loop a function for a certain number of times.I made a teleport by coordinates and I want it to pass an infinite number of times at these coordinates or at least 100 times |
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Tue Oct 26, 2021 12:54 pm Post subject: |
|
|
Use something called a 'for' loop. |
|
Back to top |
|
|
Starter_But Advanced Cheater Reputation: 0
Joined: 26 Oct 2021 Posts: 53
|
Posted: Tue Oct 26, 2021 1:04 pm Post subject: |
|
|
Example:
WriteInteger("92838482",1000)
WriteInteger ("92838482",4000)
how to make a loop so that the program goes through this list over and over again |
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Tue Oct 26, 2021 1:08 pm Post subject: |
|
|
for loop
Search engines are your friend. I have told you what you need to do, all you have to do is put in the effort to learn. |
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8517 Location: 127.0.0.1
|
Posted: Tue Oct 26, 2021 2:10 pm Post subject: |
|
|
Please take the time to learn basic Lua. This is something that is part of the language itself. _________________
- Retired. |
|
Back to top |
|
|
panraven Grandmaster Cheater Reputation: 55
Joined: 01 Oct 2008 Posts: 942
|
Posted: Tue Oct 26, 2021 2:55 pm Post subject: |
|
|
100 'for' loop writing a values will happened within 1ms, it may be a bit useful to do with a timer to keep writing the values for a duration, kind of 'freeze' with a duration.
eg.
Code: |
{$lua}
local duration = 5000 -- in ms, so 5000ms is 5sec
local interval = 250 -- in ms, how often to write the value, 250ms is 1/4 sec
local timer = createTimer()
timer.Interval, timer.OnTimer = interval, function(tmr)
if duration<0 then tmr.Destroy() else duration = duration - interval end -- writing done when duration go below 0
-- do the address write --
end
timer.Enabled = true
{$asm}
|
_________________
- Retarded. |
|
Back to top |
|
|
Starter_But Advanced Cheater Reputation: 0
Joined: 26 Oct 2021 Posts: 53
|
Posted: Tue Oct 26, 2021 3:07 pm Post subject: |
|
|
Это всё хуйня,я научился делать намного круче |
|
Back to top |
|
|
|