Page 1 of 1

transport runes

Posted: Sat Mar 24, 2012 9:25 am
by Golbez
just wondering how to make the bot use one of my transport locations if it gets stuck to meny times. im sick of waking up and the bot being closed cause it got stuck.

Re: transport runes

Posted: Sat Mar 24, 2012 11:49 am
by lisa

Code: Select all

function unStick3()
		RoMScript("TB_Teleport(0,21)") --teleports to slot 21 in teleport book
		waitForLoadingScreen();
end
After 3 unstick tries it will teleport to slot 21 in teleport book.

Re: transport runes

Posted: Sat Mar 24, 2012 12:34 pm
by grande
That's awesome, I need to put that in some of my WPs.

Edit: okay I'm dumb... that goes in /onload part of a WP right? pretty sure it does.. don't mind me lol

Re: transport runes

Posted: Sat Mar 24, 2012 8:48 pm
by lisa
grande wrote: that goes in /onload part of a WP right?
yes

Re: transport runes

Posted: Sat Mar 24, 2012 11:22 pm
by Golbez

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="NORMAL">
	<onLoad>
		changeProfileOption("INV_AUTOSELL_ENABLE", true)

		function unStick3()
			RoMScript("TB_Teleport(0,4)") --teleports to slot 21 in teleport book
			waitForLoadingScreen();
		end
	</onLoad>
	<onDeath>
		yrest(20000);
		<!-- #  1 --><waypoint x="-14353" z="38779" y="425" tag="death">	</waypoint>
		<!-- #  2 --><waypoint x="-14511" z="38695" y="438">	</waypoint>
		<!-- #  3 --><waypoint x="-14567" z="38639" y="440">	</waypoint>
		<!-- #  4 --><waypoint x="-14680" z="38530" y="421">	</waypoint>
		<!-- #  5 --><waypoint x="-14791" z="38428" y="439">	</waypoint>
		<!-- #  6 --><waypoint x="-14813" z="38298" y="428">	</waypoint>
		<!-- #  7 --><waypoint x="-14764" z="38196" y="431">	</waypoint>
		<!-- #  8 --><waypoint x="-14712" z="38086" y="432">	</waypoint>
		<!-- #  9 --><waypoint x="-14666" z="37990" y="429">	</waypoint>
		<!-- # 10 --><waypoint x="-14592" z="37856" y="423">	</waypoint>
		<!-- # 11 --><waypoint x="-14524" z="37777" y="449">	</waypoint>
		<!-- # 12 --><waypoint x="-14443" z="37681" y="430">	</waypoint>
		<!-- # 13 --><waypoint x="-14398" z="37599" y="427">	</waypoint>
		<!-- # 14 --><waypoint x="-14367" z="37530" y="428">	</waypoint>
		<!-- # 15 --><waypoint x="-14343" z="37476" y="425">	</waypoint>
		yrest(100);
		__WPL:setForcedWaypointType("NORMAL");
		__WPL:setWaypointIndex(__WPL:findWaypointTag("start"))
	</onDeath>
	<!-- #  1 --><waypoint x="-14352" z="37456" y="432" tag="start">
		yrest(99);
		if 40 >= inventory:itemTotalCount(0) then
			printf("Move To Npc to empty bags")
			__WPL:setWaypointIndex(__WPL:findWaypointTag("to merchant"))
		else
			printf("Bags do not need to be emptied yet")
		end
	</waypoint>
	<!-- #  2 --><waypoint x="-14452" z="37755" y="434" tag="continue">	</waypoint>
	<!-- #  3 --><waypoint x="-14581" z="37866" y="424">	</waypoint>
	<!-- #  4 --><waypoint x="-14694" z="37970" y="429">	</waypoint>
	<!-- #  5 --><waypoint x="-14801" z="38111" y="414">
		__WPL:setForcedWaypointType("NORMAL");
		__WPL:setWaypointIndex(__WPL:findWaypointTag("start"))
	</waypoint>

	<!-- #  1 --><waypoint x="-14384" z="37362" y="382" tag="to merchant">	</waypoint>
	<!-- #  2 --><waypoint x="-14366" z="37298" y="218">	</waypoint>
	<!-- #  3 --><waypoint x="-14522" z="37237" y="174">	</waypoint>
	<!-- #  4 --><waypoint x="-14689" z="37002" y="149">	</waypoint>
	<!-- #  5 --><waypoint x="-14744" z="36996" y="149">
		yrest(1000);
		player:merchant("Soloman Julab");
		yrest(100);
		printf("Bags emptied")
	</waypoint>
	<!-- #  7 --><waypoint x="-14645" z="37000" y="149"> __WPL:setForcedWaypointType("TRAVEL");	</waypoint>
	<!-- #  8 --><waypoint x="-14532" z="37220" y="171"> __WPL:setForcedWaypointType("TRAVEL");	</waypoint>
	<!-- #  9 --><waypoint x="-14293" z="37276" y="216"> __WPL:setForcedWaypointType("TRAVEL");	</waypoint>
	<!-- # 10 --><waypoint x="-14042" z="37058" y="282"> __WPL:setForcedWaypointType("TRAVEL");	</waypoint>
	<!-- # 11 --><waypoint x="-14003" z="37244" y="294"> __WPL:setForcedWaypointType("TRAVEL");	</waypoint>
	<!-- # 12 --><waypoint x="-13696" z="37388" y="385"> __WPL:setForcedWaypointType("TRAVEL");	</waypoint>
	<!-- # 13 --><waypoint x="-13708" z="37490" y="419"> __WPL:setForcedWaypointType("TRAVEL");	</waypoint>
	<!-- # 14 --><waypoint x="-13894" z="37724" y="399"> __WPL:setForcedWaypointType("TRAVEL");	</waypoint>
	<!-- # 15 --><waypoint x="-14242" z="37457" y="425"> __WPL:setForcedWaypointType("TRAVEL");	</waypoint>
	<!-- # 16 --><waypoint x="-14331" z="37450" y="429"> __WPL:setForcedWaypointType("NORMAL");	</waypoint>
	__WPL:setWaypointIndex(__WPL:findWaypointTag("start"))
</waypoints>

soo this would take me back to the start using my books if it gets stuck 3 times?

Re: transport runes

Posted: Sun Mar 25, 2012 1:48 am
by lisa
Golbez wrote:soo this would take me back to the start using my books if it gets stuck 3 times?
it will make you use teleport to the 4th spot in teleport book, since you are obviously doing a shot distance teleport then you should also put a time limit on the wait for loading screen as it might load so fast the bot missed the actual loading screen.

You should probably tell it to go to a specific waypoint in the file aswell.

Code: Select all

   <onLoad>
      changeProfileOption("INV_AUTOSELL_ENABLE", true)

      function unStick3()
         RoMScript("TB_Teleport(0,4)") --teleports to slot 4 in teleport book
         waitForLoadingScreen(30); -- waits a maximum of 30 seconds
player:update()
      __WPL:setForcedWaypointType("NORMAL");
      __WPL:setWaypointIndex(__WPL:findWaypointTag("start"))

      end
   </onLoad>

Re: transport runes

Posted: Sun Mar 25, 2012 3:57 am
by rock5
You might be interested in a function I created today for my frog ribbons file. It returns the index number, given a teleport name. That way you can use the script with more than 1 character if they use different teleport book slots.

Code: Select all

	function getPortIndex(_name)
		local i = 1
		repeat
			local TB_ID,note,ZoneID,X,Y,Z,Name,icon=RoMScript("TB_GetTeleportInfo("..i..")")
			if note == _name then
				return i
			elseif TB_ID == 0 then
				return false
			else
				i = i + 1
			end
		until false
	end
Eg.

Code: Select all

local portIndex = getPortIndex("Silverspring-Lake of Magic Mist")
RoMScript("TB_Teleport(0,"..portIndex..")")
Note: This function assumes there are no gaps in the teleport book. Eg. if you have points marked in slot 1,2 and 10, it wont see the one in 10. If you have gaps the function will have to be modified.

Re: transport runes

Posted: Sun Mar 25, 2012 9:35 pm
by grande
Lisa, how would I make it teleport after the first time it gets stuck and how would I change the amount of time it waits until it decides it is stuck? I tried simply changing unStick3() to unStick1() but that had no affect. Thx :-)

Re: transport runes

Posted: Sun Mar 25, 2012 10:54 pm
by lisa
grande wrote:Lisa, how would I make it teleport after the first time it gets stuck
The only way you can do that is to alter the default bot, I only added in for 3, 6 and 9 unstick. I will never even concider adding in a function for 1 unstick because if you get a stun from a mob as you kill it then that is 1 unstick, If you trip on a pebble that is 1 unstick.
grande wrote:how would I change the amount of time it waits until it decides it is stuck?
Don't recall any settings to change this, so it would be a matter of altering default bot again.

Surely there is a better way to deal with what ever issue you are having. Change coords of the waypoint, go round obstacles, even try jumping something.

Re: transport runes

Posted: Mon Mar 26, 2012 6:06 am
by grande
Lisa is altering the default bot out of bounds? Which files would those be? I'd actually like some flexibility in the amout of time it runs against a wall before it decides to back off and run forward again. As it is it tries too long imo.

Re: transport runes

Posted: Mon Mar 26, 2012 10:44 pm
by lisa
grande wrote:Lisa is altering the default bot out of bounds?
I believe that the code is open for anyone to see and also modify but the issue is that when we do updates to the default bot your version will be different and you might have to re-edit in your changes everytime we update. I say might have to because tortoise SVN is actually very smart and it can merge changes but it might not be possible all the time.
grande wrote:Which files would those be?
Although if you do make your own changes and completely break the bot you can always just delete the folder and d/l again using SVN, if you don't know where to start looking then chances are you will struggle to keep the changes you want when updates occur.
grande wrote: I'd actually like some flexibility in the amout of time it runs against a wall before it decides to back off and run forward again. As it is it tries too long imo.
Unfortunately time isn't something have to spare at the moment, haven't even logged in to run my bots for days.
If I had more time I could look at making a profile option for it but to be honest I don't have this issue, I just make sure my coords work and never get stuck. So for me the only time I get stuck is with stunn effects from mobs in which case I want bot to just keep doing what it's doing.

Re: transport runes

Posted: Wed Mar 28, 2012 1:38 pm
by grande
I hear you. No prob, I'll poke around and see what I can break... not really up top in my priorities right now either. I'll probably meander/gravitate towards more manipulation as time goes on.

Re: transport runes

Posted: Thu Mar 27, 2014 4:27 pm
by 883Dman
I'm trying to set this up with Secret Garden. I have everything working except the teleport part. I never know where to put the function. I tried in-line as you see here and also onload. I need to port back to elven island.

Code: Select all

<!-- #  2 --><waypoint x="3301" z="160" y="51"> 
	 function getPortIndex(_name)
      local i = 1
      repeat
         local TB_ID,note,ZoneID,X,Y,Z,Name,icon=RoMScript("TB_GetTeleportInfo("..i..")")
         if note == _name then
            return i
         elseif TB_ID == 0 then
            return false
         else
            i = i + 1
         end
      until false
   end
	local portIndex = getPortIndex("Elf Island-Valley of Preparation")
RoMScript("TB_Teleport(0,"..portIndex..")")
	</waypoint>

Re: transport runes

Posted: Fri Mar 28, 2014 11:28 pm
by rock5
That looks ok. Assuming that is the waypoint you want to teleport from and you have that point marked and it's spelt correctly and you have transport runes, it looks like it would work.

Here's a version that prints some information that should help you figure out what's happening.

Code: Select all

	function getPortIndex(_name)
		local i = 1
		repeat
			local TB_ID,note,ZoneID,X,Y,Z,Name,icon=RoMScript("TB_GetTeleportInfo("..i..")")
			if note == _name then
				print("Index found: "..i)
				return i
			elseif TB_ID == 0 then
				print("Name not found in transport book.")
				return false
			else
				print(i..": "..note)
				i = i + 1
			end
		until false
	end
It will print all the names so if it doesn't find the one specified you can see what name you are supposed to use.