[In need of LUA help] Non-Emu Lua script / simple addon -
08-10-2008
I'm making an addon and know nothing about LUA... I found guides about writing wow addons, and find that they are either outdated and most of the links are missing, or the posts are about Emu LUA scripting...
Code:
function
****Whenever I get a whisper****(pUnit, Event)
pUnit:SendChatMessage(14, 0, "/friend *******Name of the last person who whispered me**** ")
Here's some more things I found...
Quote:
AddFriend("playerName")
--- Still have no clue how to make it so that the name of the player that whispered me goes there...
Quote:
SetFriendNotes(index, noteText)
--- Would like to make it so there's a timestamp of the last whisper in the note
Ultimately I'd like it to not try to add a friend after the first whisper ( check if the name is already in the friends list... ) That could be in the 2nd version though... For now, all I want is the add friend on recieving whisper function.
The parts that are not in red are the parts I think I have right at the momment... Pretty much... I'm a quick learner... but I would really apreciate an updated guide / tutorial on WoW LUA Addon scripting, and maybe a few of the WoW related LUA functions.
Any links that will help me whatsoever will get ed. I don't expect to have this done for me, I actually don't want that... Its a project of my own I'd like to achieve =)
Found the WoW API function list... [Only registered and activated users can see links. ] , Will have to go through the list and see what I can do...
Quote:
"CHAT_MSG_WHISPER" Category: Communication
Fired when a whisper is received from another player.
The rest of the arguments appear to be nil
arg1
Message received
arg2
Author
arg3
Language (or nil if universal, like messages from GM) (always seems to be an empty string; argument may have been kicked because whispering in non-standard language doesn't seem to be possible [any more?])
arg6
status (like "DND" or "GM")
arg7
(number) message id (for reporting spam purposes?) (default: 0)
arg8
(number) unknown (default: 0)
I know this is what I'm looking for... I'm just not quite sure how to use the args =(
EDIT2:
Alright... here's something I meant to post on the WoW UI forums... but somehow I seem to be Hardware banned... o.O
Quote:
Alright... so I'm new to LUA... all I've been finding lately is outdated guides, or things far too complex from what I'm trying to do...
Basically, I want to include these feature in my addon; adding friends from incomming whispers and logging the whispers recieved (optional but would be a neat feature for v2 or something. )
Now... I know I should be using these;
AddFriend("playerName")
"CHAT_MSG_WHISPER" with arg 1 and 2 ( Message sent to you and the author of the message )
I'm just really not sure how to make it so it adds the person that whispered me to my friends list.
I'm thinking I should play with variables to make the players whispering me variables, and use this variable along with AddFriend("playerName") But I have no idea how to do that...
If anyone could point me to an updated guide on how to make simple addons like that, or just plain help me making my first LUA addon like this, I'd greatly apreciate it.
Collecting comments in my profile - Come and say hi!