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.
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's travelTo userfunction

#101 Post by rock5 » Mon Jul 06, 2015 12:28 pm

Works fine for me. I posted an updated version recently. Have you updated?
  • 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
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: Rock5's travelTo userfunction

#102 Post by beanybabe » Mon Jul 06, 2015 5:09 pm

I got latest now I will give it a spin.

User avatar
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: Rock5's travelTo userfunction

#103 Post by beanybabe » Mon Jul 06, 2015 7:09 pm

Im thinking you need to add a line to travelto
so if it uses a portal
that it does update:player() before it returns to the running wp.

or something so it sets the current player wp to where it is. then exit the function.

User avatar
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: Rock5's travelTo userfunction

#104 Post by beanybabe » Mon Jul 06, 2015 7:34 pm

beanybabe wrote:Im thinking you need to add a line to travelto
so if it uses a portal
that it does update:player() before it returns to the running wp.

or something so it sets the current player wp to where it is. then exit the function.

I looked at the code and the problem was in gotoPortal() I edited mine and added the line rock sugested to update player location. __WPL.setWaypointIndex(__WPL:getNearestWaypoint())
some of the other portal functions may need the same change.

Code: Select all

83	if closestObject then
84		print("Targeting portal "..closestObject.Id..", range "..distance(player.X,player.Z,closestObject.X,closestObject.Z))
		__WPL.setWaypointIndex(__WPL:getNearestWaypoint())     ---  add this line here.
		return movetoportal(closestObject)
	else
		print("Portal not found within range of "..tostring(_range))
		return false
	end

	

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

Re: Rock5's travelTo userfunction

#105 Post by rock5 » Tue Jul 07, 2015 3:09 am

It's probably not a good idea to change that in the userfunction. When using travelTo in a waypoint the next waypoint is where it will go. So you don't need to find the nearest waypoint and in fact doing so might cause unexpected results. You only need to set the nearest waypoint if you use travelTo in the onload. So I would just add that line in the onload after the travelTo.
  • 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
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: Rock5's travelTo userfunction

#106 Post by beanybabe » Tue Jul 07, 2015 8:48 am

i changed it in mine now all the portals seem to work right, I think this has been what is causing people problem with portals.

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

Re: Rock5's travelTo userfunction

#107 Post by rock5 » Tue Jul 07, 2015 9:08 am

GoToPortal just goes to the portal, it doesn't check if it works, it doesn't wait for the loading screen and doesn't update the player. That is why I created GoThroughPortal. In most cases I would use that. It waits for the loading screen, waits 3 seconds then updates player. It also checks whether the teleport worked and returns true or false so you could, for instance, have it try again if it fails. GoThroughPortal is the complete package. You would use GoToPortal only if you wanted to use your own method to check if it worked so you would also have to include a waitForLoadingScreen and player:update.
  • 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
Bill D Cat
Posts: 555
Joined: Sat Aug 10, 2013 8:13 pm
Location: Deep in the Heart of Texas

Re: Rock5's travelTo userfunction

#108 Post by Bill D Cat » Sat Jul 11, 2015 12:21 pm

Okay, I think I was a bit premature on saying the function works for new Dwarven characters. It doesn't. :cry:

The problem is this; while you can transport from Yrvandis Hollows to Varanas via Snoop by using the dialog options, you have not yet technically activated the Varanas portal. I think this is why the travelTo userfunction is not working for new Dwarves. It checks in memory (or however) to see what hubs are available and doesn't yet see Varanas. If you have picked your second class, it will transport to Reifort Camp, then use the Ailic's Aide to go to Obsidian. That's where it stops working because neither Varanas or Heffner Camp are available. If you haven't yet picked your second class then you have no additional transport options and it just ends without transporting.

I think there may need to be a check for getZoneId = 31 (Yrvandis Hollows) and player.Race = 2 (Dwarf) then assume the Varanas portal is available and transport via Snoop's dialog options.

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

Re: Rock5's travelTo userfunction

#109 Post by rock5 » Sat Jul 11, 2015 1:31 pm

The function has override assumed links. We can just add Yrvandis Hollows the the list of assumed links. In the hub list we can just add Yrvandis to the AutoLinkFrom

Code: Select all

	Varanas = {Offset=0x0, Bit=4, AutoLinkFrom={"VaranasBridge","Heffner","Yrvandis"}},
Try 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

User avatar
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: Rock5's travelTo userfunction

#110 Post by beanybabe » Sat Jul 11, 2015 6:34 pm

I am having trouble with that portal into drill again. I just applied that new update.
enter drill then
If I just run this

loadPaths("any xml file.xml");


it works ok


but if I run this it will Not start the xml file

Code: Select all

			if getZoneId() == 401 and getCurrency("honor") == 0 then	
					GotoGuild("Drill Ground");  
					player:target_Object("Drill Ground"); 
					sendMacro("ChoiceOption(1);");
					waitForLoadingScreen();
					 loadPaths("any xml file.xml");
				end	

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

Re: Rock5's travelTo userfunction

#111 Post by rock5 » Sun Jul 12, 2015 3:16 am

If you are not in zone 401 it will skip that code. Make sure it's the right zone.
  • 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
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: Rock5's travelTo userfunction

#112 Post by beanybabe » Sun Jul 12, 2015 6:58 am

its strange some times it works but usually the second time and after it fails.
I wrote the code a few ways to start the called wp outside the instance then have it enter.

i wrote it for the main to enter then call the wp

no matter how I did it it would not start the wp running.

but if i enter or start outside depending on the revision both work ok
they only fail if i call them from another program and try to enter drill ground

I have seen other people posting on something like this in other zones with portals
it worked a bit when i patched the function to use portals but that did not help today.

also if you enter and call a wp it always seems to want to jump past the first and go to one further in this only happens the few times it actually starts and may be a clue as to were to look for the problem.


i ripped all the code apart and made it all into one large wp I removes all the checks for honor and now I have it working it will log 1 char to the next and mail stuff when its done. Its good enough for now but Id like to get it to check gold and honor some day.

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

Re: Rock5's travelTo userfunction

#113 Post by rock5 » Mon Jul 13, 2015 2:23 am

Try adding print messages to figure out where it is failing and what is happening.

Is it possible that waypoint 1 and 2 are very close to one another?
  • 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
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: Rock5's travelTo userfunction

#114 Post by beanybabe » Wed Jul 15, 2015 1:18 am

on Second thought this is to much to code...
Found something you might add to world traveler.

If character had never been to stronghold, it will not show up on Varanas portal.
second class is needed to get the reiford portal.

If you add a check for stronghold on Varanas portal then if it had not been there have it
port to Reiford
then Stronghold
then have it click snoop at stronghold and
continue with what it was doing.

---------------------------------
I notice it will detect if you start by npc to dogs
but not at mail boxes in many areas

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

Re: Rock5's travelTo userfunction

#115 Post by rock5 » Wed Jul 15, 2015 2:12 pm

Firstly worldtraveler is a different userfunction than mine. Don't get them mixed up. Secondly I believe travelTo will use recall to Reifort or Heffner when necessary. So it should already do what you describe.
  • 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
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: Rock5's travelTo userfunction

#116 Post by beanybabe » Thu Jul 16, 2015 6:31 pm

oh worldtraveler and travelto and castle all get me messed up some times but i'm starting to get used to them.
Just adding extra seconds here and there helped at portals. I wish I was good at arrays so I could make the store buy stuff for honor more friendly. For now just edit it and change the items each time. Looking at the code for travelto I need something like the way it works for the inventory items and costs. Hopefully ill be done messing with this part soon and start on some other thing.

User avatar
Bill D Cat
Posts: 555
Joined: Sat Aug 10, 2013 8:13 pm
Location: Deep in the Heart of Texas

Re: Rock5's travelTo userfunction

#117 Post by Bill D Cat » Sat Jul 18, 2015 11:10 pm

Based on the 3.20 release, I've added a few more connections in Varanas and Obsidian Stronghold. Added the auto-connect between Yrvandis and Varanas.
  • VaranasAuction to/from VaranasCentral
    VaranasBank to/from VaranasCentral
    ElvenAirship to/from VaranasClassHall
    ObsidianAuction to/from ObsidianBank
    ObsidianAuction to/from GlorySquare
    ObsidianBank to/from GlorySquare
Attachments
userfunction_travelTo.lua
Version 3.21
(42.64 KiB) Downloaded 202 times

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

Re: Rock5's travelTo userfunction

#118 Post by rock5 » Sun Jul 19, 2015 11:05 am

The problem with adding Yrvandis as an autolink to Varanas is that it's not available until you finish Taffrock, right? I guess it can't hurt as you wouldn't use it unless you had done it. And you don't have much other choice. Well, if you had your second class you could recall out so that might no longer work. Hm... Is there anything we could test to know if we finished Taffrock? Possible a particular quest needs to be completed? If we could test for that we could add/remove Yrvandis from the autolinks as needed.
  • 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
Bill D Cat
Posts: 555
Joined: Sat Aug 10, 2013 8:13 pm
Location: Deep in the Heart of Texas

Re: Rock5's travelTo userfunction

#119 Post by Bill D Cat » Sun Jul 19, 2015 11:46 am

The most likely quest to check is 425189 -- Silvershadow Invitation. That's the one that activates the options in Snoop's dialog.

User avatar
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: Rock5's travelTo userfunction

#120 Post by beanybabe » Sun Jul 19, 2015 1:17 pm

When I do dwarfs area had sent 20 xp orbs or so and get the char to 20/20 the trainer npc's then give me the portal there. May still need to click snoop in that zone after training.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest