Monday, April 16, 2012

chat response function

Hallo, I wonder if any of you can help me with solving a few of my errors, that i couldn't find / or understand.


Code:
tempF=CreateFrame("gmbFrame");
tempF:RegisterEvent("CHAT_MSG_CHANNEL_*partyleader*");
tempF:SetScript("OnEvent",
function()
if arg1=="!petattack" then
Assist sender;
PetAttack;
end
if arg1=="!follow" then
Follow sender;
end
if arg1=="!mount" then
Use Reins of the Swift Mistsaber;
end
if arg1=="!buff" then
local myClass = UnitClass("player");
if myClass=="Priest" then
Target sender;
Cast Power Word: Fortitude;
cleartarget;
end
end
end
);
|||Are we supposed to guess what the error is?|||yeah we need more information like an error message, what happens when the program is run that shouldn't, etc.|||How to make tempF:RegisterEvent("CHAT_MSG_CHANNEL_*partyleader*");

to hook on the channel named by the leader of the party..

And how do i put in the name of the msg sender e.g Assist sender;|||Quote:




How to make tempF:RegisterEvent("CHAT_MSG_CHANNEL_*partyleader *");

to hook on the channel named by the leader of the party..




surely you would be using the same channel as the leader so that doesn't matter


Quote:




And how do i put in the name of the msg sender e.g Assist sender;




don't quite understand what you mean by this|||Quote:









Quote:








And how do i put in the name of the msg sender e.g Assist sender;




don't quite understand what you mean by this




Ok it would be something like this.


Code:
[Playerleader] /8 !petattack
then it will execute by the script on party1
[party1] /script Assist sender -- replace sender by the name of the partyleader or who else there have sent the msg.

I hope it help this time.|||could you extract the name from chat, put it into a variable then execute the script with the variable in it.|||Quote:








could you extract the name from chat, put it into a variable then execute the script with the variable in it.




Well i have never been able to make a succesful script for variable :( so im lost on that one|||its not that hard. just declare the variable, assign it to the leader's name and put it in the display.

No comments:

Post a Comment