Stop the bot after last waypoint (stop running)

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
Marcora
Posts: 9
Joined: Tue Feb 19, 2013 11:11 am

Stop the bot after last waypoint (stop running)

#1 Post by Marcora » Wed Sep 18, 2013 2:33 am

Hi all

How to stop running the bot after the last waypoint here

Code: Select all

<!-- # 12 --><waypoint x="2596" z="3198" y="143">
to wait until the timer.

my file for Drill Ground (I want to survive).

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL" >
<onLoad>
	--== User Option ==--
	RunningSpeed = 60       -- The speed the character runs, 50 is normal. Recommended 59.

	--=================--

	--== Apply speed hack ==--
	local playerAddress = memoryReadIntPtr(getProc(), addresses.staticbase_char, addresses.charPtr_offset);
	if playerAddress ~= 0 then
		memoryWriteFloat(getProc(), playerAddress + 0x40, RunningSpeed);
	end

	--=================--
</onLoad>


	<!-- #  1 --><waypoint x="2483" z="-1385" y="53">
		player:target_NPC("Guild Castle Manager");
		sendMacro("ChoiceOption(2);");	   player:rest(2);   waitForLoadingScreen();   player:rest(2);</waypoint>
	<!-- #  1 --><waypoint x="0" z="-485" y="5">	</waypoint>
	<!-- #  2 --><waypoint x="-125" z="-270" y="6">	</waypoint>
	<!-- #  3 --><waypoint x="-303" z="-105" y="5">	</waypoint>
	<!-- #  4 --><waypoint x="-389" z="-80" y="5">	</waypoint>
	<!-- #  5 --><waypoint x="-403" z="183" y="9">	   player:rest(2); 
		player:target_Object("Drill Ground III");
		sendMacro("ChoiceOption(1);");	   player:rest(2);   waitForLoadingScreen();   player:rest(2);
		player:target_NPC("Special Training Manager");

                sendMacro("ChoiceOption(2);"); yrest(200); 
		sendMacro("ChoiceOption(2);");	   player:rest(2);   waitForLoadingScreen();   </waypoint>


	<!-- #  1 --><waypoint x="2074" z="4519" y="31">	fly(); 	</waypoint>
	<!-- #  2 --><waypoint x="2128" z="4465" y="31">	</waypoint>
	<!-- #  3 --><waypoint x="2209" z="4384" y="71">	</waypoint>
	<!-- #  4 --><waypoint x="2277" z="4268" y="112">	</waypoint>
	<!-- #  5 --><waypoint x="2355" z="4188" y="143">	</waypoint>
	<!-- #  6 --><waypoint x="2426" z="4109" y="143">	</waypoint>
	<!-- #  7 --><waypoint x="2558" z="3962" y="143">	</waypoint>
	<!-- #  8 --><waypoint x="2591" z="3791" y="143">	</waypoint>
	<!-- #  9 --><waypoint x="2593" z="3696" y="143">	flyoff();	</waypoint>
	<!-- # 10 --><waypoint x="2595" z="3534" y="143">	</waypoint>
	<!-- # 11 --><waypoint x="2594" z="3319" y="143">	</waypoint>
	<!-- # 12 --><waypoint x="2596" z="3198" y="143">
	</waypoint>
</waypoints>
sorry i am use google translate tx for you help :D
Last edited by Marcora on Wed Sep 18, 2013 2:47 am, edited 2 times in total.

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

Re: Stop the bot after last waypoint (stop running)

#2 Post by lisa » Wed Sep 18, 2013 2:41 am

If you want Micromacro to exit the script you can do

Code: Select all

error("finished")
If you want it to just stop in place and continue if it gets attacked you can use

Code: Select all

player:sleep()
You can also make it load other characters or other WP, you can make it do pretty much anything you want.
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
Marcora
Posts: 9
Joined: Tue Feb 19, 2013 11:11 am

Re: Stop the bot after last waypoint (stop running)

#3 Post by Marcora » Wed Sep 18, 2013 4:16 am

allo

i am test player:sleep() the problem is enter combat on the screen, its possible no move after last waypoint exemple (2 minute) after relog next character.

tx :D

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

Re: Stop the bot after last waypoint (stop running)

#4 Post by lisa » Thu Sep 19, 2013 1:50 am

You can just create a loop, it really comes down to what you want it to specifically do.
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

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Stop the bot after last waypoint (stop running)

#5 Post by ZZZZZ » Sat Jan 25, 2014 9:15 am

Just wondering, how would I go about making player:sleep() or something similar work without combat waking it up? I have been using a function that buffs a friendly target but I have it set so if player dies it goes to sleep, so I can manually resume it after I have res-ed it and fixed up buffs/pet. The issue is that even while its dead combat keeps pulling it out of sleep...
I guess I could try

Code: Select all

repeat
yrest(200)
player:update
until player.Alive
but I would rather it stay 'asleep' until I manually resume it.

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

Re: Stop the bot after last waypoint (stop running)

#6 Post by rock5 » Sat Jan 25, 2014 9:48 am

How do you get attacked if you are dead? Or are you talking about after you rez while you are buffing? You could just press the End key to pause the script while you are buffing. Then press the continue button twice to resume the script.
  • 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

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Stop the bot after last waypoint (stop running)

#7 Post by ZZZZZ » Sat Jan 25, 2014 11:24 am

I am using a character to 'buff' my main character while running an instance. If that character dies mid fight for example, you still get the 'in combat' until either the rest of your party or the boss dies. Meaning it just endlessly spams the MM window until either of those conditions are done. It's not that easy tabing out to hit end on a different client while trying to survive/kill Bela/Beth hm bosses, so just looking for a way around it.


*I know this is offtopic, but its to do with the same file, im trying to get my alt to change 'target' without me actually stoping and starting it over again. To do so I figured I would make it so it monitors whisper for my main character and if it says something to it, check if its a players name in range, and if so make that its new target. Tried using:

Code: Select all

		EventMonitorStart("Changetank", "CHAT_MSG_WHISPER");
			local ChangeTankname
			repeat
			local time, moreToCome, name, msg = EventMonitorCheck("Changetank", "4,1")
			if name == "--maintoon--" and msg ~= nil then
				ChangeTankname = player:findNearestNameOrId(msg)
				if ChangeTankname and 200 > distance(ChangeTankname.X, ChangeTankname.Z, player.X, player.Z) then
				Tobuff = Changetankname
				Tankname = Changetankname
				end
			end
--- do the rest
until ( keyPressed( key.VK_F8 ) )
EventMonitorStop("Changetank", "CHAT_MSG_WHISPER");
but i just get this error

Code: Select all

onLoad error: E:/micromacro/scripts/rom/classes/player.lua:3691: bad argument #1
 to 'pairs' (table expected, got nil)

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

Re: Stop the bot after last waypoint (stop running)

#8 Post by rock5 » Sat Jan 25, 2014 11:04 pm

player line 3691

Code: Select all

						if( closestObject == nil ) then
I don't see any 'pairs' there. What version of the bot are you using? Has player.lua been modified?
  • 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: Stop the bot after last waypoint (stop running)

#9 Post by lisa » Sat Jan 25, 2014 11:14 pm

ZZZZZ wrote:I am using a character to 'buff' my main character while running an instance.
Any reason you don't use party bot for this?
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

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Stop the bot after last waypoint (stop running)

#10 Post by ZZZZZ » Sun Jan 26, 2014 12:08 am

lisa wrote:Any reason you don't use party bot for this?
I made a function for ch/m. Its only a simple 'spam skill depending on declared options'. I have it so I enter the player I want the ch/m to spam high energy barrier on, and if they are in range it will do so. Currently I have made it so i can hit F8 to reload the funtion and allow me to enter a different player to buff, but im looking to make it change just by whispering the character. (easier mid boss fight etc).
rock5 wrote:player line 3691

Code: Select all

						if( closestObject == nil ) then
I don't see any 'pairs' there. What version of the bot are you using? Has player.lua been modified?
Sorry, i had edited the target_NPC function. **wrong line, edited out**


** I tried using this to check if the EventMonitor was working:

Code: Select all

			local time, moreToCome, _name, _msg = EventMonitorCheck("Changetank","4,1")
			if _msg == "test" then
				cprintf(cli.yellow,"\nWorked\n")
			end
and it wouldn't return 'Worked' :/
Last edited by ZZZZZ on Sun Jan 26, 2014 12:43 am, edited 1 time in total.

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

Re: Stop the bot after last waypoint (stop running)

#11 Post by rock5 » Sun Jan 26, 2014 12:31 am

So what was the extent of your edits? What's on line 3691?
  • 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

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Stop the bot after last waypoint (stop running)

#12 Post by ZZZZZ » Sun Jan 26, 2014 12:42 am

From line 3651 i changed the target_NPC function to:

Code: Select all

	local npc = self:findNearestNameOrId(_npcname)
	if npc then	-- we successfully found NPC
		cprintf(cli.green, language[136], npc.Name);	-- we successfully target NPC
		if( distance(self.X, self.Z, npc.X, npc.Z) > 39 ) then
			self:moveInRange(CWaypoint(npc.X, npc.Z), 39, true);
		end
		-- target NPC
		repeat
		RoMScript("CloseWindows()");
		self:target(npc.Address)
		Attack(); yrest(50); Attack(); -- 'click' again to be sure
		yrest(500);
		until RoMScript("SpeakFrame:IsVisible()") or RoMScript("MailFrame:IsVisible()");
		return true
	else
		cprintf(cli.green, language[137], _npcname);	-- we can't find NPC
		return false
	end
end
Has worked perfectly for me, no longer 'miss' targeting an NPC and causing ChoiceOption to fail.

Code: Select all

			for __, _objnameorid in pairs(_objtable) do

is line 3691 for me.

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

Re: Stop the bot after last waypoint (stop running)

#13 Post by lisa » Sun Jan 26, 2014 2:30 am

well if the bot is still running you can use the default functions for party chat.

Code: Select all

eventParty(_startstop)

sendPartyChat(_msg)

checkEventParty()

So you would do

Code: Select all

eventParty()
which will start the event monitoring for party chat.

Then you can do

Code: Select all

local msg,name = checkEventParty()
As for your code you probably just didn't start the event monitoring

Code: Select all

EventMonitorStart("Changetank", "CHAT_MSG_PARTY")
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

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Stop the bot after last waypoint (stop running)

#14 Post by ZZZZZ » Sun Jan 26, 2014 9:25 am

Got it working spot on now, funnily enough you were right about the eventmonitoring lisa, even though I had it set to start i had:

Code: Select all

EventMonitorStop("Changetank", "CHAT_MSG_PARTY")
EventMonitorStart("Changetank", "CHAT_MSG_PARTY")
Which for some reason would only stop it and ignore the start. Then I had an issue with the findNearestNameorId function and trying to save a variable as a boolean instead of a string, but fixed that, so works great now.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 0 guests