Rock5's travelTo userfunction

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Post Reply
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Rock5's travelTo userfunction

#1 Post by rock5 » Tue Jun 11, 2013 11:45 am

Description:
  • This is my 'travelTo' userfunction, inspired by noobbotters worldtraveler userfunction. Thanks Noobbotter and everyone else who contributed to it.

    This function takes you from any of the defined nodes (typically teleporter npcs) to any other node automatically, taking the shortest route.
Syntax:
    • travelTo("nodename[, returnBool]")
    Where "nodename" is one of the defined node names that you wish to travel to. Eg. And where returnBool is an optional argument that, when true, returns false instead of an error when the function fails. So the user can take action to recover. Eg.
    • Code: Select all

      if travelTo("VaranasCentral", true) == false then
          -- Take recovery steps.
      end
    Here is a list of the currently defined node names. They vary slightly from 'worldtraveler'.
    • [tr][td]Node Name[/td][td]Location[/td][/tr] [tr][td]-------------[/td][td]----------[/td][/tr] [tr][td]-- TELEPORTERS[/td][/tr] [tr][td]AbandonedFortress[/td][td]Abandoned Fortress[/td][/tr] [tr][td]AyrenCaravan[/td][td]Ayren Caravan[/td][/tr] [tr][td]BattleSquare[/td][td]Obsidian Stronghold Battle Square.[/td][/tr] [tr][td]Boulderwind[/td][td]Boulderwind Village[/td][/tr] [tr][td]Chrysalia[/td][td]Chrysalia[/td][/tr] [tr][td]CraftingSquare[/td][td]Obsidian Stronghold Crafting Square.[/td][/tr] [tr][td]Dalanis[/td][td]Dalanis Snoop[/td][/tr] [tr][td]DalanisObsidianEnvoy[/td][td]Dalanis Envoy[/td][/tr] [tr][td]DesertInvestigation[/td][td]Desert Investigation Post[/td][/tr] [tr][td]Dimarka[/td][td]Dimarka[/td][/tr] [tr][td]FangersMakeshift[/td][td]Fangers Makeshift Camp[/td][/tr] [tr][td]Fireboot[/td][td]Fireboot Fortress[/td][/tr] [tr][td]Frontline[/td][td]Frontline Camp[/td][/tr] [tr][td]GlorySquare[/td][td]Obsidian Stronghold Glory Square.[/td][/tr] [tr][td]GreenTower[/td][td]Green Tower[/td][/tr] [tr][td]HarfTradingPost[/td][td]Harf Trading Post[/td][/tr] [tr][td]Haven[/td][td]Haven of Departure[/td][/tr] [tr][td]Heffner[/td][td]Heffner Camp[/td][/tr] [tr][td]Hortek[/td][td]Jungle of Hortek[/td][/tr] [tr][td]Jinners[/td][td]Jinners Camp[/td][/tr] [tr][td]Kampel[/td][td]Kampel Town[/td][/tr] [tr][td]Kashaylan[/td][td]Kashaylan[/td][/tr] [tr][td]Limon[/td][td]Kingdom of Limon[/td][/tr] [tr][td]Logar[/td][td]Logar[/td][/tr] [tr][td]Lyk[/td][td]Lyk[/td][/tr] [tr][td]Lyonsyde[/td][td]Lyonsyde Tribe[/td][/tr] [tr][td]MercenarySquare[/td][td]Obsidian Stronghold Mercenary Square.[/td][/tr] [tr][td]NorthernJanost[/td][td]Northern Janost Forest[/td][/tr] [tr][td]Obsidian[/td][td]Obsidian Stronghold Snoop[/td][/tr] [tr][td]ObsidianCastle[/td][td]Obsidian Stronghold Guild Castle[/td][/tr] [tr][td]ObsidianDalanisEnvoy[/td][td]Obsidian Stronghold Envoy[/td][/tr] [tr][td]Reifort[/td][td]Reifort Camp[/td][/tr] [tr][td]Rorazan[/td][td]Ancient Kingdom of Rorazan[/td][/tr] [tr][td]RuinsResearch[/td][td]Ruins Research Camp[/td][/tr] [tr][td]Salioca[/td][td]Salioca Basin[/td][/tr] [tr][td]Silverfall[/td][td]Silverfall[/td][/tr] [tr][td]SouthernJanost[/td][td]Southern Janost Forest[/td][/tr] [tr][td]Sarlo[/td][td]Sarlo[/td][/tr] [tr][td]Syrbal[/td][td]Syrbal Pass[/td][/tr] [tr][td]TergothenBay[/td][td]Torag Caravan[/td][/tr] [tr][td]TradeSquare[/td][td]Obsidian Stronghold Trade Square.[/td][/tr] [tr][td]Tundra[/td][td]Merdhin Tundra[/td][/tr] [tr][td]Varanas[/td][td]Varanas Snoop[/td][/tr] [tr][td]VaranasBridge[/td][td]Varanas Gates[/td][/tr] [tr][td]VaranasCastleEast[/td][td]Varanas East Guild Castle[/td][/tr] [tr][td]VaranasCastleWest[/td][td]Varanas West Guild Castle[/td][/tr] [tr][td]VaranasCentral[/td][td]Varanas Central Plaza[/td][/tr] [tr][td]VaranasClassHall[/td][td]Varanas Class Hall[/td][/tr] [tr][td]VaranasEast[/td][td]Varanas Lower City East[/td][/tr] [tr][td]VaranasGuildHall[/td][td]Varanas Guild Hall[/td][/tr] [tr][td]VaranasWest[/td][td]Varanas Lower City West[/td][/tr] [tr][td]VaranasWisdom[/td][td]Varanas Hall of the Eye of Wisdom[/td][/tr] [tr][td]WailingFjord[/td][td]Wailing Fjord[/td][/tr] [tr][td]Yrvandis[/td][td]Yrvandis Hollows[/td][/tr] [tr][td]-[/td][/tr] [tr][td]-- HOUSEMAIDS[/td][/tr] [tr][td]HarfTradingPostHousemaid[/td][td]Harf Trading Post Housemaid[/td][/tr] [tr][td]HeffnerHousemaid[/td][td]Heffner Housemaid[/td][/tr] [tr][td]LogarHousemaid[/td][td]Logar Housemaid[/td][/tr] [tr][td]ObsidianNorthHousemaid[/td][td]Obsidian Stronghold Housemaid[/td][/tr] [tr][td]TundraHousemaid[/td][td]Merdhin Tundra Housemaid[/td][/tr] [tr][td]WailingFjordHousemaid[/td][td]Wailing Fjord Housemaid[/td][/tr] [tr][td]-[/td][/tr] [tr][td]-- OTHERS[/td][/tr] [tr][td]Butterflies[/td][td]Butterflies Daily Npc[/td][/tr] [tr][td]DemostrationBattle[/td][td]Demonstration Battle[/td][/tr] [tr][td]DoD[/td][td]Dungeon of Dalanis[/td][/tr] [tr][td]GoblinMines[/td][td]Goblin Mines[/td][/tr]
Features:
  • Uses an algorithm to find the shortest path to the destination.
  • Knows if major hubs have been visited so can avoid unvisited nodes. So it wont try to go to Dalanis via Rorazan if you haven't visited Rorazan, for example.
  • If Recall isn't on cooldown it can use a transport skill, if it needs to, to get to the destination. This includes if you are not near a node point.
  • Knows about automatically available links such as Reifort to Ayren, so can find paths to destinations you haven't visited. For example, if you have a new character that has the Reifort Transport skill, it could still find a path to Dalanis, even if you haven't unlocked Obsidian yet.
  • Designed to be easily maintained. In most cases all you have to do is add an entry in the 'nodeList' and 'optionString'.
Hope you enjoy it.
Attachments
userfunction_travelTo.lua
Version 3.20
- Added: Kashaylan
- Added: A few housemaids
- Fixed: Bugs in hublist
- Added: functions to add nodes and links
- Added: Option to return a boolean instead of error if a failure occurs.
- Changed: On entering DoD it now sleeps instead of erroring giving the user the option to enter manually and then resume.
(37.9 KiB) Downloaded 423 times
  • 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

BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: Rock5's travelTo userfunction

#2 Post by BillDoorNZ » Tue Jun 11, 2013 3:18 pm

nice work (as always) rock ;)

dx876234
Posts: 188
Joined: Sat Jul 24, 2010 6:13 am

Re: Rock5's travelTo userfunction

#3 Post by dx876234 » Wed Jun 12, 2013 1:57 am

For us still stuck with "old" micromacro this doesnt work, among other things u use the bit32 which is a Lua 5.2 feature.

-dx

dx876234
Posts: 188
Joined: Sat Jul 24, 2010 6:13 am

Re: Rock5's travelTo userfunction

#4 Post by dx876234 » Wed Jun 12, 2013 2:19 am

For 5.1 users I found a backport http://smbolton.com/lua/lbitlib-5.2.0-alpha-backport1.c, I've made an .dll of it and tested and it works flawlessly.

-dx

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

Re: Rock5's travelTo userfunction

#5 Post by rock5 » Wed Jun 12, 2013 2:31 am

Well if you are using an old MM and old bot on an old client then you should use an old worldtraveler userfunction. Getting this version to work with an old client is probably not a good idea as a lot of the links have changed.

My logic was- "The links are updated for 6.0.0. If you are using 6.0.0 then you are using the latest bot. If you are using the latest bot then you should be using the latest MM.".
  • 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

dx876234
Posts: 188
Joined: Sat Jul 24, 2010 6:13 am

Re: Rock5's travelTo userfunction

#6 Post by dx876234 » Wed Jun 12, 2013 2:57 am

Lol I normally agree but having issues w. compiling addons for Lua 5.2 like SQL interface, so until thats done Im stuck backlevel.

-dx

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

Re: Rock5's travelTo userfunction

#7 Post by rock5 » Wed Jun 12, 2013 4:03 am

Well it at least you have the skill to easily modify it to work with your setup.
  • 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

artosaari
Posts: 15
Joined: Sat Mar 16, 2013 7:59 am

Re: Rock5's travelTo userfunction

#8 Post by artosaari » Wed Jun 12, 2013 7:19 am

Thx a lot for this usefunction, everything works fine for me except for teleporting in Varanas. I get this error
2:14pm - ...ro/scripts/rom/userfunctions/userfunction_gotoportal.lua:130: attemp
t to concatenate local '_dest' (a nil value)

I am running MM1.3 with bot rev 758 and of course I got your gotoportal userfunction.

thx so far

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

Re: Rock5's travelTo userfunction

#9 Post by rock5 » Wed Jun 12, 2013 7:23 am

artosaari wrote:everything works fine for me except for teleporting in Varanas
Teleporting from where, to where?
  • 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

artosaari
Posts: 15
Joined: Sat Mar 16, 2013 7:59 am

Re: Rock5's travelTo userfunction

#10 Post by artosaari » Wed Jun 12, 2013 7:26 am

Varanas Bridge to Varanas Central

I've just tried the other Varanas portmaids, works fine, it's just the Bridge porter who causes problems.

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

Re: Rock5's travelTo userfunction

#11 Post by rock5 » Wed Jun 12, 2013 8:17 am

artosaari wrote:I've just tried the other Varanas portmaids, works fine, it's just the Bridge porter who causes problems.
That's because I added custom functions for VaranasBridge, to add the pre option "I want to go to somewhere else", for newby characters and I didn't use the right strings for my travel function properly.

All fixed. I also added a better error message if the wrong strings are used again. That error message wasn't very helpful.

Now at beta 2.
  • 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

Buster99
Posts: 69
Joined: Fri Nov 25, 2011 9:27 am

Re: Rock5's travelTo userfunction

#12 Post by Buster99 » Wed Jun 12, 2013 10:25 am

Using MM 1.03 and latest Revision 758 and beta 2 version of userfunction but getting errors...here is error from Frontline trying to go Silverfall:

"...userfunction_travelTo.lua:287: Invalid string option name: Heffner nil"

I have tried going from Silverfall to VaranasCentral and get similar error:

"...userfunction_travelTo.lua:287: Invalid string option name: Varanas nil"

Ideas?

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

Re: Rock5's travelTo userfunction

#13 Post by rock5 » Wed Jun 12, 2013 10:42 am

Sorry, misspelt a variable with that new error message I just added.

Now beta 3.
  • 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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's travelTo userfunction

#14 Post by rock5 » Wed Jun 12, 2013 10:52 am

I just thought I should say why I release things with errors.

The way I see it, I could spend a lot of time testing and making sure code is perfect before releasing it but then I'd probably eventually get fed up with the bot and leave. Or I could do what I love best, programming, and let you guys do the testing. It's also easier to test and find bugs if a lot of people use the code during normal usage than it is for me to try and do everything that all the users do.

Just thought I'd put that out there so in the future so you'll why I put thing out with such blatant errors. :)

Cheers.
  • 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

Buster99
Posts: 69
Joined: Fri Nov 25, 2011 9:27 am

Re: Rock5's travelTo userfunction

#15 Post by Buster99 » Wed Jun 12, 2013 11:06 am

Understood and agree. Don't mind being a tester at all. Your work is MUCH appreciated!

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

Re: Rock5's travelTo userfunction

#16 Post by lisa » Thu Jun 13, 2013 12:31 am

rock5 wrote:I just thought I should say why I release things with errors.

The way I see it, I could spend a lot of time testing and making sure code is perfect before releasing it but then I'd probably eventually get fed up with the bot and leave. Or I could do what I love best, programming, and let you guys do the testing. It's also easier to test and find bugs if a lot of people use the code during normal usage than it is for me to try and do everything that all the users do.

Just thought I'd put that out there so in the future so you'll why I put thing out with such blatant errors. :)

Cheers.
Couldn't agree more, generally takes me 10-15 mins to write up some new code and 2-3 hours of testing to make sure it hasn't broken anything else.

I'm thinking of making that quote my new signature ;)
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: Rock5's travelTo userfunction

#17 Post by rock5 » Thu Jun 13, 2013 2:18 am

Oooh. Wow. :oops:
  • 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

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Rock5's travelTo userfunction

#18 Post by kenzu38 » Sat Jun 15, 2013 1:58 pm

Nice, been looking forward to this.

Thanks a lot!

turbobay
Posts: 44
Joined: Wed Jul 31, 2013 7:20 pm

Re: Rock5's travelTo userfunction

#19 Post by turbobay » Thu Aug 22, 2013 4:50 pm

Thanks for this nice userfunction.
I tried it today as it seems very handy, but i get stuck once i rech my destination.
Im my case i go to "Haven" and want to continue with next waypoint, but nothing happens.
The bot does not end, nor does it continue with my waypoints.

Code: Select all

<!-- # 63 --><waypoint x="5313" z="-3936" y="60">	</waypoint>
<!-- # 64 --><waypoint x="5284" z="-3907" y="60">	
travelTo("Haven")
<!-- waitForLoadingScreen() -->
</waypoint>
<!-- # 65 --><waypoint x="28502" z="3465" y="295">	</waypoint>
<!-- # 66 --><waypoint x="28462" z="3743" y="251">	</waypoint>

Code: Select all

Wir gehen zum Wegpunkt #63, (5313, -3936)
Wir gehen zum Wegpunkt #64, (5284, -3907)
Teleporting to "Ich m├Âchte zu den Toren von Varanas." via npc Lyeve
Wir versuchen den NPC Lyeve zu finden:
Der NPC 'Lyeve' wurde erfolgreich ausgewählt. Wir öffnen das Dialogfenster.
Moving to Varanas Snoop
Teleporting to "Hafen des Aufbruchs" via npc Sturobold
Wir versuchen den NPC Sturobold zu finden:
Der NPC 'Sturobold' wurde erfolgreich ausgewählt. Wir öffnen das Dialogfenster.
You have reached your destination
Is there anything missing from my part ?

edit: When i manually teleport back to Varanas, the bot just tries to move to the next waypoint....although it is on a different continent, so any idea why it gets stuck ?

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

Re: Rock5's travelTo userfunction

#20 Post by rock5 » Fri Aug 23, 2013 2:00 am

You seem to have worked out your first problem. You shouldn't use waitForLoadingScreen().

The output shows that it correctly reached the destination. If you are having a different problem with the Varanas snoop then please provide the output for that problem. I suspect, though, that that character can't teleport to Haven.
  • 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

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests