Duck
03-13-2005, 11:51 AM
Ok, I have some programming experience, and a little scripting experience, but nearly all of this stuff is new to me.
I'm trying to create a script that will recieve a message from a player and then cast the spell that player asks for onto the player. Basically a simpler verison of WhisperCast, but without all the extra GUI's and stuff.
As I said I'm pretty much a total newb to this so I have no idea what I'm doing, I'm more or less trying to copy/paste code from other addons and then modify it to work for me.
Anyway here's what I have so far:
(tellspell.toc)
## Interface: 4216
## Title: Tellspell
## Notes: Cast spells on people!
tellspell.xml
(tellspell.xml)
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
<Script file="tellspell.lua"/>
<Frame name="tellspell">
<Scripts>
<OnLoad>
tellspell_OnLoad();
</OnLoad>
<OnEvent>
tellspell_OnEvent(event);
</OnEvent>
</Scripts>
</Frame>
</ui>
(tellspell.lua)
function tellspell_OnLoad()
end
function tellspell_OnEvent(event)
local info = ChatTypeInfo["SYSTEM"];
if (event == "CHAT_MSG_WHISPER") then
ChatFrame1:AddMessage("New Message Successfully Parsed!", info.r, info.g, info.b, info.id);
end
end
What this is supposed to do is pop up a message whenever I recieve a tell, just so I know that my code is realizing I actually recieved a tell. However, it is doing nothing. I don't get any errors, it says that it is loading in the log file, but nothing happens.
And while you're reading this 2 other questions:
1) Once someone sends me a message how do I pull out the persons name and what they sent me? (From whispercast it looks like these are arg1 and arg2, with playername=arg2 and message=arg1, am I correct there?)
2) How would I go about casting a spell in the LUA file? (guessing it's the same as the script command CastSpellByName("spellname"); but do I have to put <script></script> around it or anything like that?)
Thanks a ton in advance for any help :)
I'm trying to create a script that will recieve a message from a player and then cast the spell that player asks for onto the player. Basically a simpler verison of WhisperCast, but without all the extra GUI's and stuff.
As I said I'm pretty much a total newb to this so I have no idea what I'm doing, I'm more or less trying to copy/paste code from other addons and then modify it to work for me.
Anyway here's what I have so far:
(tellspell.toc)
## Interface: 4216
## Title: Tellspell
## Notes: Cast spells on people!
tellspell.xml
(tellspell.xml)
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
<Script file="tellspell.lua"/>
<Frame name="tellspell">
<Scripts>
<OnLoad>
tellspell_OnLoad();
</OnLoad>
<OnEvent>
tellspell_OnEvent(event);
</OnEvent>
</Scripts>
</Frame>
</ui>
(tellspell.lua)
function tellspell_OnLoad()
end
function tellspell_OnEvent(event)
local info = ChatTypeInfo["SYSTEM"];
if (event == "CHAT_MSG_WHISPER") then
ChatFrame1:AddMessage("New Message Successfully Parsed!", info.r, info.g, info.b, info.id);
end
end
What this is supposed to do is pop up a message whenever I recieve a tell, just so I know that my code is realizing I actually recieved a tell. However, it is doing nothing. I don't get any errors, it says that it is loading in the log file, but nothing happens.
And while you're reading this 2 other questions:
1) Once someone sends me a message how do I pull out the persons name and what they sent me? (From whispercast it looks like these are arg1 and arg2, with playername=arg2 and message=arg1, am I correct there?)
2) How would I go about casting a spell in the LUA file? (guessing it's the same as the script command CastSpellByName("spellname"); but do I have to put <script></script> around it or anything like that?)
Thanks a ton in advance for any help :)