I have got a waypoint file I use with 3 chars. Two of them are mine and one is a guild member.
At first I start the waypoint with my two chars. Because they should start at the same time my guild member posts "ready" in the party chat.
I am doing this with
Code: Select all
function waitForLeader()
cprintf(cli.lightred,"Waiting to start...\n")
while true do
local time, moreToCome, _name, _message = EventMonitorCheck("Wait","4,1",true)
if _message then
string.lower(_message)
end
if _message and (_message == "ready") then
break
else
yrest(500)
end
end
cprintf(cli.lightgreen,"Go!\n")
end
What I want to add now is a possibility to stop the bot with a chat command.
For example my guild member has to go offline, it would be nice, if he only has to write "stop" in the chat to let my scripts stop. My problem is that I don't know how to use a function like above while my bots are running and how to check it anywhere in the script. I thought about monitoring like gm detect does.
I have already tried to use the countplayer function to check if one of the chars is missing and then let everyone stop but it seems to be a bit buggy. It ran it for 5-10 minutes and then my first char could not find my other char while it stood next to him.
So in one question: How can I check for a "stop" message in the party chat during the whole script and go on when it detects a "ready" message?
AlterEgo95