Syntax info needed
My code is getting bigger and bigger as time passes, so I'm interested onto how to shorten it.
Thing I'm interested into is can the array needed by timer be replaced with: set_task(0.5,"check_something",0,{id},1,"b") Also what is used to get auto id for a timer? For example that way I wouldn't think what's timers id are used, if its not-for-killing timer. Could this work? set_task(0.5,"check_something",-1,{id},1,"b") Thanks Nidza |
Re: Syntax info needed
example of how to get the id of the task and how to kill a task PHP Code:
|
Re: Syntax info needed
Dude all that I knew from before -.-
All that I asked was can I get first free id (I use multiple tasks), and can I send params directly without making an array... Anyone else? |
Re: Syntax info needed
Quote:
E.g: Code:
#define TASK1_ID 1000 |
Re: Syntax info needed
Thanks, and what about sending params faster? {id}
Nidza |
Re: Syntax info needed
afaik sending the params in the set_task (like L// showed) is the fastest way but you could also create global vars for storing the data.
|
Re: Syntax info needed
As for your question of "can you use {variable} to create an array?", it would have been a lot quicker for you to test it and find out.
If you're not going to call change_task(), remove_task() or task_exists() and you're only sending one integer inside an array, you can leave the array empty and use the task ID to pass that integer. It doesn't matter if task IDs collide. PHP Code:
|
Re: Syntax info needed
Well I've actually tested it, and it didn't work, so I wanted to ask did I had a well placed idea and something could be worked out, or it was truly wrong.
IDs can intercept without causing any problems? Thanks for the tip. Nidza |
| All times are GMT -4. The time now is 23:10. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.