Quoted from "ReagenL;544140"
Oh I thought that was the debug message.
The one that says in chat CASTING_START
and had ------ under it that showed up every time you cast anything with a casting bar?
Quoted from "ReagenL;544140"
When I had it before.
All it said in chat was..
"CASTING_START
Global Cooldown is 0
------------------"
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
function FFTCasting.CASTING_START(spellName, ...)
if FFTCurGlobalTime <= 0 then
DEFAULT_CHAT_FRAME:AddMessage("spellName is "..(spellName or "nil"))
if WhatToSay[(spellName or '')] then
if WhatToSay[spellName].curtime <= 0 then
FFTCasting.Say(WhatToSay[spellName].text .. " " .. spellName .. "!")
FFTCurGlobalTime = FFTGlobalCooldown
WhatToSay[spellName].curtime = WhatToSay[spellName].cooldown
end
end
end
end
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
-- Copyright (c) 2009, Lewis Linn White Jr.
-- All rights reserved.
-- Edited and updated by ReagenLionel and Peryl [2012]
-- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-- * Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-- BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-- IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
-- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-- OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-- OF SUCH DAMAGE.
local FFTGlobalCooldown = 5 -- 5 second global cooldown
local FFTCurGlobalTime = 0
local FFTCasting = {}
FFTCasting.VERSION = "0.5"
_G.FFTCasting = FFTCasting
-- Create the frame
local frame = CreateUIComponent("Frame", "FFTCasting_Frame", "UIParent")
_G['FFTCasting_Frame'] = nil -- remove the global created by CreateUIComponent
-- Set the frame's OnEvent callback
frame:SetScripts("OnEvent", [=[ FFTCasting[event](arg1) ]=])
frame:RegisterEvent("CASTING_START") -- this line was moved to here for code consistency
frame:SetScripts("OnUpdate", [=[ FFTCasting.OnUpdateHandler(elapsedTime) ]=] )
local castingOn = true
SLASH_FFTCasting1 = "/fftcasting"
SlashCmdList['FFTCasting'] = function(editBox, msg)
local option = string.lower(msg)
if option == "off" then
castingOn = false
DEFAULT_CHAT_FRAME:AddMessage("FFTCasting has been turned off.")
elseif option == "on" then
castingOn = true
DEFAULT_CHAT_FRAME:AddMessage("FFTCasting has been turned on.")
DEFAULT_CHAT_FRAME:AddMessage("FFTCasting is now loaded and ready, type '/fftcasting off' to deactivate")
elseif option == "cd" then
DEFAULT_CHAT_FRAME:AddMessage("Testing.."(FFTGlobalCooldown))
elseif option == "help" then
DEFAULT_CHAT_FRAME:AddMessage("FFTCasting is now loaded and ready, type '/fftcasting off' to deactivate and '/fftcasting on' to reactivate")
DEFAULT_CHAT_FRAME:AddMessage(" To edit or add more spells, go to the lUA file in the FFTCasting folder and add in the name of the spell and the speech in the same manner the others are.")
DEFAULT_CHAT_FRAME:AddMessage("Spellnames are shown in the chat box when you cast them.")
DEFAULT_CHAT_FRAME:AddMessage("There is a global cooldown of 5 seconds, all spells have a seperate cooldown of 10 by default. TO change go into the LUA and change the cooldown for desired spell. Global Cooldown can be changed in 'local FFTGlobalCooldown'. ")
else
DEFAULT_CHAT_FRAME:AddMessage("Not a valid argument: type '/fftcasting on' to activate or '/fftcasting off' deactivate. '/fftcasting help'for more info.")
end
end
DEFAULT_CHAT_FRAME:AddMessage("FFTCasting is now loaded and ready, type '/fftcasting off' to deactivate and '/fftcasting on' to reactivate")
function FFTCasting.Say(messageToSay)
SendChatMessage(messageToSay, "SAY")
end
local WhatToSay = {
['Flame'] = { text = "Star fire, awake and deliver your judgement!", cooldown = 10, curtime = 0 },
['Plasma Arrow'] = { text = "Clear with a mighty breeze!", cooldown = 10, curtime = 0 },
['Electric Bolt'] = { text = "Heavenly bolts, bring God's justice!" , cooldown = 10, curtime = 0 },
['Meteor Shower'] = { text = "Time has come...crash down on the wicked!" , cooldown = 10, curtime = 0 },
['Electric Explosion'] = { text = "Angry spirits of the world strike now!" , cooldown = 10, curtime = 0 },
['Static Field'] = { text = "Absorb power in the sky and strike!" , cooldown = 10, curtime = 0 },
['Rising Tide'] = { text = "Effortless water, break your silence, attack!" , cooldown = 10, curtime = 0 },
['Urgent Heal'] = { text = "Life's refreshing breeze, heal from the sky!" , cooldown = 10, curtime = 0 },
['Heal'] = { text = "Ancient light, rise and revive!" , cooldown = 10, curtime = 0 },
['Resurrection'] = { text = "Spirits of life, give a new life to the soul!" , cooldown = 10, curtime = 0 },
['Group Heal'] = { text = "Heavenly wind, carry us to fountain of power!" , cooldown = 10, curtime = 0 },
['Ice Fog'] = { text = "Freezing wind, speak of forgotten truths!" , cooldown = 10, curtime = 0 },
['Chain of Light'] = { text = "Bright light, shine down on bloody impurity!" , cooldown = 10, curtime = 0 },
['Thunderstorm'] = { text = "Winds of destruction, take hold and deliver your wrath!" , cooldown = 10, curtime = 0 },
['Earth Surge'] = { text = "Earth, groan and awaken your might. Show my foe your Power and strength!" , cooldown = 10, curtime = 0 },
['Phoenix'] = { text = "Flames, Burst!" , cooldown = 10, curtime = 0 },
['Psychic Arrows'] = { text = "Dark, sinister ambitions, take form and strike!" , cooldown = 10, curtime = 0 },
['Soul Pain'] = { text = "Depths of the soul, go into agony and despair." , cooldown = 10, curtime = 0 },
}
function FFTCasting.CASTING_START(spellName, ...)
if FFTCurGlobalTime <= 0 then
DEFAULT_CHAT_FRAME:AddMessage("spellName is "..(spellName or "nil"))
if WhatToSay[(spellName or '')] then
if WhatToSay[spellName].curtime <= 0 then
FFTCasting.Say(WhatToSay[spellName].text .. " " .. spellName .. "!")
FFTCurGlobalTime = FFTGlobalCooldown
WhatToSay[spellName].curtime = WhatToSay[spellName].cooldown
end
end
end
end
function FFTCasting.OnUpdateHandler(elapsed)
local adjustedTime = FFTCurGlobalTime - elapsed
-- Set the new global timer value, capping it to 0 if negative
FFTCurGlobalTime = adjustedTime < 0 and 0 or adjustedTime
for k,v in pairs(WhatToSay) do
if v.curtime > 0 then
adjustedTime = v.curtime - elapsed
v.curtime = adjustedTime < 0 and 0 or adjustedTime
end
end
end
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
-- Copyright (c) 2009, Lewis Linn White Jr.
-- All rights reserved.
-- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-- * Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-- BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-- IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
-- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-- OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-- OF SUCH DAMAGE.
local FFTGlobalCooldown = 5 -- 5 second global cooldown
local FFTCurGlobalTime = 0
local FFTCasting = {}
FFTCasting.VERSION = "0.5"
_G.FFTCasting = FFTCasting
-- Create the frame
local frame = CreateUIComponent("Frame", "FFTCasting_Frame", "UIParent")
_G['FFTCasting_Frame'] = nil -- remove the global created by CreateUIComponent
-- Set the frame's OnEvent callback
frame:SetScripts("OnEvent", [=[ FFTCasting[event](arg1) ]=])
frame:RegisterEvent("CASTING_START") -- this line was moved to here for code consistency
frame:SetScripts("OnUpdate", [=[ FFTCasting.OnUpdateHandler(elapsedTime) ]=] )
local castingOn = true
SLASH_FFTCasting1 = "/fftcasting"
SlashCmdList['FFTCasting'] = function(editBox, msg)
local option = string.lower(msg)
if option == "off" then
castingOn = false
DEFAULT_CHAT_FRAME:AddMessage("FFTCasting has been turned off.")
elseif option == "on" then
castingOn = true
DEFAULT_CHAT_FRAME:AddMessage("FFTCasting has been turned on.")
DEFAULT_CHAT_FRAME:AddMessage("FFTCasting is now loaded and ready, type '/fftcasting off' to deactivate")
elseif option == "cd" then
DEFAULT_CHAT_FRAME:AddMessage("Testing..")
elseif option == "help" then
DEFAULT_CHAT_FRAME:AddMessage("FFTCasting is now loaded and ready, type '/fftcasting off' to deactivate and '/fftcasting on' to reactivate")
DEFAULT_CHAT_FRAME:AddMessage(" To edit or add more spells, go to the lUA file in the FFTCasting folder and add in the name of the spell and the speech in the same manner the others are.")
DEFAULT_CHAT_FRAME:AddMessage("Spellnames are shown in the chat box when you cast them.")
DEFAULT_CHAT_FRAME:AddMessage("There is a global cooldown of 5 seconds, all spells have a seperate cooldown of 10 by default.")
DEFAULT_CHAT_FRAME:AddMessage("To change go into the LUA and change the cooldown for desired spell.")
DEFAULT_CHAT_FRAME:AddMessage("Global Cooldown can be changed in 'local FFTGlobalCooldown' section near the beginning.")
else
DEFAULT_CHAT_FRAME:AddMessage("Not a valid argument: type '/fftcasting on' to activate or '/fftcasting off' deactivate. '/fftcasting help'for more info.")
end
end
DEFAULT_CHAT_FRAME:AddMessage("FFTCasting is now loaded and ready, type '/fftcasting off' to deactivate and '/fftcasting on' to reactivate")
function FFTCasting.Say(messageToSay)
SendChatMessage(messageToSay, "SAY")
end
local WhatToSay = {
['Flame'] = { text = "Star fire, awake and deliver your judgement!", cooldown = 10, curtime = 0 },
['Plasma Arrow'] = { text = "Clear with a mighty breeze!", cooldown = 10, curtime = 0 },
['Electric Bolt'] = { text = "Heavenly bolts, bring God's justice!" , cooldown = 10, curtime = 0 },
['Meteor Shower'] = { text = "Time has come...crash down on the wicked!" , cooldown = 10, curtime = 0 },
['Electric Explosion'] = { text = "Angry spirits of the world strike now!" , cooldown = 10, curtime = 0 },
['Static Field'] = { text = "Absorb power in the sky and strike!" , cooldown = 10, curtime = 0 },
['Rising Tide'] = { text = "Effortless water, break your silence, attack!" , cooldown = 10, curtime = 0 },
['Urgent Heal'] = { text = "Life's refreshing breeze, heal from the sky!" , cooldown = 10, curtime = 0 },
['Heal'] = { text = "Ancient light, rise and revive!" , cooldown = 10, curtime = 0 },
['Resurrection'] = { text = "Spirits of life, give a new life to the soul!" , cooldown = 10, curtime = 0 },
['Group Heal'] = { text = "Heavenly wind, carry us to fountain of power!" , cooldown = 10, curtime = 0 },
['Ice Fog'] = { text = "Freezing wind, speak of forgotten truths!" , cooldown = 10, curtime = 0 },
['Chain of Light'] = { text = "Bright light, shine down on bloody impurity!" , cooldown = 10, curtime = 0 },
['Thunderstorm'] = { text = "Winds of destruction, take hold and deliver your wrath!" , cooldown = 10, curtime = 0 },
['Earth Surge'] = { text = "Earth, groan and awaken your might. Show my foe your Power and strength!" , cooldown = 10, curtime = 0 },
['Phoenix'] = { text = "Flames, Burst!" , cooldown = 10, curtime = 0 },
['Psychic Arrows'] = { text = "Dark, sinister ambitions, take form and strike!" , cooldown = 10, curtime = 0 },
['Soul Pain'] = { text = "Depths of the soul, go into agony and despair." , cooldown = 10, curtime = 0 },
['Psychic Whirlwind'] = { text = "Black" , cooldown = 10, curtime - 0 },
['Saces' Scorn'] = { text = "Darkness, cast fear into thier heart" , cooldown = 10, curtime = 0 },
}
function FFTCasting.CASTING_START(spellName, ...)
if FFTCurGlobalTime <= 0 then
DEFAULT_CHAT_FRAME:AddMessage("spellName is "..(spellName or "nil"))
if WhatToSay[(spellName or '')] then
if WhatToSay[spellName].curtime <= 0 then
FFTCasting.Say(WhatToSay[spellName].text .. " " .. spellName .. "!")
FFTCurGlobalTime = FFTGlobalCooldown
WhatToSay[spellName].curtime = WhatToSay[spellName].cooldown
end
end
end
end
function FFTCasting.OnUpdateHandler(elapsed)
local adjustedTime = FFTCurGlobalTime - elapsed
-- Set the new global timer value, capping it to 0 if negative
FFTCurGlobalTime = adjustedTime < 0 and 0 or adjustedTime
for k,v in pairs(WhatToSay) do
if v.curtime > 0 then
adjustedTime = v.curtime - elapsed
v.curtime = adjustedTime < 0 and 0 or adjustedTime
end
end
end
|
|
|
Source code |
1 |
['Psychic Whirlwind'] = { text = "Black" , cooldown = 10, curtime - 0 },
|
|
|
Source code |
1 |
call ChatFram1's OnEvent, line: [string'?']:116: attempt to perform arithmetic on field 'offset' (a nil value) |