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

#81 Post by rock5 » Sat Jun 06, 2015 1:46 am

I see. So you need a function to add a node? I guess you would also need one to edit a node so you can add the new node. Something like this? Untested

Code: Select all

function travelToAddNode(name, zone, npcId, npcX, npxZ, npcY, connectsTo)
	nodeList[name]={Zone=zone, Npc= {Id = npcId, X=npcX, Z=npcZ, Y=npcY or 1}, ConnectsTo= connectsTo or {}}
end

function travelToAddDestination(nodeName, dests)
	if type(dest) == "table" then
		for k,v in pairs(dests) do
			table.insert(nodeList[nodeName].ConnectsTo, v)
		end
	else
		table.insert(nodeList[nodeName].ConnectsTo, dests)
	end
end
  • 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: Rock5's travelTo userfunction

#82 Post by noobbotter » Sat Jun 06, 2015 9:27 am

Rock5,

I have a character that has access to teleport from Silverspring (Varanas), to Silverfall (Aslan Valley), and to Harf (Ystra Highlands. When trying to travelTo(VaranasCentral) from HarfTradingPost, it tries to go through Obsidian stronghold which my character doesn't have and then fails. Is there a way to make it see that I can get there via Silverfall?

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

Re: Rock5's travelTo userfunction

#83 Post by rock5 » Sun Jun 07, 2015 9:31 am

Hm... It's supposed to know if you've been to Obsidian. It's on the hub list do it gets checked with the linkIsEnabled function.

What the ...? The bit value in the hubList has been written as 0x32. That's not a single bit. Decimal 32 is. Obsidian is an easy one to check so I checked it to be sure and its definitely 32, not 0x32. Are they all wrong? If so then it's never been working, from the very beginning. How can it have been all this time and no one mentioned it before? Crazy.

It's otherwise hard to test but I'll probably just change them all anyway. Until I upload a new copy change the hubList like this and see if it works.

Code: Select all

local hubList = {
	Varanas = {Offset=0x0, Bit=4, AutoLinkFrom={"VaranasBridge","Heffner"}},
	Rorazan = {Offset=0x261, Bit=32},
	Obsidian = {Offset=0x0, Bit=32, AutoLinkFrom={"Reifort","BattleSquare"}},
	Dalanis = {Offset=0x12B, Bit=1, AutoLinkFrom={"DalanisObsidianEnvoy","DoD"}},
	AyrenCaravan = {Offset=0x0, Bit=64, AutoLinkFrom={"Reifort"}}, -- Added because it adds an alternate route to Lyk
	WailingFjord = {Offset=0x373, Bit=16},
}
  • 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

Celesteria
Posts: 36
Joined: Mon Jun 01, 2015 7:44 am

Re: Rock5's travelTo userfunction

#84 Post by Celesteria » Sun Jun 07, 2015 10:21 am

hi rock5,

your functions seems to work fine (without the check, but its not so important). I edited it to give the posibility to add also npc-dialogs (like the millers ranche npc) to the function:

Code: Select all

function travelToAddDestination (nodeName, dests, option)
  if type (dest) == "table" then
    for k,v in pairs (dests) do
      table.insert(nodeList[nodeName].ConnectsTo, v)
    end
  else
    table.insert (nodeList[nodeName].ConnectsTo, dests)
  end
  optionString[nodeName] = option~=nil and option or 'not used but required for quality control'
end
greetings
Celesteria
I am a botter, but no cheater. So none of my scripts ever use any of the hacks like swimhack, speedhack, wallhack...
I hope you can understand my english. Its not my native language and it has been a long time since I used it the last time :)

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

Re: Rock5's travelTo userfunction

#85 Post by rock5 » Mon Jun 08, 2015 6:52 am

I thought of that but seeing as the optionStrings are only needed when teleporting and the quality control in already done, I didn't think it would be needed. I guess you only really need it if you are going to add teleporters, but wouldn't you rather add the teleporters to the userfunction instead of adding it temporarily with the travelToAddNode function? I guess it can't hurt to add it anyway.

If you didn't know, nil is considered 'false' in conditional statements. So you don't need to check for nil. This would work.

Code: Select all

optionString[nodeName] = option or 'not used but required for quality control'
  • 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

Celesteria
Posts: 36
Joined: Mon Jun 01, 2015 7:44 am

Re: Rock5's travelTo userfunction

#86 Post by Celesteria » Wed Jun 10, 2015 1:21 am

I think you are right 8-) I allways try to be perfect and make everything universal to have every possibility. Adding teleporters directly makes more sense and helps others better ...
rock5 wrote:If you didn't know, nil is considered 'false' in conditional statements. So you don't need to check for nil.
Thanks for the hint. But I use this way for a better reading for myself. So I can see that I am checking for a non-existing argument/value, not for a boolean false.
I am a botter, but no cheater. So none of my scripts ever use any of the hacks like swimhack, speedhack, wallhack...
I hope you can understand my english. Its not my native language and it has been a long time since I used it the last time :)

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

Re: Rock5's travelTo userfunction

#87 Post by beanybabe » Mon Jun 15, 2015 8:39 pm

Is there a way to make the travelto not recall I am trying to test some waypoints and when I make some mistake it likes to recall.

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

Re: Rock5's travelTo userfunction

#88 Post by rock5 » Wed Jun 17, 2015 1:31 am

Easy, just find the bit of code that does the recall and stop it from doing the recall. The part that does the recall looks like this.

Code: Select all

		-- If no path then try from transport skill
		local bestTransport
		if path == nil then
			-- First check if on cooldown
			local cooldown, remaining = RoMScript("GetSkillCooldown(1,2)") -- recall
			if remaining == 0 then
				-- Transport list
				local transportSkills = {
					{Id=540191,Start="Reifort"},
					{Id=540193,Start="Heffner"},
				}

				-- Check for best path from each
				for k,skill in pairs(transportSkills) do
					local tmpSkill = FindSkillBookSkill(skill.Id,1)
					if tmpSkill then
						tmpPath = Dijkstra(skill.Start, destNode)
						if tmpPath and (path == nil or #path > #tmpPath) then
							-- Found quicker route, replace
							path = tmpPath
							bestTransport = tmpSkill
						end
					end
				end
			end
		end
You can delete the whole thing or just change the initial 'if' statement to equal false. If you want to disable then enable it without forgetting what the initial code was, try just adding quotes around the nil.

Code: Select all

		if path == "nil" then
That should make it skip that section. Then to re-enable it just remove the quotes.
  • 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

Celesteria
Posts: 36
Joined: Mon Jun 01, 2015 7:44 am

Re: Rock5's travelTo userfunction

#89 Post by Celesteria » Wed Jun 24, 2015 1:24 pm

for adding the local teleporter at kashaylan add this:

Code: Select all

HoviksCamp               = {Zone=30, Npc={Id=123542, X=19494, Z=34794, Y=67}, ConnectsTo={"SabanosCamp","HiddenCamp","Kashaylan"}},
SabanosCamp              = {Zone=30, Npc={Id=123542, X=21057, Z=38119, Y=370}, ConnectsTo={"HiddenCamp","HoviksCamp"}},
HiddenCamp               = {Zone=30, Npc={Id=123542, X=16462, Z=44897, Y=39}, ConnectsTo={"SabanosCamp","HoviksCamp"}},

Code: Select all

HoviksCamp = "ZONE_ALLRIC_GARRISON",
HiddenCamp = "ZONE_UNKNOWN_VILLAGE_01",
SabanosCamp = "ZONE_SAABARIO_GARRISON",

Code: Select all

function KashaylanToHoviksCamp ()
	print("Moving to Hoviks Camp Teleporter")
	player:moveTo(CWaypoint(19298,34933), true)
	player:moveTo(CWaypoint(19343,34929), true)
	player:moveTo(CWaypoint(19494,34794), true)
end

function HoviksCampToKashaylan ()
	print("Moving to Kashaylan Teleporter")
	player:moveTo(CWaypoint(19494,34794), true)
	player:moveTo(CWaypoint(19343,34929), true)
	player:moveTo(CWaypoint(19298,34933), true)
end
I used the german names for the camps ('hoviks' and 'sabanos' camp). If you want you can change it to english expressions.

greetings
Celesteria
I am a botter, but no cheater. So none of my scripts ever use any of the hacks like swimhack, speedhack, wallhack...
I hope you can understand my english. Its not my native language and it has been a long time since I used it the last time :)

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

Re: Rock5's travelTo userfunction

#90 Post by beanybabe » Wed Jun 24, 2015 5:22 pm

Thanks for pointing to the recall I did try the "nul" but it still would recall. Surly I can figure a way to toggle it now that I know what to look for. I'm trying to get used to how the travelto works. ill see if I can make it less aggressive on the recalls.

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

Re: Rock5's travelTo userfunction

#91 Post by beanybabe » Fri Jul 03, 2015 8:31 am

Starting from maids. tried to start from the house maid in stronghold with this and it does a recall. I looked in travelto and it seems like housemaid is there and it may be checking distance to it. I wonder why it recalls?

Testing.. I tried standing near maid , just off the steps, across the line and near middle of the path. If i am near the middle of the path it will not recall.

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

Re: Rock5's travelTo userfunction

#92 Post by noobbotter » Fri Jul 03, 2015 9:08 am

Which housemaid did you try to start from? The one at Mercenary square? There's also one in Crafting Square. Either way, I don't think the travelTo function has the housemaid locations built into it... only the teleporters, so if you are at the housemaid, it might be too far away from the teleporter.

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

#93 Post by Bill D Cat » Fri Jul 03, 2015 4:08 pm

Found a strange issue that I can't figure out. I leveled up a new dwarf character with my Yrvandis Hollows quest series, and now I want to add a fourth short waypoint file to take me to the Varanas Class Hall to turn in the last quest to Daris after I pick up my second class. So I add the waypoints to move to where Snoop is located in Morfantas City, and then talk to him to make sure the portal is unlocked and that the link to Varanas is available. When I use the command travelTo("VaranasClassHall") one of two things happen. Either my character uses a recall to Reifort and then jumps to Obsidian where it then fails to get the link to Harf and exits, or else it just flat out says it can't find a path to Varanas Class Hall from here.

So why does it not try to go to Varanas first since that portal via Snoop is available, and it's the only link listed in the userfunction?

My guess is because all the other Snoop options say "Transport to ..." and the one in Yrvandis has two options that say "To Varanas" (a free, one time use when you are ready to leave the zone), and "Transport to: Varanas" (notice the extra colon) a few options after that.

Edit: No, the colon isn't the issue, as it is used in most of the transporter NPC dialogs in Xaveria. So there's just something not right with the info for Snoop in Yrvandis Hollows that is making it not recognize the link to Varanas.

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

Re: Rock5's travelTo userfunction

#94 Post by rock5 » Sun Jul 05, 2015 6:22 am

There was the issue, with the code that checks if nodes were active, being wrong. I believe it's fixed in the latest version. Have you updated the userfunction to the latest version? That might be the cause.

On another note, I should probably post another update as there have been a few changes.

Edit: Looks like the latest version didn't have the hublist fix so you should download the latest version I just posted version 3.20 and see if it helps.
  • 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

#95 Post by beanybabe » Sun Jul 05, 2015 9:05 am

i tried it at the craft hall house maid. to get it to work i have to walk forward from the maid to near the center of the path about 50 distance. I looked and the maid is in the code but I could not tell how you check if player was near it.

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

#96 Post by Bill D Cat » Sun Jul 05, 2015 9:07 am

I was using 3.15 and had the issues I mentioned. 3.20 fixed it and I can now transport out of Yrvandis Hollow.

Thanks.

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

Re: Rock5's travelTo userfunction

#97 Post by rock5 » Sun Jul 05, 2015 10:53 am

Cool.

About the housemaids. I tested them out and a lot, if not most, of them the paths were back-to-front, ie. the 'to' and 'from' functions were reversed. That may have contributed to your problem Beanybabe.
  • 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

#98 Post by Bill D Cat » Sun Jul 05, 2015 5:52 pm

Then there's the house maid that everyone forgets about. Cool-Aid... I mean Kulade, in Reifort Camp.
Cool-Aid.jpg

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

Re: Rock5's travelTo userfunction

#99 Post by beanybabe » Mon Jul 06, 2015 5:06 am

-------------- Solved travelTo() and gotoguild() were used in wrong place causing the error/


I hit another strange one it says " you have reached your destination" then just stops running
strange part is it worked like 3 times then just started halting at that spot.

I put in

travelTo("MercenarySquare");
player:pause() -- it does not hit this line gets to this line


-- I found this in travelTo Version 3.14
402 if start == destNode then
---- changed by Celesteria ----
print("You have reached your destination")
return true
end
Last edited by beanybabe on Mon Jul 06, 2015 3:50 pm, edited 1 time in total.

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

Re: Rock5's travelTo userfunction

#100 Post by beanybabe » Mon Jul 06, 2015 5:49 am

rock5 wrote:Cool.

About the housemaids. I tested them out and a lot, if not most, of them the paths were back-to-front, ie. the 'to' and 'from' functions were reversed. That may have contributed to your problem Beanybabe.
I stand right on top the maid in obsisian castle and it still want to teleport. i have looked at travelTo and it looks like its checking and should move from it. Its a big complicated code for me to follow.
this code will show what i mean

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onload>
travelTo("ObsidianCastle") -- stand on top maid by craft hall and run this it will try to teleport then move half way to the npc Dina Sega and it will run to castle.
</onload>
</waypoints>

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests