DBM countdown via lua
I currently use this script I found to run a coundown timer, but I'm wondering if there's a way I can call DBM's countdown function with this script as well
Lua Code:
|
Assuming you can start a DBM countdown timer via slash command, just look in DBM's files for where it defines that slash command -- search for "SlashCmdList" -- and then just call the function with the appropriate arguments, eg.
Code:
SlashCmdList["DBM_TIMER"]("custom 60") |
Quote:
Lua Code:
The only part changed is where the function returns out if var ending is true. The way it is, it'll check the value of ending every time your frames are drawn which can be up to 100 times per second. I've changed it so that instead of it just returning out time and time again, it removes the function from the OnUpdate code altogether. When the function is called, it auto re-creates the function anyway. I tidied it up a bit while I was at it. |
Ah why thank you didn't think a frame was drawn that much.
|
Frames are drawn based on your framerate. There is a setting in the options to cap it at 60fps. I've gotten close to 200fps before, without the cap. During a raid boss fight, most people see around 30 or so.
|
Creating a new OnUpdate function every time you run the command is fairly wasteful. You should also use the elapsed value passed to your OnUpdate function, instead of calling GetTime() repeatedly.
Code:
local pull, seconds, onesec |
Well gosh, glad you guys took to helping me optimize it :)
Also looks like Code:
SlashCmdList["DEADLYBOSSMODS"]("pull ".. seconds) So the current script stands at Lua Code:
course running that will cause 50 million DBM timer bars |
All times are GMT -6. The time now is 08:04 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI