-
Posted by sulf on Wed, 09 Nov 2011 08:25:07
Greetings everyone.
I'm working at creating SnD timer AddOn , I used SPELLCAST_STOP event for tracking SnD "cast". Every time I use any spell I got an UI error "string not found"
Should I use SPELLCASTSTART and SPELLCASTSTOP both?
Or there is any mistake in this code?
if (event == "SPELLCAST_STOP") then if (string.find ("Slice and Dice")) then Event() end ``
Sciript like this used in SHunterTimers ( http://dl.qj.net/pc-gaming/mmorpg/wo...rs-110-en.html ) . I just need working algorithm for hooking spell cast by SPELLCASTSTOP/SPELLCASTSTART .Hope somebody can help me.
Best regards. Sulf.
-
Posted by jnwhiteh on Wed, 09 Nov 2011 10:24:39
Greetings everyone.
I'm working at creating SnD timer AddOn , I used SPELLCAST_STOP event for tracking SnD "cast". Every time I use any spell I got an UI error "string not found"
Should I use SPELLCASTSTART and SPELLCASTSTOP both?
Or there is any mistake in this code?
if (event == "SPELLCAST_STOP") then if (string.find ("Slice and Dice")) then Event() end ``
Sciript like this used in SHunterTimers ( http://dl.qj.net/pc-gaming/mmorpg/wo...rs-110-en.html ) . I just need working algorithm for hooking spell cast by SPELLCASTSTOP/SPELLCASTSTART .Hope somebody can help me.
Yes, you call
string.find("Slice and Dice")
, but thestring.find
function takes two arguments, as indicated in the documentation. Also, please do NOT paraphrase errors that you get, it makes it impossible to debug the problem. The error message you get from lua is always correct, and having that precise error message makes an enormous difference in figuring out the problem. -
Posted by sulf on Wed, 09 Nov 2011 21:11:47
Yes, you call
string.find("Slice and Dice")
, but thestring.find
function takes two arguments, as indicated in the [documentation][1]. Also, please do NOT paraphrase errors that you get, it makes it impossible to debug the problem. The error message you get from lua is always correct, and having that precise error message makes an enormous difference in figuring out the problem.[1]: http://wowprogramming.com/docs/api/strfind
But how can I get second argument? I never worked with SPELLCAST_STOP. Already tried "msg", "text" etc...
-
Posted by jnwhiteh on Wed, 09 Nov 2011 21:14:34
First, it's the FIRST argument you need, not the second.
The message is sent with SPELLCAST_STOP. Figure out which one it is, and use it. You can't just pick arbitrary names.
The chapter of the book dealing with the combat log should make this easy to understand.
-
Posted by sulf on Thu, 10 Nov 2011 13:11:14
Maybe I'm blind, but I didn't found anything... :-(
So, I decided to move in other way:
``
if (event == "SPELLCAST_STOP") then if (arg2 == ("Slice and Dice")) then Event() end
But its still not working :-( Also tried to replace "slice and dice" by its ID:
``
if (event == "SPELLCAST_STOP") then if (arg2 == ("6774")) then Event() end
:-(
-
Posted by jnwhiteh on Thu, 10 Nov 2011 14:49:00
- There is no
SPELLCAST_STOP
event. Nor is there aSPELL_CAST_STOP
sub-event for the combat log system. - You are severely misunderstanding the way these events work.
- Chapter 21 has an example addon that shows the use of the combat log and threat systems, I suggest you work yourself through it.
Failing that, you'll need to tell me what you're trying to actually accomplish, because the code you are posting is full of events and variables that just don't exist.
- There is no
-
Posted by sulf on Thu, 10 Nov 2011 21:38:50
I just want to track cast of instant spells like Renew, Hunters mark, Slice and Dice and start some events (bars, warning, timers etc) Found this method in this hunter's timer addon LINK Its used SPELLCAST_STOP event .And tried to repeat thats method in my addon.
-
Posted by jnwhiteh on Thu, 10 Nov 2011 21:53:45
That event hasn't existed for quite some time. There is a
UNIT_SPELLCAST_STOP
event which gives them for other units as well as yours. Perhaps you can use that.If you haven't purchased the book, unfortunately I do not have time to help you. Please feel free to contact any of the other World of Warcraft UI forums or IRC channels for assistance.