Noobbotter's World Traveler 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.
Message
Author
noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Noobbotter's World Traveler Userfunction

#1 Post by noobbotter » Fri Sep 21, 2012 2:00 pm

World Traveler userfunction Release 1.4 Update!

BIG Thanks to Lolita for making some updates and changes (signified with ** below)
Version 1.4 update:
** Added transport to/from Merdhin Tundra. Keyword "Tundra"
** Fixed Ayren <-> Obisian infinite loop

Other fixes added:
** Added transport to/from Chrysalia. Keyword "Chrysalia"
** Added transport to/from Ancient Kingdom of Rarazan. Keyword "Rorazan"
** Added direct transport to/from Goblin Mines. Keyword "GoblinMines"
** Fixed Ayren caravan teleport node
** Fixed DalanisObsidianEnvoy node, you should now go to SJF, NJF... as intended, instead of runing to DoD
** Edited Heffner Camp Teleports.

Version 1.2 update fixed 2 areas that had issues transporting:
Latest Updates:
-- Fixed transport code from Heffner to Varanas.
-- Fixed endless loop when trying to go to Silverfall from Obsidian Stronghold

Added in V 1.1 is support for "DoD", so you can now use takemeto("DoD") from any transport NPC and your bot will take you all the way into the sewers to the entrance of DOD. One caveat to this is you must have the transport NPC inside the sewers available. It's too risky to send a bot running all the way through the sewers to get to DoD. However, if I get some feedback saying you'd like to have running through as an option, then I'll look into adding that on the next revision.

About the userfunction:
World Traveler will allow a bot to use transports to go from one NPC location to any other NPC location throughout Tabborea with one simple line of code added to your waypoint file.

For Example, if I wanted my bot to go from Xaviera's Front Line camp (after finishing up butterflies) and go to Silverfall to do goblin games, then at the last waypoint of my butterflies, I would insert the following code:

Code: Select all

takemeto("Silverfall");
followed by the line to load my goblin games waypoint.

The bot would then utilize the nearest Transport NPC to begin transporting from NPC to NPC until it got to it's final destination of Silverfall. I have used mathematical zones so the bot knows which NPC it needs to transport to for the most efficient path to your destination. With the above example, the bot would go from Frontline -> Jinner's -> Ruins Research -> Varanas -> Silverfall. After arriving at the final NPC, it would continue the original waypoint file where I left off, so it would load the waypoint for Goblin Games.

Example 2: If you want to go from Class Hall in Varanas to Tergothen Bay, you would use takemeto("TergothenBay"); and the bot would take Class Hall -> Varanas Gates -> walk to Snoop at Varanas -> Obsidian Stronghold Snoop -> walk to Battle Square NPC -> Mercenary Square -> walk to Dalanis Envoy -> Dalanis -> walk to Dalanis Snoop -> Southern Janost -> Northern Janost -> Limo Desert -> Land of Malevolence -> Tergothen Bay.

This userfunction requires Rock5's latest GoToPortal userfunction (v2.01) found here: http://www.solarstrike.net/phpBB3/viewt ... gotoportal

To use the function in your code, simply add

Code: Select all

takemeto("keyword")
Here is a list of locations you can transport to and the "keyword" to use in your script to go to that location:

Code: Select all

Location Description	                                     Keyword
Snoop at Logar	                                                     "Logar"
Snoop at Varanas in Silverspring	                             "VaranasSnoop"
Transporter at Varanas Bridge	                                     "VaranasBridge"
Varanas Lower City West	                                     "VaranasWest"
Varanas Class Hall	                                             "VaranasClassHall"
Varanas Lower City East	                                     "VaranasEast"
Varanas Central Plaza	                                             "VaranalCentral"
Varanas Guild Hall	                                                     "VaranasGuildHall"
Hall of the Eye of Wisdom in Varanas	                     "HallofEyeofWisdon"
Silverfall in the Aslan Valley	                                     "Silverfall"
Snoop at the Harf Trading post	                             "HarfTradingPost"
Dragonfang Ridge or "Lyk"	                                     "DragonfangRidge"
Ayren Caravan in Sascillia Steppes	                             "AyrenCaravan"
Reifort Camp in Sascillia Steppes	                             "Reifort"
Snoop at OS, edge of Dust Devil Canyon	                     "ObsidianStronghold"
Battle Square at Obsidian Stronghold	                     "BattleSquare"
Trade  Square at Obsidian Stronghold	                     "TradeSquare"
Glory Square at Obsidian Stronghold	                             "GlorySquare"
Crafting Square at Obsidian Stronghold	                     "CraftingSquare"
Mercenary Square at Obsidian Stronghold	                     "MercenarySquare"
The envoy to take you to Dalanis from Obsidian              "ObsidianDalanisEnvoy"
Abandoned Fortress at Ravenfell	                             "AbandonedFortress"
Boulderwind Village in Weeping Coast	                     "WeepingCoast"
Green Tower in the Savage Lands	                             "SavageLands"
Titan's Hill Camp at the Aotulia Volcano	                     "AotuliaVolcano"
The envoy in Dalanis to take you to Obsidian Stronghold   "DalanisObsidianEnvoy"
Dungeon of Dalanis                                                    "DoD"
Snoop outside Dalanis in Thunderhoof Hills	                      "Dalanis"
Southern Janost Forest	                                             "SouthernJanost"
Northern Janost Forest	                                             "NorthernJanost"
Limon Desert	                                                     "LimoDesert"
Land of Malevolence	                                             "LandofMalevolence"
Redhill Mountains	                                                     "RedhillMountains"
Tergothen Bay	                                                     "TergothenBay"
Heffner Camp at Coast of Opportunity	                     "Heffner"
Lyonsyde camp at CoO	                                              "Lyonside"
Desert Investigation Post at CoO	                             "DesertInvestigation"
Fanger's Makeshift Camp at CoO	                             "FangersMakeshift"
Ruins Research camp in Xaviera	                             "RuinsResearch"
Jinner's Camp in Xaviera                              	             "Jinners"
Front Line Camp in Xaviera	                                     "FrontLine"
NPC for Butterfly and Dogmeat Dailies                           "Butterflies"
Ancient Kingdom of Rorazan	                                     "Rorazan"
Yrvandis Hollows (Dwarf zone)                                     "Yrvandis"
Haven of Departure (Elf zone)                                      "Haven"
There are some locations you can go to that aren't listed above. To see the keyword for them, see lines 49 - 96 in the userfunction file.

Some Notes:
I have not yet tested the Elven and Dwarf Class starting zones but the "should" work.
World Traveler supports other languages, but you must use the keywords mentioned above.
Keep in mind the more you transport, especially in certain areas, the more likely your computer will run out of memory and the game may crash. Just remember, it's not this userfunction that causes that.

Feel free to try out this function and comment on any areas that you may find that don't work as expected. Comments are welcome. I hope the community finds this function useful. I think it will make it much easier to link any waypoints together so you can have your bot do all it's daily items in a row using this to move from one area to the next between waypoint files. It's also handy to use from rom/bot command line to go from one place to another.

Thanks goes out to Rock5 for his help in getting this working properly! Also to Lisa and BillDoorNZ for their help in my learning some functions. And of course, a big thanks to Lolita for learning how this works and doing some updates.

I hope to continue this function by eventually adding more waypoints. Possible future waypoints include all instances, and some housemaids. Maybe even a function to go to the "nearest" housemaid.

--NoobBotter
Attachments
userfunction_worldtraveler.lua
World Traveler V.1.4
(69.83 KiB) Downloaded 338 times
Last edited by noobbotter on Wed Mar 20, 2013 9:38 am, edited 9 times in total.

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

Re: Noobbotter's World Traveler Userfunction

#2 Post by rock5 » Fri Sep 21, 2012 3:27 pm

Sounds very exciting. I'll be sure to check it out.
  • 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: Noobbotter's World Traveler Userfunction

#3 Post by Ego95 » Fri Sep 21, 2012 3:56 pm

Like rock said, this is a great idea, i'll test it as soon as possible.

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: Noobbotter's World Traveler Userfunction

#4 Post by noobbotter » Fri Sep 21, 2012 11:48 pm

Ok, I'm having some weird issues with this and I'm sure one of you more experienced people will be able to help find the issues a lot quicker than I can.

The transports are hit and miss. Sometimes the first transport goes ok and sometimes, follow-on transports will work. One of the problems is that the script gets caught in a loop after it gets to where it's supposed to go, I'm assuming it's stuck because it's not seeing the mynode_current == mynode_dest (Line 167). This is where It's supposed to stop the repeat, but doesn't seem to.

I also saw my bot go back and forth between snoop and the NPC into Varanas 2 times before finally going into Varanas City. Not sure why it did that. I'm going to post what I have so far to see if anyone can decipher what I've done and where my problems may be.

There are still some waypoints I need to put in the code (Merchant Square to Dalanis Envoy and Envoy in Dalanis to Snoop in Dalanis) so I've been doing all my testing in Logar, Varanas, Varanas City, and Silverfall. Curious to see what you find out. If you can help me get this working properly, that would be awesome for the whole community. Let me know if you have any questions.

Also, I haven't gathered the info for the new lvl 72 zone, or for the Dwarf race zone, or for the Elves' zone so if anyone can find that, that would help. The info I need includes the Transport NPC Name, ID, and Location (actually, the locations I use are the locations of my player when he's standing net to the NPC), The zone ID, and what the transport text options are when you use them. Once I get that info, I can add those NPCs to the table.
Attachments
userfunction_worldtraveler.lua
World Traveler Userfunction... Still under development.
(46.31 KiB) Downloaded 205 times

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

Re: Noobbotter's World Traveler Userfunction

#5 Post by rock5 » Sat Sep 22, 2012 2:33 am

I was interested in how you would work out the path. Clever, splitting areas into ranges of numbers and deciding based on range. I often thought about doing such a function but could never think of a way to work out the path. Well done.

Firstly, this file is obviously not the last one you tested because it doesn't work as is. "local transfunc = ..." is before the node functions so the nodes aren't defined yet so transfunc ends up empty. Si I had to put that at the end of the file. Then the main function didn't work because it had to be after transfunc. After I moved it there it worked. If you want it at the top of the file you could make a mini function eg. loadtransfunc(). And then at the top of the main function use

Code: Select all

if transfunc == nil then loadtransfunc() end
You would still need to declare transfunc local outside the function.

Just picked up a typo. The Node9 function was named Node8.
noobbotter wrote:The transports are hit and miss. Sometimes the first transport goes ok and sometimes, follow-on transports will work. One of the problems is that the script gets caught in a loop after it gets to where it's supposed to go, I'm assuming it's stuck because it's not seeing the mynode_current == mynode_dest (Line 167). This is where It's supposed to stop the repeat, but doesn't seem to.
I didn't see this happen so can't comment.
noobbotter wrote:I also saw my bot go back and forth between snoop and the NPC into Varanas 2 times before finally going into Varanas City. Not sure why it did that. I'm going to post what I have so far to see if anyone can decipher what I've done and where my problems may be.
Well, I did have an issue when trying to go to the BattleSquare. It ran back and forth between the snoop and Maylee. It was finding the snoop as the closest teleporter and then going back to Maylee. It never detected Maylee. I think it's because your code finds the first match and uses that. I couldn't see code that looked for the closest match. You can use 'distance(x1,z1,y1,x2,z2,y2)' to calculate distance. Which brings up the point, you need to learn the games coordinate system. As long as you always follow your system there wont be an issue but to avoid confusion in the future for others, in the game it's x, z, y (y being up/down) not x, y, z.

Now, I'll just go through the file and point out a few things.

- First thing is that language is an issue. We will have to address that eventually as this will only work for English players.
- "how do I check for the table before doing this?" I'm not sure why you need to as in that file that table will always exist. But to check for an empty variable you do "if variable == nil". If you want to check for an empty table you use "if #variable == 0". That only works for an indexed table though, ie. a table with items numbered from 1 onwards. There is also a way to tell if a non indexed table is empty but I don't know the command off the top of my head.
- You don't need to do "if (v) then" in the few places you used it. "for k,v in pairs" will always return a key and a value. k and v will always have a value inside the loop. The only way (v) could return false is if v actually equaled false, which is not possible in this case.
- Line 106. 'obj' should be declared local before the for loop.
- "what do I need to do if the bot actually has to move for 3, 4 or 7 seconds to get there?". You are using the moveTo function. It wont return control until it reaches the destination. So you don't have to worry.
- "do i need a rest in there or will the NPCTransport function take care of it?" as you can see, NPCTransport takes care of everything. Talking about NPCTransport, you should mention that the gotoportal userfunction is a requirement for this file.

I think that will do for now. I'll hold back on helping you collect more zone data until we've done just a bit more work on this.
  • 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

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: Noobbotter's World Traveler Userfunction

#6 Post by noobbotter » Sat Sep 22, 2012 8:05 am

Thanks for the information. I've fixed my y and z mixup so now the locations are X, Z, Y.

I fixed some other things as well but I new get a weird problem. Not every time, but sometimes when it attempts to transport, I get "Now calling transport function Node2 onLoad error: ...pts/rom/userfunctions/userfunction_worldtraveler.lua:79: attempt to compare nil with number" I've seen that on several different attempts. Once it was on a first transport attempt, once it was on the second transport attempt. Once it was ine the Node2 function, and once it was in the Node4 function. I'm thinking that for some reason, the myzone_dest value isn't getting passed into the transfunc function sometimes, because that's about the only thing that gets compared to a number in that function, but I can't figure out why it does that.

One other thing I think I noticed today... I went to transport from on Varanas City location and it didn't work, I looked at the NPC name and it was different than what was in the table. I fixed my table, and then later, It did the same thing again... I think the Names of some of the NPCs (Bareve, Noreve, Dieve, etc...) change which location they're posted at. I might have to figure out a dynamic way of figuring out which NPC is at the specific locations.

I'll post my changes I've made and we can see if you can see any other issues.

By the way, I know the language thing is going to be an issue. If anything, if someone were to translate the language specific changes for me, then I could add more fields to the table and make language an option so it will use the proper fields based on language. Future release for that, maybe.
Attachments
userfunction_worldtraveler.lua
slightly updated testing version of word traveler userfunction.
(45.22 KiB) Downloaded 210 times

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

Re: Noobbotter's World Traveler Userfunction

#7 Post by rock5 » Sat Sep 22, 2012 9:02 am

noobbotter wrote:Not every time, but sometimes when it attempts to transport, I get "Now calling transport function Node2 onLoad error: ...pts/rom/userfunctions/userfunction_worldtraveler.lua:79: attempt to compare nil with number"
That could happen if you type the destination name wrong. So you should probably have something like this at the top of the main function.

Code: Select all

if myzone_dest == nil then 
    return
end
Which reminds me, I forgot to tell you how to do pattern matching with lower cases. To match a partial name and ignore case you would do

Code: Select all

if string.find(string.lower(v.nodename), string.lower(mynode_dest), 1, true) then
  • 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: Noobbotter's World Traveler Userfunction

#8 Post by rock5 » Sat Sep 22, 2012 9:40 am

noobbotter wrote:I think the Names of some of the NPCs (Bareve, Noreve, Dieve, etc...) change which location they're posted at
I've never seen that happen, at least not with the bridge, central plaza or class hall ones.
noobbotter wrote:If anything, if someone were to translate the language specific changes for me, then I could add more fields to the table and make language an option so it will use the proper fields based on language.
The more you can do without user intervention the better. The npc names for example can easily be gotten from the ids using GetIdName. Actually there is no need to even store the npc names in the table. Just whenever you need the name, get it with the id. The option are harder. There are ways to get them too but it would be very time consuming. For instance to get the local name for Logar you could use RoMScript("TEXT('ZONE_ROGSHIRE')"). We could find strings that will work for each selection but considering that different teleporters list the same place with different names sometimes, it could take awhile. If you want to know how I found that string check out these tools.
http://www.solarstrike.net/phpBB3/viewt ... 258#p22258
The ultimate would be if users could use the names of the destinations in their own language and did a match on 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

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: Noobbotter's World Traveler Userfunction

#9 Post by noobbotter » Sat Sep 22, 2012 3:13 pm

Thanks Rock5. I've taken the names out of the table and get names from the found objects to initiate the Transport chat. That works good.

I also went back through Varanas and fixed which NPCs are in which area, so if they move on me again, I'll know it.

The last couple tests I ran it seems to work ok now, and the function stops after the bot is at the final destination, so that part is good. I'm going to add the lowercase string matching so you can enter where you want to go in any case, then I'm going to do some more testing. If all goes well, I should have my working beta released soon.

I think I know the easiest way to make this language compatible, but it's still going to require someone that knows the languages to translate some stuff for me (unless everything translates over properly in Google for me). I have no idea if it does or not. I'm not even sure what all other languages the game comes in. If it's more than 2 or 3, making it language independent will really be a pain and if I do get that done, it won't be in the beta release.

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: Noobbotter's World Traveler Userfunction

#10 Post by noobbotter » Sun Sep 23, 2012 9:06 am

New working Beta release is ready!

I've updated the first post with the updated userfunction file for download.

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

Re: Noobbotter's World Traveler Userfunction

#11 Post by Ego95 » Sun Sep 23, 2012 10:08 am

At this time, this userfunction only supports English language clients.
Why doesn't it works with other languages? I think the zone id and the npc id has to be the same. Do i have have to change things like

Code: Select all

NPCTeleport(cur_Npc_ID, "Glory");
(example) to the german translation?

Code: Select all

NPCTeleport(cur_Npc_ID, "Glorie");
Do you think it should work then? I need to test it out :D

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: Noobbotter's World Traveler Userfunction

#12 Post by noobbotter » Sun Sep 23, 2012 10:22 am

Exactly. within each Node# function the text string for where to transport would have to be translated.

If you would be able to provide translations for each of those, I could then modify it to support both English and your language based on the client language. Same goes with any other language. If someone provides the translations for their language I'll add support for that language.

Just remember, I only need a keyword for when you click an NPC and they show options of where to transport to, a keyword needs to be specific to that transport location.

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

Re: Noobbotter's World Traveler Userfunction

#13 Post by rock5 » Sun Sep 23, 2012 10:27 am

I really want this not to require language files. It's a great enough project that I think the extra effort is worth it.

My advice is, don't start working on adding support for language files because I'm sure to step in sooner or later with a solution that wont require them, then that work would have been wasted.

I've been busy working on the next massive bot commit or I would have already done something. I'll take a break from it and have another look at you file and see what I can come up with.
  • 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

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: Noobbotter's World Traveler Userfunction

#14 Post by noobbotter » Sun Sep 23, 2012 10:50 am

I was thinking for my language support, I would add a separate table with translations for the "keywords", so depending on which client, I would use the specific language entry from the table for each keyword. But if you've got something larger going on with the addon hat might address that on it's own, then don't worry about helping me with language on this one. Thanks though. :)

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

Re: Noobbotter's World Traveler Userfunction

#15 Post by rock5 » Sun Sep 23, 2012 2:49 pm

Ok, here is what I have. You still have to use the destination codes but everything else should work language independent.

What I did;
  • - Added a table of dialog option strings. Most of them are just zone names so were easy. Some were not. Hopefully they all work.
    - Added a small function that gets the option string from the game given the option name as an argument.
    - I left all the options the same but converted them to function calls eg.

    Code: Select all

    NPCTeleport(cur_Npc_ID, "Logar");
    became

    Code: Select all

    NPCTeleport(cur_Npc_ID, TEXT("Logar"));
    - The only exception was the "Please send me" options as you can't have 2 options with the same name. I named them "ToDalanis" and "ToObsidian".
Other minor changes I made;
  • - Moved

    Code: Select all

    	if myzone_dest == nil then
    		return
    	end
    to after it looks myzone_dest in the table. The idea is not to see if the user used a nil destination but that they entered a valid value and that it was found in the table. If it wasn't found then it can't continue.
    - I removed a "return" as it was stopping the function from continuing and finding another npc when the first was too far.
    - Added a carriage return to "Destination reached".
There is still a lot of improvements that can be made but that's all I want to do for now. I still have this big bot commit to get ready.

I nearly forgot. I also added option strings for Yrvandis Hollows (the dwarf place) and Haven of Departure (The Elf place). You'll need to add them to the database, node functions and options. This is what I can tell you.
  • - Yrvandis Hollows. Via Varanas Snoop. Option string "Yrvandis". The npc there is Snoop. Zone is 31. Coords are 2270, -409, 1554. Return option is Varanas.
    - Haven of Departure. Via Varanas Snoop. Option string "Haven". The npc there is Snoop. Zone is 12. Coords are 28492, 3465, 312. Option to return is Varanas.
Keep up the good work.
Attachments
userfunction_worldtraveler.lua
(50.87 KiB) Downloaded 222 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

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: Noobbotter's World Traveler Userfunction

#16 Post by noobbotter » Tue Sep 25, 2012 7:22 am

That's great, Rock5. I've got those zones added, but just wondering... What is the ID of Snoop in those areas (Yrvandis and Haven)? I've noticed Snoop has different IDs in different areas.

Other than that, things seems pretty well. I've got the case insensitive matching for the keywords implemented and that seems to be working good. Once I get the Snoop IDs in the table, and check for any other bugs, I'll release a final version 1.

I'm wondering if I should add some other common waypoints in Varanas, maybe as an example of how to add some, to places like Housemaid in Varanas, Mailbox in Central Plaza, AH, Malatina, etc. I was thinking about how to do it today and for each of those points, If I don't have the bot run back to the Transport NPC before going to another non-transport location, then it could get really complicated to go from one to another, i.e., Malatina to vendor to AH to mailbox. I guess that's something I'll work on in my spare time to figure out the best way of doing it.

Side question... If you're running a waypoint file and one of your waypoints calls another waypoint file, when that second waypoint file completes, it won't go back to the first one where it left off will it? Like functions do? What if a function were to call a waypoint? would everything wait until that wayppoint completes before going to the next step in the function? I'm thinking if the function was part of a userfunction, it would, because userfunctions run independently of waypoints? Or would the function continue running as soon as it finishes loading the waypoint?

Thanks.

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

Re: Noobbotter's World Traveler Userfunction

#17 Post by rock5 » Tue Sep 25, 2012 8:31 am

noobbotter wrote:That's great, Rock5. I've got those zones added, but just wondering... What is the ID of Snoop in those areas (Yrvandis and Haven)? I've noticed Snoop has different IDs in different areas.
I noticed you were using the same id for all snoops so didn't get the id. I thought maybe you were comparing the names instead of the ids which would be easier wouldn't it?. I can go and look, though, if you like.
noobbotter wrote:I'm wondering if I should add some other common waypoints in Varanas, maybe as an example of how to add some, to places like Housemaid in Varanas, Mailbox in Central Plaza, AH, Malatina, etc.
I wouldn't bother. There are too many places in the world that aren't transporters for you to add them all. Just having a transporter to transporter userfunction like this is all you need. Imagine starting all your waypoints at the closest teleporter. Then all you have to do to start that waypoint file is go to go to the nearest teleporter, teleport to the correct teleporter and start the waypoint file. Trust me, as it is, is a godsend.
noobbotter wrote:Side question... If you're running a waypoint file and one of your waypoints calls another waypoint file, when that second waypoint file completes, it won't go back to the first one where it left off will it? Like functions do? What if a function were to call a waypoint? would everything wait until that wayppoint completes before going to the next step in the function? I'm thinking if the function was part of a userfunction, it would, because userfunctions run independently of waypoints? Or would the function continue running as soon as it finishes loading the waypoint?
Well yes and no. A waypoint file is not a function. You load a waypoint file using loadPaths. That is a function and it completes before the bot continues. You only have one waypoint table in memory "__WPL" and it changes when you load another waypoint file. So it wont go back to a previous waypoint file. But there is one thing you need to be careful of. When it executes the code at a waypoint, it turns it into a function and then runs it. This function will always complete. Doing a loadPaths does not stop that function from completing. The same is true when you change the current waypoint index. Just because you use"__WPL:setWaypointIndex(1)" doesn't mean it will stop executing the code at that waypoint.

So to better explain what happens when you do loadPaths, you have a waypoint file loaded into __WPL. At one of the waypoints there is a loadPaths. The bot makes this waypoint into a function and runs it. The loadPaths executes and replaces all the waypoints in __WPL, finds the nearest waypoint, runs the onload if it has one, then returns control to that function. If there is any other code after the onload it will execute, for instance you could set the waypoint index after loading the file. When that function ends then it continues to the next waypoint of the new file.

You are not going to have a problem with your userfunction, firstly because it it a userfunction not a waypoint file and secondly because it will return control to the waypoint file that called it after it has done it's thing.

Or, the easy answer is, yes "the function continues running as soon as it finishes loading the waypoint". :)
  • 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

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: Noobbotter's World Traveler Userfunction

#18 Post by noobbotter » Tue Sep 25, 2012 10:50 am

So my best bet for me to be able to use multiple waypoints would be to do something like the following (Using Goblin Games as an example):

First, modify the waypoint to start with a takemeto("area") command to take me to the correct area (for goblin games waypoint, I would have takemeto("Silverfall").
Second, add waypoints to walk from Silverfall Snoop to the Goblins NPC.
Third, run rest of waypoint file as normal.
Fourth, add waypoints to walk back to Snoop when complete.

If I did this to all my different waypoints I use, then no matter which one I call, it would run from any location because my character would already be at a transport NPC, and would end at a transport NPC.

Now, if we could get everyone that makes waypoints to modify all their waypoint files to start and end at the nearest transport NPC, then we'd all be good to go for running any waypoints in any order without a bunch of modifying.

Now to figure how I would actually call which waypoints I want to run in order, without modifying the end of the waypoint to say "now load this waypoint." I'm thinking something along the lines of a waypoints string (or table) in which, you would list which waypoints to run (in order) and then a function to call each of them in order.

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

Re: Noobbotter's World Traveler Userfunction

#19 Post by rock5 » Tue Sep 25, 2012 11:07 am

I particularly like the idea of starting waypoint files with takemeto functions. That way, like you said, because we are already at a tele npc, we can start any waypoint file without having to move first. As to existing waypoint files, it's just as easy to start with a togoblins waypoint file than editing the goblin file itself and it's the togoblins file that starts with a takemeto and ends at the goblins and loads the goblins file.

As to sequencing the files with some sort of list, I see that as more of a different project. Personally I just always add a variable at the top of the file that hold the next file to load, then it becomes easy to change the sequence by going through the files and changing the names. Also the problem of a file list sequence is how does it know which to load next if you have to restart? You could do various checks to decide which to load next but it would depend heavily on what those files do. So you could create a list and for that list come up with a set of checks to decide which to start with but then with a different list you would have to change it all again.
  • 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

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: Noobbotter's World Traveler Userfunction

#20 Post by noobbotter » Tue Sep 25, 2012 11:57 am

it's just as easy to start with a togoblins waypoint file than editing the goblin file itself
That's a good point. because then, if the original author releases an update, then you don't have to modify it.

Yes, sequencing files in a particular order wouldn't be a part of this Userfunction. That was just a side thought for something I'm going to do on the side to more efficiently run my bots through a daily regimen with less user interaction.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest