Page 2 of 2
Re: party chat monitoring
Posted: Wed Oct 03, 2012 6:04 pm
by lisa
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.
Re: party chat monitoring
Posted: Wed Oct 03, 2012 10:35 pm
by lisa
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.
Re: party chat monitoring
Posted: Wed Oct 03, 2012 11:14 pm
by miesermetzler
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
![Sad :(](./images/smilies/icon_e_sad.gif)
Re: party chat monitoring
Posted: Wed Oct 03, 2012 11:40 pm
by rock5
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.
Re: party chat monitoring
Posted: Wed Oct 03, 2012 11:59 pm
by lisa
--=== Moves discussion out of my userfunction topic to dev section ===--
LOL
Re: party chat monitoring
Posted: Thu Mar 14, 2013 2:04 pm
by noobbotter
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?
Re: party chat monitoring
Posted: Thu Mar 14, 2013 5:50 pm
by dr-nuker
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...
Re: party chat monitoring
Posted: Thu Mar 14, 2013 9:03 pm
by noobbotter
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?
Re: party chat monitoring
Posted: Thu Mar 14, 2013 10:10 pm
by lisa
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
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
Re: party chat monitoring
Posted: Thu Mar 14, 2013 10:44 pm
by noobbotter
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.
Re: party chat monitoring
Posted: Thu Mar 14, 2013 11:00 pm
by rock5
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
Re: party chat monitoring
Posted: Mon Mar 18, 2013 4:53 am
by kenzu38
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.
Re: party chat monitoring
Posted: Mon Mar 18, 2013 5:31 am
by lisa
when you target the NPC just type in party chat
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