Check for party messages during the whole script

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
Ego95
Posts: 564
Joined: Tue Feb 28, 2012 12:38 pm
Contact:

Check for party messages during the whole script

#1 Post by Ego95 » Sun Jan 27, 2013 3:38 pm

Hi,
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
While the script runs I want to make sure we don't get noticed by other people, so I added a part where it counts players in range and stop if needed and go on after they are gone.

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

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Check for party messages during the whole script

#2 Post by BlubBlab » Sun Jan 27, 2013 4:10 pm

If you want to monitoring you can use:

Code: Select all

registerTimer("monitor", secondsToTimer(2), monitor);
args are: arg1: Name of the Timer you use.
arg2:The Interval
arg3: Function you use, basically the pointer

or you can also use COROUTINES

Code: Select all

co = coroutine.create(foo) ---Creating a coroutine

Code: Select all

coroutine.resume(co) -- This will start the coroutine you can add args by coroutine.resume(co, arg1,arg2, ...)
For more info http://lua-users.org/wiki/CoroutinesTutorial
the only thing I don't know what coco (can?)does with it.

I have added several coroutines on my bot version I let the bot running its updates in the great loop pre the next turn loop,and its skipping of the next WP and some parts of the loot processes. KS b1 a little under 6 minutes now^^(teleport->loot/attack + speed hack and re targeting + WP_NO_STOP)
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

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

Re: Check for party messages during the whole script

#3 Post by lisa » Sun Jan 27, 2013 6:38 pm

are you using partyhealer.xml or partydps.xml as your waypoint?

If so then they will be monitoring party chat constantly, just do this in party chat

Code: Select all

com"nofollow"
It will make the party bots stop following, they will still buff/heal/kill stuff within range of them but they won't be wandering around.

If you want to have your game exited/closed then get them to post this in party chat

Code: Select all

code"player:logout()"
All of the party bots will log out.

Basically the party bots will now do any code that someone posts in party chat using code""

Code: Select all

code"print(I am printing to my MM screen)"
that will make it do the print message to it's MM window.

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

User avatar
Ego95
Posts: 564
Joined: Tue Feb 28, 2012 12:38 pm
Contact:

Re: Check for party messages during the whole script

#4 Post by Ego95 » Sun Jan 27, 2013 7:40 pm

Unfortunately I'm not using these scripts for that, I want to do. I am farming the relationship with one of my guild members in the red hill mountains at a place where you can let many mobs spawn.

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

Re: Check for party messages during the whole script

#5 Post by lisa » Sun Jan 27, 2013 8:52 pm

relationships go up even when only 1 character is killing things.
I generally just have 1 bot running and the rest just sit afk in a safe spot nearby. Aslong as you are within range to actually be put in combat the relationship will go up.

My mains are all lvl 5.8 - 5.9 in their relationships to each other, not sure what lvl 6 values are but I am not to far off them, mind you I don't actually play anymore lol

If you want your guild member to be able to tell your characters what to do I would suguest using partyhealer, he just needs to know the commands to use and how to use them. You can now completely control any party member, even from the other side of the planet.
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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Check for party messages during the whole script

#6 Post by rock5 » Sun Jan 27, 2013 11:00 pm

lisa wrote:

Code: Select all

code"player:logout()"
All of the party bots will log out.
That made me think, doesn't anyone ever need to control only one character in the party? Maybe you could add whisper monitoring as well.
  • 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: Check for party messages during the whole script

#7 Post by lisa » Sun Jan 27, 2013 11:42 pm

Code: Select all

code"if player.Name == "mychar" then player:logout() end"
=)

There is a debate as to how much chat they do monitor, from previous experience party chat doesn't get monitored (or never used to) but whispers are deffinately logged.
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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Check for party messages during the whole script

#8 Post by rock5 » Mon Jan 28, 2013 12:13 am

Ah, there is that.
  • 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
Ego95
Posts: 564
Joined: Tue Feb 28, 2012 12:38 pm
Contact:

Re: Check for party messages during the whole script

#9 Post by Ego95 » Mon Jan 28, 2013 7:43 am

The thing is that there is a special place where you have to use a quest item and then a mob spawns. The questitem has a casttime of 1 second, so you can let a mob spawn every second. And I am doing this with two chars. Maybe I will level up a third or forth one for this :D

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

Re: Check for party messages during the whole script

#10 Post by lisa » Mon Jan 28, 2013 7:57 am

So you just repeat using the quest item?

Code: Select all

code"for i = 1,60 do inventory:useItem(505050) yrest(1100) end sendPartyChat("done 60")"
should use the item 60 times, won't do anything else though, no fighting or healing.

If it is something you would do often you could make up a userfunction that included checking for buffs and healing while using the item and then just call the function

Code: Select all

code"spawnmob()"
Obviously the ID in above code needs changing and the name spawnmob() means nothing unless you call the function that 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

User avatar
Ego95
Posts: 564
Joined: Tue Feb 28, 2012 12:38 pm
Contact:

Re: Check for party messages during the whole script

#11 Post by Ego95 » Wed Jan 30, 2013 4:42 pm

I think I'll post my script to make it easier to understand. Don't know why I didn't do it in the first post. But I got an other idea and I am going to try this first when my guild member is online again. When the script runs permanently we "just" need 1 week = 7 x 24 h to get from 1-10 :P

AlterEgo95

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 13 guests