View Full Version : chat response function
Googus
09-08-2008, 03:38 PM
Hallo, I wonder if any of you can help me with solving a few of my errors, that i couldn't find / or understand.
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
);
Tunga
09-08-2008, 06:46 PM
Are we supposed to guess what the error is?
mmorpg man
09-08-2008, 07:05 PM
yeah we need more information like an error message, what happens when the program is run that shouldn't, etc.
Googus
09-08-2008, 08:35 PM
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;
mmorpg man
10-08-2008, 01:09 AM
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
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
Googus
10-08-2008, 09:15 AM
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.
[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.
mmorpg man
10-08-2008, 12:43 PM
could you extract the name from chat, put it into a variable then execute the script with the variable in it.
Googus
11-08-2008, 06:34 PM
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
mmorpg man
11-08-2008, 11:03 PM
its not that hard. just declare the variable, assign it to the leader's name and put it in the display.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.