Scheduled Events in Addons menu

Shout-Out

User Tag List

Results 1 to 9 of 9
  1. #1
    kixer's Avatar Master Sergeant
    Reputation
    34
    Join Date
    May 2010
    Posts
    78
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Scheduled Events in Addons

    Is it possible to create a scheduled event in an addon? Just to be clear I mean a programmable event, a call to lua script at given time, not the event in the game calendar.

    I've googled for a while and found out that ACE lib should be able to do this. I've looked into it and did not find it. What I need is to create a delay between two actions (like wait 5 sec...)

    I am familiar with the onUpdate event, but I quite don't get how this works. I think it passes the number of actuall "onUpdates" of the frame whenever it is called. But I was unable to figure out how would I get the time from it yet. Maybe if I've accessed the system time/realm time? Is this possible in addon?

    ---------- Post added at 02:01 AM ---------- Previous post was at 01:10 AM ----------

    As it usually happens, I found the answer shortly after I've asked. Looks like I got the onUpdate functionality correctly. For more information, you can check the following article on WoWWiki.

    Scheduled Events in Addons
  2. #2
    nightcracker's Avatar Contributor
    Reputation
    102
    Join Date
    Jan 2008
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Extremely simple.

    Code:
    local wait, frame = 5, CreateFrame("Frame")
    frame:SetScript("OnUpdate", function(frame, elapsed)
        wait = wait - elapsed
        if wait <= 0 then
            self:Hide()
            
            -- DO STUFF HERE
        end
    end)
    Three things are certain,
    Death, taxes and site not found,
    You, victim of one.

  3. #3
    Ultraviolence's Avatar Active Member
    Reputation
    15
    Join Date
    Aug 2008
    Posts
    102
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could something like this be used to delay a spell cast? For example: cast spell1 - wait 2 sec - cast spell2 etc. Tried using the scripts above but they just create frame lag.

  4. #4
    nightcracker's Avatar Contributor
    Reputation
    102
    Join Date
    Jan 2008
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Ultraviolence View Post
    Could something like this be used to delay a spell cast? For example: cast spell1 - wait 2 sec - cast spell2 etc. Tried using the scripts above but they just create frame lag.
    Not without full Lua hacks.

    If with Lua hacks, yes.
    Three things are certain,
    Death, taxes and site not found,
    You, victim of one.

  5. #5
    Ultraviolence's Avatar Active Member
    Reputation
    15
    Join Date
    Aug 2008
    Posts
    102
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well no problems there, can you share some info?

  6. #6
    nightcracker's Avatar Contributor
    Reputation
    102
    Join Date
    Jan 2008
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Simple not that efficient example:
    Code:
    function castspellwdelay(spellname, delay)
    	CreateFrame("Frame"):SetScript("OnUpdate", function(frame, elapsed)
    		delay = delay - elapsed
    		if delay <= 0 then
    		    self:Hide()
    		    CastSpellByName(spellname)
    		end
    	end)
    end
    Put that in some lua and then call in your macros castspellwdelay(spellname, delay) with delay in seconds (not rounded, so 1.34 will work).
    Three things are certain,
    Death, taxes and site not found,
    You, victim of one.

  7. #7
    Ultraviolence's Avatar Active Member
    Reputation
    15
    Join Date
    Aug 2008
    Posts
    102
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    With some slight modifications it works great. Thanks a lot. +Rep
    Last edited by Ultraviolence; 12-07-2010 at 07:45 PM.

  8. #8
    Ultraviolence's Avatar Active Member
    Reputation
    15
    Join Date
    Aug 2008
    Posts
    102
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oops double post
    Last edited by Ultraviolence; 12-07-2010 at 07:44 PM.

  9. #9
    Haroon525's Avatar Banned
    Reputation
    1
    Join Date
    Jun 2014
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    According to schedule , All events in addons will must be held at the time and there will no change made in this.
    Schedule | PTV Sports

Similar Threads

  1. Event Horizon (raid addon for shadow priests)
    By latruwski in forum WoW Instances & Raiding
    Replies: 12
    Last Post: 04-25-2010, 02:05 AM
  2. Sumoning Addon (events)
    By NerKMinD in forum WoW UI, Macros and Talent Specs
    Replies: 0
    Last Post: 01-20-2009, 05:06 PM
  3. [Release] Ascent PvP Event Addon
    By sve3nn in forum WoW EMU General Releases
    Replies: 1
    Last Post: 11-10-2008, 02:37 AM
  4. wow_kings list of best addons
    By Elites360 in forum World of Warcraft Bots and Programs
    Replies: 20
    Last Post: 11-20-2006, 01:33 PM
  5. Your favorite addons!
    By bloodofwar in forum World of Warcraft General
    Replies: 7
    Last Post: 11-06-2006, 11:26 AM
All times are GMT -5. The time now is 06:42 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search