Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timers from C++ to Lua #69

Closed
Markalike opened this issue Mar 29, 2013 · 3 comments
Closed

Timers from C++ to Lua #69

Markalike opened this issue Mar 29, 2013 · 3 comments

Comments

@Markalike
Copy link

I am not so good with Lua but I am familiar with C++ and Python and what I had in the past for timers with Python was something like, OnTick() -> call to Python, this ran like every .01 seconds which allow me to make timers in Python without the use of addition threads cause you dont need to use a Sleep() function. I tried to look for something like this via google... but I could not locate any thread safe timers. This would be most useful for rerunning things outside of events on a timing basis. I think this would definetly help for running addons that dont solely rely on events to do things, AKA Tparty in Lua, for every tick or however often you want, check each players TP and then update.

Thankyou for taking the time to read this and all the effort you are putting into it!

@Markalike
Copy link
Author

Just to follow up, an easy but effective fix could be to make a new event like.. event_tick(int tick_count) and just have it fire every .1 seconds or something like that. It would be a simple but effective fix and would be very useful!

@z16
Copy link
Member

z16 commented Apr 19, 2013

While it's not a fix, this can currently be simulated by using the send_command function as follows:

-- Addon test
function bla()
    -- Do stuff
    send_command('wait 0.1; lua i test bla')
end

@z16
Copy link
Member

z16 commented Aug 11, 2013

Added the prerender event for that:

windower.register_event('prerender', function()
    print('Spamming the console!')
end)

@z16 z16 closed this as completed Aug 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants