party chat monitoring

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Message
Author
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: party chat monitoring

#21 Post by lisa » Wed Oct 03, 2012 6:04 pm

checkparty() is part of the default bot and always will be, if it isn't working then there is probably an address that needs updating after a patch.
Everything that goes into making that function work is pretty complicated and it uses half a dozen addresses and offsets to work.

I'll have a look at updating a few clients this weekend, if I can find the time, you could always narrow down the issue yourself as to why it's not working.

I have seen many posts by people lately who haven't updated the bot properly and are getting issues with incorrect addresses.
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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: party chat monitoring

#22 Post by lisa » Wed Oct 03, 2012 10:35 pm

About 10 patches later I updated 1 of my machines and tested the checkparty()

Works perfectly......

So you must need to update bot or something because it works fine for me.
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

miesermetzler
Posts: 46
Joined: Tue Dec 06, 2011 12:17 pm

Re: party chat monitoring

#23 Post by miesermetzler » Wed Oct 03, 2012 11:14 pm

Hmmmm, but how to do this? I mean an update? After every patch or fix i´ll follow all these steps you wrote below your avatar. Thats the way to update MM, isn´t it?

Edit: Btw can you upload the userfunction again. I look in this topic and its no longer available. And i deleted it from userfunctions folder :(

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

Re: party chat monitoring

#24 Post by rock5 » Wed Oct 03, 2012 11:40 pm

miesermetzler wrote:Hmmmm, but how to do this? I mean an update? After every patch or fix i´ll follow all these steps you wrote below your avatar. Thats the way to update MM, isn´t it?
Except after the last patch there was no bot update so when you got the error saying "run 'rom/update'" you need to follow that step. A lot of people don't do that instead they start a topic saying it doesn't work.
lisa wrote:I have seen many posts by people lately who haven't updated the bot properly and are getting issues with incorrect addresses.
I've been thinking maybe, if update.lua works after a patch, we should commit the updated addresses.lua file anyway, just to avoid these problems.
  • 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: party chat monitoring

#25 Post by lisa » Wed Oct 03, 2012 11:59 pm

--=== Moves discussion out of my userfunction topic to dev section ===--


LOL
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

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: party chat monitoring

#26 Post by noobbotter » Thu Mar 14, 2013 2:04 pm

I have a quick question about how the code you posted for the eventParty() works.

Code: Select all

eventParty()
repeat
     local msg,name = checkEventParty()
     yrest(1000)
until msg ~= nil
if msg == "ready" then
--do stuff
end
eventParty("stop")
looking at that, it almost looks like after the monitor starts, as soon as any text comes through party chat, it will check if it equals "ready" and if so, it will do stuff, then regardless of what was in the text, it will stop the eventParty function. Am I reading that wrong? if the received message was "wait", it wouldn't do stuff but it would still stop the eventParty monitor? Should the eventParty("stop") be inside the if statement?

dr-nuker
Posts: 145
Joined: Sun Oct 09, 2011 7:33 am

Re: party chat monitoring

#27 Post by dr-nuker » Thu Mar 14, 2013 5:50 pm

eventParty()
repeat
local msg,name = checkEventParty()
yrest(1000)
until msg == "ready"

-- do stuff

eventParty("stop")

that's how i use it. besides the fact that i try to use more complex text messages in scripts since i want to identify all of them individually...

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: party chat monitoring

#28 Post by noobbotter » Thu Mar 14, 2013 9:03 pm

I can get it to recognize that a message was received and the monitor will stop, but I can't get it to do anything with the message that was received. Take this for example. Depending on if the message is mount, follow, getquest, or aceptquest, I have set up other functions to do. None of them are doing anything some I've reduced it to print messages:

Code: Select all

function QBF_startchoosefunction()
		eventParty()
		repeat
			local msg,name = checkEventParty()
			yrest(500)
		until msg ~= nil
		if msg == "mount" then
			print("equals mount");
		end
		if msg == "follow" then
			print("equals follow");
		end
		if msg == "getquest" then
			print("equals getquest");
		end
		if msg == "completequest" then
			print("equals completequest");
		end
		eventParty("stop")
		if msg == "mount" then
			print("equals mount");
		end
		if msg == "follow" then
			print("equals follow");
		end
		if msg == "getquest" then
			print("equals getquest");
		end
		if msg == "completequest" then
			print("equals completequest");
		end
end
I've tried that with the message being "mount". It sees it and stops the event listener, but never prints anything. If I put an fprint to show me what msg is, it always errors out and says it's nil. does the event function not return the actual message anywhere? How would I do this to call a certain function if msg is one of the four messages I want?

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

Re: party chat monitoring

#29 Post by lisa » Thu Mar 14, 2013 10:10 pm

ok so it gets a msg ~= nil

Code: Select all

      repeat
         local msg,name = checkEventParty()
         yrest(500)
      until msg ~= nil
and then checks if the msg is any of those you check for, regardless of if it is any or isn't it will get to the

Code: Select all

eventParty("stop")
So if nothing is printed then it is saying that msg isn't anything you checked for.

Just add a print after the check for it ~= nil like this

Code: Select all

function QBF_startchoosefunction()
      eventParty()
      repeat
         local msg,name = checkEventParty()
         yrest(500)
      until msg ~= nil
      print("Msg: "..msg.." Name: "..name) -- I added this line.
      if msg == "mount" then
You will then atleast see what the msg is.

If you want to look at a more complex example of monitoring this is in party.lua

Code: Select all

function partyCommands()

	local _message , _name = checkEventParty()
	if _message then
		--=== check type of command ===--
		local _npc, _quest, _command, _choice, _action
		_quest = string.match(_message,"quest\"(.*)\"")
		_npc = string.match(_message,"npc\"(.*)\"")
		_command = string.match(_message,"com\"(.*)\"")
		_action = string.match(_message,"code\"(.*)\"")
		if _quest then _quest = string.lower(_quest) end
		if _npc then _npc = string.lower(_npc) end
		if _command then _command = string.lower(_command) end

		if _quest then
			local quest, status = getQuestNameStatus(_quest)
			if quest == nil then
				sendPartyChat("no quest with that name")
			else
				if status then
					sendPartyChat("quest: "..quest.." ,completed")
				else
					sendPartyChat("quest: "..quest.." ,incomplete")
				end
			end
		elseif _npc == "sell" then
			local npc = getTarget(_name)
			if npc then
				player:merchant(npc.Name)
				sendPartyChat("finished with NPC")
			else
				sendPartyChat("npc: No target")
			end
		elseif _npc == "accept" or _npc == "complete" then
			local npc = getTarget(_name)
			if npc then
				player:target_NPC(npc.Name)
				CompleteQuestByName()
				player:target_NPC(npc.Name)
				AcceptQuestByName()
				sendPartyChat("finished with NPC")
			else
				sendPartyChat("npc: No target")
			end
		elseif _npc then
			local npc = getTarget(_name)
			if npc then
				player:target_NPC(npc.Name)
				if ChoiceOptionByName(_npc) then
					sendMacro('} if StaticPopup1:IsVisible() then StaticPopup_OnClick(StaticPopup1, 1) end a={')
					waitForLoadingScreen(10)
					sendPartyChat("ok choice option done")
				else
					sendPartyChat("no option available by that name")
				end
			else
				sendPartyChat("npc: No target")
			end
		elseif _command == "nofollow" then
			keyboardPress(settings.hotkeys.MOVE_FORWARD.key);
			stop = true
			sendPartyChat("stopped following")
		elseif _command == "follow" then
			stop = false
			sendPartyChat("following")
		elseif _command == "farm" then
			if not healer then
				settings.profile.options.ICON_FIGHT = false
				sendPartyChat("Set to farm mobs")
			end
		elseif _command == "icon" then
				settings.profile.options.ICON_FIGHT = true
				sendPartyChat("Set to kill icon I")
		elseif _command == "portal" then
			if GoThroughPortal then
				if GoThroughPortal(200) == true then
					sendPartyChat("I should be through the portal now")
				else
					sendPartyChat("I didnt see a loadingscreen, please check I went through portal")
				end
			else
				sendPartyChat("please get GoThroughPortal to make that work")
			end
		elseif _action then
			local docode = loadstring(_action);
			if docode then docode() else sendPartyChat("Bad code, try again") end
		end
	end
end
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

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: party chat monitoring

#30 Post by noobbotter » Thu Mar 14, 2013 10:44 pm

Ok, I tried what you had and I still got nil.

Code: Select all

eventParty()
	repeat
		local msg, name = checkEventParty()
		yrest(100)
	until msg ~= nil
	print("Msg: "..msg) -- I added this line.
	eventParty("stop")
i then did it without declaring msg and name as local and it worked:

Code: Select all

eventParty()
	repeat
		msg, name = checkEventParty()
		yrest(100)
	until msg ~= nil
	print("Msg: "..msg) -- I added this line.
	eventParty("stop")
does that declare it as local inside the checkEventParty() function or something? I don't see why it's not available if it's set local.

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

Re: party chat monitoring

#31 Post by rock5 » Thu Mar 14, 2013 11:00 pm

I was was just going to say that but you worked it out yourself. Well done!

You should still declare it local to the function but outside the repeat loop.

Code: Select all

eventParty()
   local msg, name
   repeat
      msg, name = checkEventParty()
      yrest(100)
   until msg ~= nil
  • 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

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: party chat monitoring

#32 Post by kenzu38 » Mon Mar 18, 2013 4:53 am

Hey lisa, just wanted to ask how I can get the bot to monitor if the party leader is targeting an NPC with party bot?

What I'd like is for the bot to recognize that the char I'm playing manually is targeting an NPC and then the party bots will automatically target that NPC as well and accept or complete all quests of that NPC.

Thanks.

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

Re: party chat monitoring

#33 Post by lisa » Mon Mar 18, 2013 5:31 am

when you target the NPC just type in party chat

Code: Select all

npc"accept"
All party bots will target your target and then do this code.

Code: Select all

				player:target_NPC(npc.Name)
				CompleteQuestByName()
				player:target_NPC(npc.Name)
				AcceptQuestByName()
				sendPartyChat("finished with NPC")
To make party bot automatically check for the party leaders target would be a waste, IMHO.

Just set up little macros that do the party chats for you and then add the macros to a side bar, it's very easy.

BTW this topic is obsolete now, head to this topic for party bot questions/answers.
http://www.solarstrike.net/phpBB3/viewt ... =21&t=4402
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

Locked

Who is online

Users browsing this forum: Semrush [Bot] and 20 guests