Help with set_task and looping
1 Attachment(s)
This little plugin I made works fine, but I have found a bug that I need help with.
Saying !regen_1 starts the regeneration, and then saying !regen_0 stops it, no problems there. But if I were to say !regen_1 again, I would start regenerating at twice the speed. If I say it again, it would regen at 3 times the speed etc etc. I think it has something to do with the set_task being called more than once without the first one stopping. Can someone help me out with this please? |
Code:
|
After trying out that code, it still doesnt work. If !regen_1 is said more than once, it will regen faster than it should be. Its like remove_task doesnt like me. :( :?
|
lol will sounds like snarkserv.
|
Yeah, I know. Although I am trying not to directly copy it, I am getting the idea of rewards from it. Ive found that it has helped me greatly in making plugins.
Besides, theres nothing wrong having a regen plugin is there? |
well the SnarkServ plugin does !regen by checking to see if the task is already running.
|
You have no idea how stupid I feel right now. All the additions and changes I made to the plugin I saved as regen.sma, but I previously had it under a different name, so whenever I made any changes, I was really running a different plugin which was exactly the same everytime.
And yes, the code v3x provided works. Man, I feel so stupid :oops: :| :oops: |
Ah, good.
|
| All times are GMT -4. The time now is 15:52. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.