Is posible to make a macro to react automatically on chat?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
Uglich
Posts: 20
Joined: Fri Aug 06, 2010 7:00 pm
Location: Spain

Is posible to make a macro to react automatically on chat?

#1 Post by Uglich » Sat May 07, 2011 10:15 am

Hello.

I was wondering if it's posible to make a macro to say "me" when one of your guildies link a card in the guild chat.
(in my guild, if you get a card you don't want, usually you have to link it, and the first one who says "me" gets it.)

I'm not sure it its posible, and I have no idea how to make it.
Thank you, and sorry about my english.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Is posible to make a macro to react automatically on cha

#2 Post by Administrator » Sat May 07, 2011 3:23 pm

That should be done in an addon.

User avatar
Uglich
Posts: 20
Joined: Fri Aug 06, 2010 7:00 pm
Location: Spain

Re: Is posible to make a macro to react automatically on cha

#3 Post by Uglich » Sat May 07, 2011 9:48 pm

OK, but now I need to learn how to make an addon.
Do you know any guide or can you give me any hints to start making it?

Edited:

I was searching for addons who "search" the chat and find this one:
Chat Monitor http://rom.curse.com/downloads/rom-addo ... nitor.aspx

"ChatMonitor is an Addon that looks for userdefined keywords in the chat and plays an acoustic signal."

Is posble to modify this addon to say "Me" instead of playing a sound when it finds the keyword?

Thanks

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Is posible to make a macro to react automatically on cha

#4 Post by rock5 » Sat May 07, 2011 10:17 pm

The rom wiki has a tutorial that covers just about every thing you need.
http://www.theromwiki.com/Addon_Tutorial

Read all the way down to the 'events' section. You'll need that too, to monitor chat events.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Is posible to make a macro to react automatically on cha

#5 Post by lisa » Sun May 08, 2011 1:58 am

Your going to a lot of effort just to be the first to post me in guild, So your saying you want the card regardless of if you have it already?
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
Uglich
Posts: 20
Joined: Fri Aug 06, 2010 7:00 pm
Location: Spain

Re: Is posible to make a macro to react automatically on cha

#6 Post by Uglich » Tue May 10, 2011 11:21 am

lisa wrote:Your going to a lot of effort just to be the first to post me in guild, So your saying you want the card regardless of if you have it already?
Hello.
About your question, yes, I have some alters and they usually don't have the cards posted on guild.

Now, without any addon to it, I try to say me before check if I have the card or not. And I'm sure other guild members do the same.

I'm trying to change other addons to make it, but for the moment, it doesn't work.

Edit:

Hello again.
I make some progress modifiying the ChatMonitor addon.
Now, instead of playing a sound when find the keyword, the addon says what I want in the DEFAULT_CHAT_FRAME

Code: Select all

DEFAULT_CHAT_FRAME:AddMessage("Hello World!");
How can I "say" it in the Say channel, Zone channel, guild channel,...?

Thank you.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Is posible to make a macro to react automatically on cha

#7 Post by rock5 » Tue May 10, 2011 8:14 pm

  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
OneofMany
Posts: 119
Joined: Mon May 09, 2011 2:30 am

Re: Is posible to make a macro to react automatically on cha

#8 Post by OneofMany » Wed May 11, 2011 10:00 am

If you manage to finish this script. I'll be willing to translate it from english to dutch if you like.

Keep up the good work :)
Its not about cheating. Its about being smarter than the game...

User avatar
Questionmark
Posts: 31
Joined: Mon Apr 11, 2011 3:06 am

Re: Is posible to make a macro to react automatically on cha

#9 Post by Questionmark » Wed May 11, 2011 4:24 pm

OneofMany wrote:If you manage to finish this script. I'll be willing to translate it from english to dutch if you like.

Keep up the good work :)
Could you post the code please? I'm interested in autoresponse. I want to make a script that greets my guildies when they log on and I would like to use your script as reference.

User avatar
Uglich
Posts: 20
Joined: Fri Aug 06, 2010 7:00 pm
Location: Spain

Re: Is posible to make a macro to react automatically on cha

#10 Post by Uglich » Thu May 12, 2011 11:33 am

Hello, and thank you Rock5 for the API.

The script is based on the ChatMonitor Addon (99%) I just changed the lines where it "calls" to play a sound, and changed it to a fixed word in a fixed chat.
I couldn't talk to the addon creator, so if he/she is bother whith my changes, please contact me and I'll remove it.

Original Addon could be found here:
http://rom.curse.com/downloads/rom-addo ... nitor.aspx
It's Localized to English and Deutsch.

My changes are made in a small part of the lua code, the one who check's the chat. Lines 416 to 464, specifically in line 458.

Code: Select all

-----------Check Chat ------------------
function ChatMonitor.Chat(event,this)
	if(ChatMonitor.isChatMonitorInitialized) then
		local docheck = false;
		if(event == "CHAT_MSG_SAY" and ChatMonitor_Settings[ChatMonitor.playerName]["SayChatCheck"]) then
			docheck = true;    
		elseif(event == "CHAT_MSG_ZONE" and ChatMonitor_Settings[ChatMonitor.playerName]["ZoneChatCheck"]) then
			docheck = true; 
		elseif(event == "CHAT_MSG_GUILD" and ChatMonitor_Settings[ChatMonitor.playerName]["GuildChatCheck"]) then
			docheck = true;                                                             
		elseif(event == "CHAT_MSG_YELL" and ChatMonitor_Settings[ChatMonitor.playerName]["YellChatCheck"]) then
			docheck = true;
		end
		if (docheck) then
			local var = string.lower(arg1);
  
  			if(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWordCheck1"] and (ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord1"] ~= nil or ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord1"] ~= "")) then
  				if(string.find(var,string.lower(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord1"])) ~= nil) then
    				PlaySoundByPath("Interface/AddOns/ChatMonitor/Sound/"..ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord1Sound"]..".mp3");
    				ChatMonitor.WarningText(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord1"]);
  				end
  			end 
  			if(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWordCheck2"] and (ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord2"] ~= nil or ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord2"] ~= "")) then
  				if(string.find(var,string.lower(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord2"])) ~= nil) then
					PlaySoundByPath("Interface/AddOns/ChatMonitor/Sound/"..ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord1Sound"]..".mp3");	
    				ChatMonitor.WarningText(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord2"]); 
  				end
  			end   
  			if(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWordCheck3"] and (ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord3"] ~= nil or ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord3"] ~= "")) then
  				if(string.find(var,string.lower(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord3"])) ~= nil) then
    				SendChatMessage("Addon funcionando 3", "ZONE");
    				ChatMonitor.WarningText(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord3"]);
  				end
  			end
  			if(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWordCheck4"] and (ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord4"] ~= nil or ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord4"] ~= "")) then
  				if(string.find(var,string.lower(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord4"])) ~= nil) then
    				SendChatMessage("Addon funcionando 4", "SAY");
    				ChatMonitor.WarningText(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord4"]);
  				end
  			end
  			if(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWordCheck5"] and (ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord5"] ~= nil or ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord5"] ~= "")) then
  				if(string.find(var,string.lower(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord5"])) ~= nil) then
    				SendChatMessage("yo", "GUILD");
    				ChatMonitor.WarningText(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord5"]);
  				end
  			end
  		end
  	end
end
I just changed the code for the "keyword5" (at least by the moment).
For my purpose it's enough.

I would like to make some other changes, like insert more boxes to select what to say, and the chanel to say it. (boxes like the ones to select the keywords), but I don't know how to make it, and this seems to be very difficult to me.

I hope someone could find this intesesting.

Thank you.

User avatar
Uglich
Posts: 20
Joined: Fri Aug 06, 2010 7:00 pm
Location: Spain

Re: Is posible to make a macro to react automatically on cha

#11 Post by Uglich » Sat May 14, 2011 9:29 am

Doublepost because code has a big improvement.

Hello, I've changing a bit this code, and now it's a little bit usefull.
The changes were made in the Check Chat section (the rest still like the original one).

Now, you can "say" in the channel set in "keyword 3" the content writen in "keyword 4", when the "keyword5" is find in the chat who is being monitorized by the addon.

¿Quite confusing ? It's so simple. This picture sould help.
Image

The "play sound" part is disables for keyword3, 4 and 5.

Code: Select all

-----------Check Chat ------------------
function ChatMonitor.Chat(event,this)
	if(ChatMonitor.isChatMonitorInitialized) then
		local docheck = false;
		if(event == "CHAT_MSG_SAY" and ChatMonitor_Settings[ChatMonitor.playerName]["SayChatCheck"]) then
			docheck = true;    
		elseif(event == "CHAT_MSG_ZONE" and ChatMonitor_Settings[ChatMonitor.playerName]["ZoneChatCheck"]) then
			docheck = true; 
		elseif(event == "CHAT_MSG_GUILD" and ChatMonitor_Settings[ChatMonitor.playerName]["GuildChatCheck"]) then
			docheck = true;                                                             
		elseif(event == "CHAT_MSG_YELL" and ChatMonitor_Settings[ChatMonitor.playerName]["YellChatCheck"]) then
			docheck = true;
		end
		if (docheck) then
			local var = string.lower(arg1);
  
  			if(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWordCheck1"] and (ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord1"] ~= nil or ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord1"] ~= "")) then
  				if(string.find(var,string.lower(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord1"])) ~= nil) then
    				PlaySoundByPath("Interface/AddOns/ChatMonitor/Sound/"..ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord1Sound"]..".mp3");
    				ChatMonitor.WarningText(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord1"]);
  				end
  			end 
  			if(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWordCheck2"] and (ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord2"] ~= nil or ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord2"] ~= "")) then
  				if(string.find(var,string.lower(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord2"])) ~= nil) then
					PlaySoundByPath("Interface/AddOns/ChatMonitor/Sound/"..ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord2Sound"]..".mp3");	
    				ChatMonitor.WarningText(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord2"]); 
  				end
  			end   
  			if(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWordCheck3"] and (ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord3"] ~= nil or ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord3"] ~= "")) then
  				if(string.find(var,string.lower(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord3"])) ~= nil) then
    				PlaySoundByPath("Interface/AddOns/ChatMonitor/Sound/"..ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord3Sound"]..".mp3");
    				ChatMonitor.WarningText(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord3"]);
  				end
  			end
  			if(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWordCheck4"] and (ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord4"] ~= nil or ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord4"] ~= "")) then
  				if(string.find(var,string.lower(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord4"])) ~= nil) then
    				PlaySoundByPath("Interface/AddOns/ChatMonitor/Sound/"..ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord4Sound"]..".mp3");
    				ChatMonitor.WarningText(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord4"]);
  				end
  			end
  			if(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWordCheck5"] and (ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord5"] ~= nil or ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord5"] ~= "")) then
  				if(string.find(var,string.lower(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord5"])) ~= nil) then
    				SendChatMessage(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord4"], ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord3"]);
    				ChatMonitor.WarningText(ChatMonitor_Settings[ChatMonitor.playerName]["KeyWord5"]);
  				end
  			end
  		end
  	end
end
Now, I need to modify the GUI, but this part is too difficult for me, i don't know what's the first thing to do...
If someone want to do it, feel free to do.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Is posible to make a macro to react automatically on cha

#12 Post by lisa » Sun May 15, 2011 2:37 am

I can appreciate the amount of time and effort you've put in so far but if you don't mind a little critism I think you might be doing this the hard way.

If it was me I would look at either adding in another check (tick option) or just alter the one that says show keyword on screen which basically just flashes the keyword in the middle of your screen which is kinda useless in my opinion.

I would be looking at something like this myself.

in the language file in locales folder alter, this is english version

Code: Select all

	["SHOWTEXTCHECK"] = "Guild Greeting",
in chatmonitor.lua add this at the start of the ---check chat---- line 416

Code: Select all

if(ChatMonitor_Settings[ChatMonitor.playerName]["ShowTextCheck"]) then
        local var = string.lower(arg1);
if event == "CHAT_MSG_GUILD" then
if(string.find(var,string.lower("is online")) ~= nil) then
SendChatMessage("Hi there", "GUILD")
end
end
end
you can also delete the sections with
-----------show WarningText-----------
and
-----------fade WarningText-----------

which will basically make you sai "Hi there". anytime you see "is online" in guild chat. aslong as that tick for the now named Guild Greeting is ticked. Obviously this can be altered to be a more personal greeting by including the characters name but hopefully this gives you a start point for an easy solution to what you want.

I attached the altered file that I mentioned to give you an idea.

Edit-- I forgot what your original idea was and got stuck on the autoreply for entering guild, my bad. I attached new files with the 5th spot having user input for replying. It is set to only reply post in guild but you get the idea.

Totally up to you now to do the rest, I just got you started =)
Attachments
chatmonitor.zip
all files in the zip, I had issues trying to add the xml for some reason =(
(7.16 KiB) Downloaded 124 times
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest