View previous topic :: View next topic |
Author |
Message |
Dr.Disrespect Grandmaster Cheater Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Thu Feb 25, 2016 1:40 am Post subject: Timer in Lua script. |
|
|
Hi there. I would like to know if I use timer in the right way, here are the codes, thanks a lot:
Code: |
function myTimer()
print "1"
end
tmer = createTimer(nil)
timer_onTimer(tmer,myTimer)
timer_setInterval(tmer, 1000)
timer_setEnabled(tmer, true)
|
and
Code: |
count = 0
function myTimer()
if count < 10 then
count = count + 1
print "running"
else
timer_setEnabled(tmer, false)
print "stopped"
end
end
tmer = createTimer(nil)
timer_onTimer(tmer,myTimer)
timer_setInterval(tmer, 1000)
timer_setEnabled(tmer, true)
|
I also used the following timer script in Lua. However, I couldn't not stop the timer, the "showMessage" kept popping up....
Code: |
counter = 0
local function myTimer1()
counter = counter + 1
if counter < 1 then
else
timer_setEnabled(tmer,false)
getAddressList().getMemoryRecordByDescription('General').Active=true
getAddressList().getMemoryRecordByDescription('Change1').Active=true
getAddressList().getMemoryRecordByDescription('Change2').Active=true
showMessage("Stop") <---- This message keeps popping up even after I timer_setEnabled to false....
end
tmer1 = createTimer()
timer_setInterval(tmer1, 1500)
timer_onTimer(tmer1, myTimer1)
timer_setEnabled(tmer1, true)
|
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25298 Location: The netherlands
|
Posted: Thu Feb 25, 2016 3:03 am Post subject: |
|
|
you're using an obsolete syntax, but for now it still works
as for the last script, use
Code: |
tmer1.enabled=false
|
(or give function myTimer1() a parameter and set that to disabled)
_________________
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 |
|
|
Dr.Disrespect Grandmaster Cheater Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Thu Feb 25, 2016 10:15 am Post subject: |
|
|
Dark Byte wrote: | you're using an obsolete syntax, but for now it still works
as for the last script, use
Code: |
tmer1.enabled=false
|
(or give function myTimer1() a parameter and set that to disabled) |
Thanks for the reply.
|
|
Back to top |
|
|
danrevella Master Cheater Reputation: 2
Joined: 11 Jun 2008 Posts: 290
|
Posted: Thu Feb 25, 2016 11:25 am Post subject: |
|
|
why not put here a version with the new syntax?
|
|
Back to top |
|
|
Dr.Disrespect Grandmaster Cheater Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Thu Feb 25, 2016 11:28 am Post subject: |
|
|
danrevella wrote: | why not put here a version with the new syntax? |
I wanted to say that too. :d
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Feb 25, 2016 2:19 pm Post subject: |
|
|
Code: | tmer = createTimer(nil, false)
tmer.OnTimer = function(timer)
print "1"
end
tmer.Interval = 1000
tmer.Enabled = true |
|
|
Back to top |
|
|
facecheats Newbie cheater Reputation: 0
Joined: 12 Jul 2015 Posts: 20
|
Posted: Thu Feb 25, 2016 6:53 pm Post subject: |
|
|
Code: | http = require("socket.http")
function timeZone()
local now = os.time()
return os.difftime(now, os.time(os.date('!*t',now)))
end
local ServerTime = http.request("website")
local CurTime = tonumber(ServerTime:sub(21,-6))
local MaxTime = os.time{year=2015, month=07, day=15, hour=23, min=59, sec=59, isdst=false} + timeZone()
if MaxTime>CurTime then showMessage("OBRIGADO PARA LOGIN \N AJORA TRENADOR CONTINUA") else end
if MaxTime<=CurTime then showMessage("NO PAY NO PLAY \N PAY OR FUCK OFF HAHAHAHAA...") CloseCE() else end
--==============================ADDS admaggo.ts=====================================--
function reclame()
shellExecute("website")
end
KeyTimer = createTimer(formInfo,false)
timer_setInterval(KeyTimer, 100000) -- 1 min. per attivare il POPUP Automatico di un sito prescelto...
timer_onTimer(KeyTimer, reclame)
timer_setEnabled(KeyTimer, true)
| [/code]
_________________
dved rvrdv vrevr rvrve |
|
Back to top |
|
|
Dr.Disrespect Grandmaster Cheater Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Fri Feb 26, 2016 12:14 am Post subject: |
|
|
Thank you all for the reply. Now I know how to use a timer.
|
|
Back to top |
|
|
Cestra Newbie cheater Reputation: 0
Joined: 03 Jun 2016 Posts: 14
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Jun 09, 2016 6:46 pm Post subject: |
|
|
Why are you calling openProcess repeatedly? Stop it!
Code: | tmer.OnTimer = function(timer)
local success = openProcess("calc.exe")
if success then
print("found!")
timer.Enabled = false
else
-- blah
end
end |
|
|
Back to top |
|
|
Cestra Newbie cheater Reputation: 0
Joined: 03 Jun 2016 Posts: 14
|
Posted: Thu Jun 09, 2016 6:58 pm Post subject: |
|
|
Zanzer wrote: | Why are you calling openProcess repeatedly? Stop it!
Code: | tmer.OnTimer = function(timer)
local success = openProcess("calc.exe")
if success then
print("found!")
timer.Enabled = false
else
-- blah
end
end |
|
Thx zanzer but I tried it. How I know, when user open the game?
Exp;
Code: | GameTimer=createTimer(nil)
GameTimer.Interval=1000
GameTimer.OnTimer=function(GameTimer)
local success = openProcess("game.exe")
if success then
UDF1.CELabel1.Caption="Game found"
UDF1.CELabel1.Font.Color=0x006600
GameTimer.Enabled=false
else
UDF1.CELabel1.Caption="Game not found"
UDF1.CELabel1.Font.Color=0x0000A4
end
end
GameTimer.Enabled=true |
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Jun 09, 2016 9:42 pm Post subject: |
|
|
When "success" is true, the user has opened the game.
|
|
Back to top |
|
|
Zec Newbie cheater Reputation: 0
Joined: 02 Jul 2016 Posts: 17
|
Posted: Tue Aug 22, 2017 1:21 pm Post subject: |
|
|
Please do not hurt me for digging in this old post.
I am trying this:
As long as a script is active, put 1 into the memory address behind a registered symbol. I get the address with another AA script. The symbol points to the right address, i can change it manually.
This is what I tried but it does not change the value:
Code: |
[ENABLE]
{$lua}
tHolz = createTimer(nil, false)
tHolz.OnTimer = function(fHolz)
print "tHolz ping"
-- writeInteger('[_stamms]+58','1')
getAddressList().getMemoryRecordByDescription('_stamms + 58').Value='1'
end
tHolz.Interval = 1000
tHolz.Enabled = true
{$asm}
// -----------------------------------------------------------------------------
[DISABLE]
{$lua}
tHolz.Destroy()
writeInteger('[_stamms]+58','0')
--getAddressList().getMemoryRecordByDescription('_stamms + 58').Value='0'
{$asm}
|
writeInteger and chaning the table entry do not work.
Where is my mistake?
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Tue Aug 22, 2017 2:15 pm Post subject: |
|
|
seems more like an address than a description/name...
If you're not getting an error message that can point you to the issue then try printing some more information out eg.
Code: | tHolz.OnTimer = function(fHolz)
print "tHolz ping"
print('writeInteger address in decimal', getAddress('[_stamms]+58'))
print('mem rec object address in decimal', getAddressList().getMemoryRecordByDescription('_stamms + 58'))
-- writeInteger('[_stamms]+58','1')
getAddressList().getMemoryRecordByDescription('_stamms + 58').Value='1'
end |
|
|
Back to top |
|
|
Zec Newbie cheater Reputation: 0
Joined: 02 Jul 2016 Posts: 17
|
Posted: Wed Aug 23, 2017 4:18 pm Post subject: |
|
|
The function is not being fired. I do not get the ping and the additional info.
'_stamms + 58' is the name of the table entry. I added it to see the value at the address.
Can something affect the lua engine?
I have a timer in the table script that waits until a AOB pattern becomes available (after the level is loaded). Then an AA script is fired and that timer is being destroyed. That AA script copies the base address of another value and works well.
|
|
Back to top |
|
|
|