Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*********************************************
- * is1 is the session with UI component, set it to
- * the session you load your UI counter window in
- *
- * could be changed to "all" if you display on all
- *************************************************/
- variable(global) timerController timers = "is1"
- objectdef timerController
- {
- variable collection:int timers
- variable string _uiSession
- variable int timeScale = 300
- variable time endAt
- method Initialize(string uiSession)
- {
- _uiSession:Set[${uiSession}]
- }
- method addTimer(string timerName, int duration)
- {
- endAt:Set[${Math.Calc[${Time.Timestamp}+${duration}]}]
- timers:Set[${timerName}, ${endAt.Timestamp}]
- relay ${_uiSession} UIElement[${timerName}]:SetValue[1]
- ;echo timer ${timerName} with duration ${duration} started at ${Time.Time24}, ends at ${endAt.Time24} for UI session ${_uiSession}
- }
- method removeTimer(string timerName)
- {
- timers:Erase[${timerName}]
- relay ${_uiSession} UIElement[${timerName}]:SetValue[0]
- }
- method updateTimers()
- {
- variable float progress = 0
- if "${timers.FirstKey(exists)}"
- {
- do
- {
- ; Display the current key
- endAt:Set[${timers.CurrentValue}]
- progress:Set[${Math.Calc[(${endAt.Timestamp}-${Time.Timestamp})/${timeScale}]}]
- if ${progress} < 0
- {
- this:removeTimer[${timers.CurrentKey}]
- }
- else
- {
- if ${progress} > 1
- {
- progress:Set[1]
- }
- relay ${_uiSession} UIElement[${timers.CurrentKey}]:SetValue[${progress}]
- ;echo ${Time.Time24} ${timers.CurrentKey} has progress ${progress} ends at ${endAt.Time24}
- }
- }
- while "${timers.NextKey(exists)}"
- }
- }
- }
- function main()
- {
- AddTrigger EQ1_OnLoggingEnabled "[@datetime@] Logging to 'eqlog.txt' is now *ON*."
- AddTrigger EQ1_StartIcecladTimer "[@trash@] You feel the preservation of the Iceclad surround you."
- AddTrigger EQ1_IcecladFade "[@trash@] The preservation of the Iceclad fades away."
- AddTrigger EQ1_StartCanniTimer "[@trash@] Your body aches as your mind clears.@IgnoreStuff@"
- AddTrigger EQ1_StartBardAuraTimer "[@trash@] You are surrounded by the @ignoreAuraType@ of Va'Ker."
- AddTrigger EQ1_StartShmHasteTimer "[@trash@] You begin casting Talisman of Celerity."
- AddTrigger EQ1_TellsYou "[@trash@] @ChannelFrom@ @MerchantCheck@tells you,@IgnoreLanguage@ '@ChannelWhat@'"
- /* some other examples from lax's POC code
- AddTrigger EQ1_YouSay "[@trash@] You say, '@ChannelWhat@'"
- AddTrigger EQ1_AFKOn "[@datetime@] You are now A.F.K. (Away From Keyboard)."
- AddTrigger EQ1_AFKOff "[@datetime@] You are no longer A.F.K. (Away From Keyboard)."
- AddTrigger EQ1_AuctionMsg "[@datetime@] @ChannelFrom@ auctions,@IgnoreLanguage@ '@ChannelWhat@'"
- AddTrigger EQ1_ChannelMsg "[@datetime@] @ChannelFrom@ tells @chat@:@num@, '@ChannelWhat@'"
- AddTrigger EQ1_GroupMsg "[@datetime@] @ChannelFrom@ tells the group,@IgnoreLanguage@ '@ChannelWhat@'"
- AddTrigger EQ1_GuildMsg "[@trash@] @ChannelFrom@ tells the guild,@IgnoreLanguage@ '@ChannelWhat@'"
- AddTrigger EQ1_OOCMsg "[@trash@] @ChannelFrom@ says out of character,@IgnoreLanguage@ '@ChannelWhat@'"
- AddTrigger EQ1_RaidMsg "[@trash@] @ChannelFrom@ tells the raid, @extraspace@'@ChannelWhat@'"
- AddTrigger EQ1_SayMsg "[@trash@] @ChannelFrom@ says,@IgnoreLanguage@ '@ChannelWhat@'"
- AddTrigger EQ1_ShoutMsg "[@trash@] @ChannelFrom@ shouts,@IgnoreLanguage@ '@ChannelWhat@'"
- AddTrigger EQ1_TellMsg2 "[@trash@] @MerchantCheck@.@ChannelFrom@ told you, '@ChannelWhat@'"
- */
- LogReader:RegisterLog["logs/eqlog_*.txt","EQ1_ChatLog"]
- LavishScript:RegisterEvent[EQ1_ChatLog]
- Event[EQ1_ChatLog]:AttachAtom[OnEQ1ChatLog]
- while 1
- {
- wait 5
- timers:updateTimers[]
- }
- }
- atom EQ1_StartIcecladTimer(string _Line, string _DateTime)
- {
- timers:addTimer["timer1@timers@eqtimers", 150]
- }
- atom EQ1_StartCanniTimer(string _Line, string _DateTime)
- {
- timers:addTimer["timer2@timers@eqtimers", 140]
- }
- atom EQ1_StartBardAuraTimer(string _Line, string _DateTime)
- {
- timers:addTimer["timer3@timers@eqtimers", 1800]
- }
- atom EQ1_StartShmHasteTimer(string _Line, string _DateTime)
- {
- timers:addTimer["timer4@timers@eqtimers", 3600]
- }
- atom EQ1_IcecladFade(string _Line, string _DateTime)
- {
- if ${InnerSpace.Build}>=5607
- {
- uplink speak "recast iceclad"
- }
- }
- atom EQ1_TellsYou(string _Line, string _DateTime, string _ChannelFrom, string _merchantCheck, string _IgnoreLanguage, string text)
- {
- if ${InnerSpace.Build}>=5607
- {
- uplink speak "tell from ${_ChannelFrom.Escape}. ${text.Escape}"
- }
- }
- atom EQ1_YouSay(string _Line, string _DateTime, string text)
- {
- echo EQ1_YouSay[\"${_Line.Escape}\",\"${_DateTime.Escape}\",\"${text.Escape}\"]
- if ${InnerSpace.Build}>=5607
- {
- uplink speak "You say, ${text.Escape}"
- }
- }
- atom EQ1_OnLoggingEnabled(string _Line, string _DateTime)
- {
- echo EQ1_OnLoggingEnabled[\"${_Line.Escape}\",\"${_DateTime.Escape}\"]"
- }
- atom EQ1_AFKOn(string _Line, string _DateTime)
- {
- echo EQ1_AFKOn()
- }
- atom EQ1_AFKOff(string _Line, string _DateTime)
- {
- echo EQ1_AFKOff()
- }
- atom EQ1_SayMsg(string _Line, string _DateTime, string _ChannelFrom, string _IgnoreLanguage, string text)
- {
- echo EQ1_SayMsg
- if ${InnerSpace.Build}>=5607
- {
- uplink speak "${_ChannelFrom.Escape} says, ${text.Escape}"
- }
- }
- atom OnEQ1ChatLog(string filename, string action, string text)
- {
- ;echo "OnEQ1ChatLog[\"${filename.Escape}\",\"${action.Escape}\",\"${text.Escape}\"]"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement