Ignore some whispers during monitoring

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
gloover
Posts: 304
Joined: Wed Jul 07, 2010 4:31 am

Ignore some whispers during monitoring

#1 Post by gloover » Sat Oct 05, 2013 5:20 pm

Hey rock, lisa.

I'm using the monitoring function im my onload to be informed, when I will be whispered. So its working fine, except of the ignoring some whisperers.

Code: Select all

		function beepwhispers()
		repeat
			local time, moreToCome, name, msg = EventMonitorCheck("WhisperNotify", "4,1")
			if moreToCome ~= nil and (name ~= "Hilfsbegleiter" or name ~= "B\129ndniskrieger") then
				cprintf(cli.lightred, "Someone whispered!\n");
				printf("\a\a\a");
			end
		until moreToCome ~= true
		end


	EventMonitorStart("WhisperNotify", "CHAT_MSG_WHISPER");
	registerTimer("beepwhispers", secondsToTimer(5), beepwhispers);		

so it should ignore the newbie-pet (Hilfsbegleiter) and this stupid NPC in Sarlo, which whispers all the time (in german in contains umlauts "Bündniskrieger")
I've tried the solution above, but it seems not to work. Have also tried the lua umlauts-code "B\195\188ndniskrieger", also without any effect - the NPC will not be ignored.

Any suggestion yourside?

thx in advance.

User avatar
Bill D Cat
Posts: 555
Joined: Sat Aug 10, 2013 8:13 pm
Location: Deep in the Heart of Texas

Re: Ignore some whispers during monitoring

#2 Post by Bill D Cat » Sat Oct 05, 2013 6:56 pm

I think the issue you have is checking the names with "not equal" and "or". It will always resolve to true because the name will never be both options you are checking. Try using "and" to check the names.

User avatar
gloover
Posts: 304
Joined: Wed Jul 07, 2010 4:31 am

Re: Ignore some whispers during monitoring

#3 Post by gloover » Mon Oct 07, 2013 10:09 am

No! seems also not to work.

I've tried to use only one name

Code: Select all

			if moreToCome ~= nil and name ~= "B\129ndniskrieger" then
but it also will be monitoring instead of being ignored. Maybe it depends on the umlaut "ü" - I dont know.

Rock, lisa, any idea?

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

Re: Ignore some whispers during monitoring

#4 Post by rock5 » Mon Oct 07, 2013 11:55 am

So it beeps even when that player whispers you? Maybe you should have it print the name so you can check what is returned.

Code: Select all

cprintf(cli.lightred, name .. " whispered!\n")
Otherwise I don't really have experience with dealing with special characters.
  • 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

cokebot
Posts: 54
Joined: Wed Oct 19, 2011 7:47 am

Re: Ignore some whispers during monitoring

#5 Post by cokebot » Tue Oct 08, 2013 4:43 am

Same problem here.
Image

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

Re: Ignore some whispers during monitoring

#6 Post by rock5 » Tue Oct 08, 2013 5:40 am

Micromacro is capable if printing "Bündniskrieger" correctly so that strange character must be what it really gets from the game. I looked around and found that the bot uses a function to fix these umlaut characters from the game. So try this.

Code: Select all

         local time, moreToCome, name, msg = EventMonitorCheck("WhisperNotify", "4,1")
         name = utf8ToAscii_umlauts(name)
         if moreToCome ~= nil and (name ~= "Hilfsbegleiter" or name ~= "B\129ndniskrieger") then
  • 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
gloover
Posts: 304
Joined: Wed Jul 07, 2010 4:31 am

Re: Ignore some whispers during monitoring

#7 Post by gloover » Tue Oct 08, 2013 9:42 am

Thank you rock - its coming closer to the solution, but using your suggestion got this: ".../scripts/rom/functions.lua:914: bad argument #1 to 'gsub' (string expected, got nil)"

edit:

have changed the function into

Code: Select all

		repeat
			local time, moreToCome, name, msg = EventMonitorCheck("WhisperNotify", "4,1")
			if moreToCome ~= nil then
				name = utf8ToAscii_umlauts(name)
				if (name ~= "Hilfsbegleiter" or name ~= "B\129ndniskrieger") then
					cprintf(cli.lightred, name .. " whispered!\n")
					printf("\a\a\a");
				end	
			end
		until moreToCome ~= true
Now it prints "Bündniskrieger whispered!" so the name will be printed correctly, but the hell, it will not be ignored! :-(

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

Re: Ignore some whispers during monitoring

#8 Post by rock5 » Tue Oct 08, 2013 11:54 am

Sorry, I just copied those lines and forgot to change the 'or' to an 'and' as was discussed.
  • 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
gloover
Posts: 304
Joined: Wed Jul 07, 2010 4:31 am

Re: Ignore some whispers during monitoring

#9 Post by gloover » Wed Oct 09, 2013 2:20 pm

Ups, newbie logical confusion ;-)
Thx Rock and Bill - changing to "and" works as it should.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 2 guests