transport runes
Posted: Sat Mar 24, 2012 9:25 am
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.
Code: Select all
function unStick3()
RoMScript("TB_Teleport(0,21)") --teleports to slot 21 in teleport book
waitForLoadingScreen();
end
yesgrande wrote: that goes in /onload part of a WP right?
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>
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.Golbez wrote:soo this would take me back to the start using my books if it gets stuck 3 times?
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>
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
Code: Select all
local portIndex = getPortIndex("Silverspring-Lake of Magic Mist")
RoMScript("TB_Teleport(0,"..portIndex..")")
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:Lisa, how would I make it teleport after the first time it gets stuck
Don't recall any settings to change this, so it would be a matter of altering default bot again.grande wrote:how would I change the amount of time it waits until it decides it is stuck?
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:Lisa is altering the default bot out of bounds?
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:Which files would those be?
Unfortunately time isn't something have to spare at the moment, haven't even logged in to run my bots for days.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.
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>
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