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
BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: Noobbotter's World Traveler Userfunction

#21 Post by BillDoorNZ » Tue Sep 25, 2012 2:29 pm

Was just catching up on this thread. Nice work! :)

One thing you may need to be aware of, is that there is a limit to the number of choice options that can appear in the teleport list. I can't remember if I saw a discussion about it here or somewhere else, but from memory the Varanas snoop has an issue with this as it can link to more than 8 locations :(

Obviously, this will cause problems for the players who do not have access to an option which is in the list. Simplest solution I could think of that doesn't require player customisation would be NOT to include that link in the varanas snoop and route players through other snoops.

I like the idea of all quests starting at a snoop :) I do something similar with my own customisations except mine works more along the lines of being able to run the player to the start location (npc etc). If you're planning on tacking the linking of multiple waypoints next, then I'd suggest you don't drive it via player lists, but instead use the players level and a list of quests. i.e. look at the players level, find what quests are available that they can do, select one and use your existing stuff to run the player to the starting snoop.

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

Re: Noobbotter's World Traveler Userfunction

#22 Post by rock5 » Wed Sep 26, 2012 12:28 am

I'd say it's not a problem of this userfunction if an option is missing, after all, options might be missing because the character hasn't visited the location yet and we have already established previously that we can't find out which options are available without actually visiting the npc. It will always be up to the user to only try teleporting to locations that character can actually get to. Probably though, there has to be some code added to deal with missing options. At the moment it just keeps trying and trying non stop.
  • 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

#23 Post by noobbotter » Mon Oct 15, 2012 11:16 pm

Hey Rock. I've got some updates done but I want to handle the varanas snoop (and possibly the same kind of check for all nodes) so that it will know if the option is available. How would I do a for loop to check all the options available to try for a match?

I thought I read somewhere that the "Next Page" option for that snoop would automatically be checked. Was that in an updated version of the gotoPortal function or something? Right now, I'm doing this for the Silverfall node which is on the second page for me:

Code: Select all

elseif (myzone_dest > 9999) then -- 10000 is Silverfall and Harf
	print("Now Transporting to Silverfall");
	NPCTeleport(cur_Npc_ID, TEXT("Silverfall"),"Next Page");
I added the Option for next page in there and it works... for me. If silverfall is on the first page for someone it won't work. Any thoughts? Thanks.

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

Re: Noobbotter's World Traveler Userfunction

#24 Post by rock5 » Tue Oct 16, 2012 6:20 am

Yes, support for the "Next Page" option has been added to the latest version of TeleportNPC, which is one of the gotoportal functions. So it checks all pages automatically.
  • 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

#25 Post by noobbotter » Tue Oct 16, 2012 7:21 pm

World Traveler Userfunction version 1.0 is finally ready. I have updated the first post of this thread with the description, the available waypoints, and the new file. Please feel free to try it out and comment or ask any questions you may have.

-- Noob Botter

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

Re: Noobbotter's World Traveler Userfunction

#26 Post by rock5 » Tue Oct 16, 2012 10:56 pm

So how does it deal with missing teleport options and just general failure to teleport? Did you add any support for that or does it still just keep trying to teleport?
  • 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

#27 Post by noobbotter » Wed Oct 17, 2012 6:51 am

I didn't add any options for failure to teleport or for missing teleport options. I'm not sure exactly how to read the available teleport options. I'm sure I would write a far loop for each teleport option at the NPC and for each option, check for the TEXT string match. Just not sure how to do that. At the same time, if the NPC had a next page, it would have to select that and check the options there as well. If you can tell me how to read the available Teleport options, then I should be able to write that in.

I can look into adding some code so if it fails to teleport twice, it would break with a failure notice.

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

Re: Noobbotter's World Traveler Userfunction

#28 Post by rock5 » Wed Oct 17, 2012 7:09 am

You know NPCTeleport returns true or false if it succeeds so you could just change all the "NPCTeleport(....)" commands to "return NPCTeleport(....)". Then when you execute the function you can do something like

Code: Select all

if transfunc[match_current.zoneindex](myzone_dest, myzone_current, cur_Npc_ID) ~= true then
   error("Failed to teleport. Maybe missing teleport dialog option.")
end
You would also have to change the movement nodes to return true.
  • 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

#29 Post by noobbotter » Wed Oct 17, 2012 7:26 am

I looked at how your teleport function does that and kind of implemented similar code but didn't use the return true/false (not good with that kind of coding). What I did here seems to work. If it fails to teleport twice in a row, it will break the routine.
Attachments
userfunction_worldtraveler.lua
(54.94 KiB) Downloaded 173 times

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

Re: Noobbotter's World Traveler Userfunction

#30 Post by rock5 » Wed Oct 17, 2012 8:15 am

OK, that should work.

A couple of points though.

You have it doing a "break" if it fails. So it breaks from the loop then prints "Destination reached" which of course is not true because it failed. Also the function completes which means it will continue with the users code. So if a user has

Code: Select all

takemeto("destination")
loadPaths("waypointfile")
and the takemeto function fails then the character will be at the wrong location to start the waypoint file. Which means it will probably start running across country and probably run up against a wall or though some mobs and die. I don't think there is any other option but to make it error if it fails.

Also, looking at the end of the file, I see that you clear all the variables. This is not necessary as all locally declared variables only exist in that function and effectively disappear when the function completes. And I'm not even sure you are clearing the variables if you use "local" which is for declaring variables so you might actually be declaring new variables with a value of nil. You are certainly not clearing the variables that were declared in the "repeat" loop because they only exist in that loop.
  • 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

#31 Post by noobbotter » Wed Oct 17, 2012 2:16 pm

Good points. When I get home this evening I'll make some changes to fix those items. Thanks.

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

Re: Noobbotter's World Traveler Userfunction

#32 Post by noobbotter » Wed Oct 17, 2012 4:26 pm

Ok, Rock5, Take a look at this one. As a human I attempted to transport to Yrvandis and after it couldn't find it (tried twice) it errorred out and exited. Also, it never told me "Destination reached."

Question... I'm adding a waypoint from Dalanis to DoD. How do you get the text string you used for the language support, like:
ToDalanis = "SC_114777_1",

I need to get one for the transport guy just inside the dalanis sewers, and for the transport guy near the DoD entrance. Thanks.
Attachments
userfunction_worldtraveler.lua
Fixed errors on failure to teleport.
(54.67 KiB) Downloaded 172 times

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

Re: Noobbotter's World Traveler Userfunction

#33 Post by rock5 » Thu Oct 18, 2012 12:31 am

Looks good. When you update the first post don't forget to change the version number.

To get the text strings you need 2 tools which you can get here.
http://www.solarstrike.net/phpBB3/viewt ... 258#p22258

1 tool extracts files from the fdb files you find in the "Runes of Magic/fdb" folder and the other converts the language strings and allows you to search through it.

So this is how you do it.
  • 1. Open data.fdb with the FDB Extractor.
    2. Click on the "data" folder.
    3. Scroll down, select and extract a language file in your language. The language files are in the format of "string_##.db".
    4. Open the extracted file with the language converter. This will take a little time and will create and an xml file in the same location as the extracted file. In the future you can open the xml file with the converter to avoid conversion.
    5. Then you can use the converter to search for text strings.
  • 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

#34 Post by noobbotter » Thu Oct 18, 2012 7:22 am

Thanks Rock5. I got the tools and went through the procedure, but I'm not finding any text in there for the NPCs inside Dalanis sewers (115571 and 115572) that say "Please transport me." I was going to try one of the other texts it shows for those NPCs but didn't have time this morning before I had to leave for work. Maybe you know something I don't? I even compared/did the search for the Dalanis/obsidian envoys and saw the text selections you selected for those but couldn't find a similar one for these Dalanis Sewers NPCs.

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

Re: Noobbotter's World Traveler Userfunction

#35 Post by rock5 » Thu Oct 18, 2012 10:37 am

I found "Please transport me." easy enough. It's SC_115531_1. Don't let the ID throw you off. With a generic term such as this they probably decided not to create another text string with the exact same words but just use that one instead.
  • 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

#36 Post by noobbotter » Thu Oct 18, 2012 12:05 pm

Yes, you're right. I was wondering why I only found one instance of that text. I tried that and it works. I made a few more little fixes and it feels pretty good now. I just posted version 1.1 on the first post of this Topic.

User avatar
lolita
Posts: 139
Joined: Thu Oct 20, 2011 5:39 am
Location: Serbia

Re: Noobbotter's World Traveler Userfunction

#37 Post by lolita » Thu Nov 08, 2012 4:15 am

i get this error when i try to teleport from dalanis to varanas

Code: Select all

scripts\rom/bot.lua:505: onLoad error: ...pts/rom/userfunctions/userfunction_worldtraveler.lua:721: attempt to call global 'NPCTeleport' (a nil value)
or

Code: Select all

scripts\rom/bot.lua:505: onLoad error: ...pts/rom/userfunctions/userfunction_worldtraveler.lua:1082: attempt to call global 'NPCTeleport' (a nil value)
from rorazan to varanas
Life is a journey, not destination :D

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

Re: Noobbotter's World Traveler Userfunction

#38 Post by rock5 » Thu Nov 08, 2012 6:32 am

noobbotter wrote: This userfunction requires Rock5's latest GoToPortal userfunction (v2.01) found here: http://www.solarstrike.net/phpBB3/viewt ... gotoportal
  • 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
lolita
Posts: 139
Joined: Thu Oct 20, 2011 5:39 am
Location: Serbia

Re: Noobbotter's World Traveler Userfunction

#39 Post by lolita » Thu Nov 08, 2012 11:00 am

sry, didn't see that.
ty , now work like charm :)
Life is a journey, not destination :D

Cindy
Posts: 237
Joined: Fri Sep 28, 2012 4:23 pm

Re: Noobbotter's World Traveler Userfunction

#40 Post by Cindy » Thu Nov 08, 2012 11:48 pm

I had some trouble trying to go from Heffner Camp snoop to Silverfall (for goblins)... it would try to transport to heffner, while i was standing right next to heffner snoop.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 7 guests