Page 1 of 1

[SOLVED] Monitor Party Chat Twice

Posted: Fri Oct 07, 2016 8:04 am
by kutalmismete
Here is my waypoint file. I need multi-monitoring party chat but its working random, I mean when I write "buff" it doesn't working but if i spam that it working sometimes.I need multithread method I don't know much about that so I tried it with writing a function for that. Still same. I need a code for monitoring party chat twice. If I write "buff" it will goes to DruidBuff.xml waypoint file, if I write "Go!" it starts Druid.xml. Thanks

Code: Select all

<?xml version="0.1" encoding="utf-8"?><waypoints>
<onLoad>
	function getCD(ID)
	   local offset = memoryReadRepeat("int", getProc(), GetItemAddress(ID) + addresses.skillRemainingCooldown_offset) or 0
	   if offset and offset ~= 0 then
		  return (memoryReadRepeat("int", getProc(), addresses.staticCooldownsBase + (offset+1)*4) or 0)/10
	   end
	   return 0
	end
	function checkMessagesFromParty(_string, _string1, _string2)
		eventparty("".._string1.."")
		repeat
			_string = checkeventparty("".._string1.."", "".._string2.."")
		until _string
		return true
	end	
	repeat
		player:update();
		RoMScript("TargetUnit('raid1');");
		RoMScript("FollowUnit('raid1');");
		checkMessagesFromParty(a, "nick", "Go!") 
		checkMessagesFromParty(b, "nick", "buff")
	until a or b
		if a then
			RoMScript("UseAction(1)")
			yrest(100)
			loadPaths("Druid");
		elseif b then
			sendPartyChat('Buffing...')
			yrest(100)
			loadPaths("DruidBuff");
		end
</onLoad>
</waypoints>

Re: [REQUEST] Monitor Party Chat Twice

Posted: Fri Oct 07, 2016 10:26 am
by kenzu38
Just checked and there's no checkeventparty function, at least in my bot folders. Is it something you wrote? If it is, you'll have to post it here as it might be the reason for the error. party.lua has checkEventParty, notice the uppercases.

Re: [REQUEST] Monitor Party Chat Twice

Posted: Sat Oct 08, 2016 4:28 am
by kutalmismete
Its defined on party.lua. Nevermind problem solved.

Code: Select all

	
	EventMonitorStart("check", "CHAT_MSG_PARTY")
	EventMonitorStart("check2", "CHAT_MSG_PARTY")

time, moreToCome, name, message = EventMonitorCheck("check","4,1",true)
time, moreToCome, name2, message2 = EventMonitorCheck("check2","4,1",true)
Monitoring twice working good like that, If anyone need.

Re: [REQUEST] Monitor Party Chat Twice

Posted: Sat Oct 08, 2016 8:54 am
by Bill D Cat
kutalmismete wrote:Its defined on party.lua. Nevermind problem solved.
The function checkEventParty() is defined in party.lua, and the function name is case sensitive.
However, there is no definition in party.lua for an all lowercase checkeventparty() function name as you originally posted.
All bot function names are case sensitive. That's the point that kenzu38 was making.

Re: [REQUEST] Monitor Party Chat Twice

Posted: Sat Oct 08, 2016 10:17 am
by kutalmismete
Unfortunately, I got that code from another topic and it was working with "checkeventparty" function. But when I put second checker, whole waypoint only running second wrote function. But I checked inside of that function, now its working.