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

#61 Post by rock5 » Tue Aug 05, 2014 10:36 pm

Ego95 wrote:After reaching the glory square it tries to walk back to the mercenary square, I think because it thinks teleporting failed.
Well as far as I can tell the travelTo function doesn't change the waypoint so for example if you have some code like this

Code: Select all

<waypoint x.. y.. z..> </waypoint>
<waypoint x.. y.. z..> travelTo("location")</waypoint>
<waypoint x.. y.. z..> </waypoint>
then as long as travelTo worked, it wouldn't matter if it thought that it failed. It would always continue onto the next waypoint. So I'm assuming you have some extra code that makes it go back to a previous waypoint if travelTo failed. So the problem is probably with that code.
Ego95 wrote:The thing which keeps is the message that the teleport failed. Like I said for example from varanas central to the bridge the character waits 10-15 seconds on the bridge, writes, that the teleport failed but then keeps on going normal because destination was reached.
Maybe you are adding your own waitForLoadingScreen command? NPCTeleport does it's own waitForLoadingScreen so if you added your own then it would execute after the teleport has finished.
  • 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: Rock5's travelTo userfunction

#62 Post by Ego95 » Wed Aug 06, 2014 3:32 pm

rock5 wrote:
Ego95 wrote:After reaching the glory square it tries to walk back to the mercenary square, I think because it thinks teleporting failed.
Well as far as I can tell the travelTo function doesn't change the waypoint so for example if you have some code like this

Code: Select all

<waypoint x.. y.. z..> </waypoint>
<waypoint x.. y.. z..> travelTo("location")</waypoint>
<waypoint x.. y.. z..> </waypoint>
then as long as travelTo worked, it wouldn't matter if it thought that it failed. It would always continue onto the next waypoint. So I'm assuming you have some extra code that makes it go back to a previous waypoint if travelTo failed. So the problem is probably with that code.
Ego95 wrote:The thing which keeps is the message that the teleport failed. Like I said for example from varanas central to the bridge the character waits 10-15 seconds on the bridge, writes, that the teleport failed but then keeps on going normal because destination was reached.
Maybe you are adding your own waitForLoadingScreen command? NPCTeleport does it's own waitForLoadingScreen so if you added your own then it would execute after the teleport has finished.
This is what I am using:

Code: Select all

	<!-- #  4 --><waypoint x="-21986" z="3650" y="-169" tag="buy"> --Mercenary Square
			travelTo("GlorySquare")
	</waypoint>
	<!-- #  5 --><waypoint x="-23198" z="4491" y="-249"> --Glory Square
			UMM_SendAdvanced("xxx",242291)
			travelTo("ObsidianCastle")
	</waypoint>
So I did add a waypoint at the glory square. Was not able to run it today, but what I saw yesterday is that it ran back to the mercenary square before sending, because "the loadingscreen didn't appear"

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

Re: Rock5's travelTo userfunction

#63 Post by rock5 » Wed Aug 06, 2014 10:27 pm

That doesn't make sense. There is no code anywhere that says "if the loading screen doesn't appear go back to the mercenary square" so I don't know why it would be going back. Maybe you should copy and past the mm output. In particular have a look at what waypoint coordinates it's actually going to. Also make sure you haven't modified travelTo or NPCTeleport.

Here is an example of how the waypoints work.
  • 1. The bot travels to a waypoint.
    2. Before executing the code at the waypoint the bot increments the CurrentWaypoint, ready to go to the next waypoint.
    3. The bot executes the code in the waypoint.
    4. The bot goes to the next waypoint as indicated by CurrentWaypoint.
So the bot will always move onto the next waypoint unless the next waypoint is changed in the waypoint code. There is nothing in the code you showed me that would change the CurrentWaypoint index so it should always move onto the next waypoint, unless you changed those functions.
  • 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: Rock5's travelTo userfunction

#64 Post by Ego95 » Sun Aug 10, 2014 3:35 pm

Okay, I don't know what I've changed or what I did wrong, but now the bot doesn't try to walk back. The thing with "loadingscreen didn't appear isn't that important. Just takes aboit 15 seconds more.

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

Re: Rock5's travelTo userfunction

#65 Post by rock5 » Mon Aug 11, 2014 12:20 am

The message about the loading screen not appearing happens when the waitForLoadingScreen function fails to see the loading screen within the time limit set. I believe in the travelTo function the limit is set to 15s. This could be for a number of reasons but doesn't mean the teleport failed.

So normally you wouldn't get that message. The reason it waits for 15s when it fails to see the loading screen is because it waits the whole 15s for it to appear before giving up whereas when it sees the loading screen it returns control as soon as it's back in the game.
  • 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

#66 Post by noobbotter » Fri Sep 05, 2014 10:06 am

Has anyone added the Jungle of Hortek to the travelTo userfunction? If not, does anyone know what the zone name is? For example, Wailing Fjord's zone name is "ZONE_Z27_WAILING_FJORD". What is the zone name for Jungle of Hortek? Thanks.

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

Re: Rock5's travelTo userfunction

#67 Post by rock5 » Fri Sep 05, 2014 10:45 am

I can look that up.
  • ZONE_Z28_HURTEKKE_JUNGLE


I'll update the userfunction on the first post.
  • 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

#68 Post by noobbotter » Fri Sep 05, 2014 1:19 pm

Awesome! Thanks again.

Kansaki
Posts: 14
Joined: Mon Apr 28, 2014 2:08 am

Re: Rock5's travelTo userfunction

#69 Post by Kansaki » Sun Apr 12, 2015 2:21 am

Hi Everyone,

I added the two more destination to the travelTo userfunction. The new map called "Salioca" and the demonstration battle NPC for dailies called "DemonstrationBattle".

Also, I found an error which I couldnt track that took Majer Palo, the goblin npc, as a transport to silverfall. So if you ask the userfunction to get you to goblins it will stop at the gate which I fix that. But when you ask them to take you to everywhere else from there, if keep treating the goblin npc as a teleporter.

Thanks for this great userfunction and hope we can keep adding more places.

*EDIT
Fixed an issue with function name (typo) from GoblinMines to Siverfall and from Silverfall to GoblinMines.
Added Saliocas Basin named "Salioca"
Added path from Rorazan to Demostration Battle NPC called "DemostrationBattle"

Regards.
Kan.
Attachments
userfunction_travelTo.lua
(32.82 KiB) Downloaded 214 times

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

Re: Rock5's travelTo userfunction

#70 Post by rock5 » Sun Apr 12, 2015 1:58 pm

Looks good.

Added to first post as version 3.15.
  • 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

#71 Post by noobbotter » Tue May 26, 2015 8:26 am

Last night I started adding in the new Zone and got it working on my computer, but I don't know how to find the proper zone Name. Should be something like ZONE_Z30_KASHAYLAN or something but I don't know where to find it. I used the option shown in the Snoop transport chat to get my copy to work temporarily.

Also, I guess the new zone will be considered a "hub" because from there, there are a couple camps within that zone that you can transport to using the transport circle and I'm not really sure how to update the hub entry. The instructions mentioned some commands but one of them has to be done before the first time you use it? Well, I had already used the transport so I don't think I can run that command.

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

Re: Rock5's travelTo userfunction

#72 Post by rock5 » Tue May 26, 2015 9:14 am

There are probably more than 1 way to get the text name. I usually use RoM Language Viewer. http://solarstrike.net/phpBB3/viewtopic ... 097#p57097. I just happen to have it open at the moment so I can look it up for you. There is one called ZONE_Z30_KATHALAN

As for the hub, don't worry about it. When someone can finally be bothered and they are in a position to do it, we'll finally add it. But if you could get it working without it, that would be great.
  • 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

#73 Post by Celesteria » Mon Jun 01, 2015 8:02 am

hi there,

I just added the new zone to the userfunction. I also added some housemaids so I can "go home" after finishing the scripts. the tokens are:

Code: Select all

ObsidianHousemaid
LogarHousemaid
HeffnerHousemaid
TundraHousemaid
WailingFjordHousemaid
I also modified the travelTo-function itself so it returns true or false instead of creating an error. so I can use it like this:

Code: Select all

if travelTo ('varanas')==false then
  loadPaths ('LogarToVaranas')
end
It would be nice, if you can use this in the next version.
the changes are at line 403-405 and 443-445


greeting and keep up the good job
Celesteria
Attachments
userfunction_travelTo.lua
(36.93 KiB) Downloaded 201 times

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

Re: Rock5's travelTo userfunction

#74 Post by rock5 » Mon Jun 01, 2015 10:53 am

I don't have an issue with housemaids being added. Of course there are a lot more housemaids but I don't se a problem of adding them as people find a need for them.

Looks like you've changed more than just adding new locations. I'll have to review the changes. And it looks like your version is based off of version 3.14 instead of 3.15. I'll have to take that into account.
  • 1. I see you've grouped the non teleporter nodes. Not a bad idea. I might add a comment to each section though.

    2. Why did you change the quality control strings? Eg.

    Code: Select all

    DoD = "not used but required for quality control",
    to

    Code: Select all

    DoD = "DoD",
    I mean it doesn't matter what's in the strings but my way makes it clear that it doesn't matter but your way might make future editors think that the variable name and value have to match because you've made them all match.

    3. If it fails to find the destination you've changed it to return false and continue. I don't think that's a good idea because if it fails to go to the detination then the waypoint file can't continue anyway so why return false and continue?

    4. I see you have it mount when using the custom travel functions. I'm not 100% sure that's the place for it but I'll let that pass. I would probably have preferred the mount function being added to the individual custom functions where they are needed. There might be some of them where you might not want to mount, maybe because the distance is short. But it's certainly easier where you put it. I see you try to remember the waypoint type, change it to Travel then changing it back after the function. I'm not sure that will work properly. __WPL.Type is the waypoint type I believe but the current type may have been set previously with setForcedWaypointType and may not match the waypoint type. I believe forced type is saved to __WPL.ForcedType so you would have to check both. Or just save both, eg.

    Code: Select all

    local oldWaypointType = __WPL.Type
    local oldForcedType = __WPL.ForcedType
    Then later

    Code: Select all

    __WPL.Type = oldWaypointType
    __WPL.ForcedType = oldForcedType
    That way you restore it to exactly the wa it was before. Although I'm not entirely sure about changing it to travel. What if a user doesn't want it to ignore aggro because they might die? You're making too much of an assumption on their behalf. At this point I think I would just add the mount and not the waypoint type change.

    5. Ah it looks like you added the above mount to replace existing mounts in some of the functions. Why didn't you just add mounts the the extra functions where you wanted it to mount? I think in the end the idea is that everything that needs to be done to get from 1 place to another is supposed to happen in the function. I think I'm going to want it the way it was with the mounts in the corresponding functions.

    6. Having it sleep instead of erroring when entering DoD, I don't have a problem with that. I might add a longer message though, eg. "Failed to portal into DoD. Please enter manually then resume."
  • 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

#75 Post by Celesteria » Tue Jun 02, 2015 8:22 am

hi rock5,

I should comment my changes better so I see for myself what is not original *note to myself*

to your question 2: there is no special reason to change this. maybe it was only an early idea to give better error messages or something like that. it has a better logic to myself to not have different indexes the same value.

to question 3: all my waypoints start end end at a teleporter. this is because I dont (want to) know where the char is. I am a lazy person and dont want to start the bot again and again. I am using 4 or 5 bot at the same time. So this ist my way to let the script wait until I reach a point where it can start. so all the xml start like this:

Code: Select all

		
<onload>
zid = getZoneId ()
while zid==400 do	-- in house
  print ('leave the house') print ('\a\a') player:sleep ()
  zid = getZoneId ()
end
while zid~=22 and not travelTo ('Rorazan') do
  print ('unable to go to Rorazan') print ('\a\a') player:sleep ()
  zid = getZoneId ()
end
...
</onload>
to wait at home is for doing some stuff like getting the housemaid potions and planting and so on. then I leave the house and thats the reason why I added some housemaids to the function. all my chars are doing the minigames. but they are located at different locations (logar, heffner, fjord...). now the char runs to the next teleporter and starts doing what they have to do. if the char is located somewhere without a teleporter it uses a teleport skill.

maybe its a better way to implement this functionality by adding a second parameter to the travelTo-function like this:

Code: Select all

-- pseudo code
function travelTo (destination, returnBool)
  ...
  if error then
    if returnBool==true then return false
    else error ('location unreachable', 1) end
  else
    if returnBool==true then return true end
  end
  ...
end
to 4: you are right. your way looks better then mine. I forced the waypointtype to "TRAVEL" and mounted because sometimes my chars run away from teleporter to fight enemies. this was the fastest way to solve this problem.


it would be nice to have a function to add connections on runtime. so somebody can write a new LocationAToLocationB-functions for only one script and connect it to a teleporter. I didnt find a fast way to implement this, because your startup checks prevent this. this checks have to run everytime someone added a connection. but maybe you find a smart way to implement this functionality :)

[edit]
oh and another idea is: what do you think about adding the posibility to use a destination from transportbook. if there is no existing connection then read the transportbook and look if there is a point with this destination as name ... just for extending the posibilities. I can implement the code to read the book, but to implement it into your script, I should have to have a closer look and understanding of what you are doing ... but I told you, I am a lazy person ;)
[/edit]


I hope my english is good enought to understand. Its a long time ago I had to use it ^^


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

#76 Post by rock5 » Thu Jun 04, 2015 3:30 am

3. I understand. There are a lot of functions that do some task and, even though they don't need to return any value, they benefit from returning false so users can take some action if the function fails, if they choose to do so. But checking the returned value is optional and in most cases most users will just use the function without taking steps to deal with failure. And mostly, with these types of functions, it's not disastrous if the function fails. And in fact they probably don't even error if they fail, they probably just print a warning message then continue.

So... the point I'm making is TravelTo would still mostly be used directly without dealing with the returned value so it should be safe to do so. It certainly isn't safe to continue if TravelTo fails so it has to error.

This brings to mind the conundrum I'm always facing when adding error checking in functions. Do I display a warning and continue or error and stop the script? I guess it depends on whether a script can continue with that error or not.

The pseudo code is acceptable. That way you can use it the way you want to and it is still "safe" for normal use.

4. Yeah, so I think mount() should be added to any functions that need it. If you think it should be added to any particular functions, let know.

As for travel, I can't see where it would attack enemies. Usually it attack enemies during moveto commands but all the ones I can see have true as the second argument so should ignore mobs. Are you sure it's not attacking mobs just before it reaches the teleport npc and before it actually runs the TravelTo function? What's the last thing on micromacro just before it attacked the mob?
Celesteria wrote:it would be nice to have a function to add connections on runtime. so somebody can write a new LocationAToLocationB-functions for only one script and connect it to a teleporter. I didnt find a fast way to implement this
The easiest way to to make a path to the area you want to go is just use a waypoint file. You could just create a separate travel waypoint file and load it at the end of you last waypoint file eg.

last waypoint file

Code: Select all

TraveTo("destination")
loadPaths("locationToLocation.xml")
locationToLocation.xml

Code: Select all

<waypoints>
...
loadPaths("daily.xml")
</waypoint>
</waypoints>
Or you could do it all in one which is the way I like to do it.

daily.xml

Code: Select all

<waypoints>
<onload>
if wrong zone then 
    TravelTo(right zone)
end
</onload>

<!-- waypoints from travel npc to daily npc -->
<waypoint...
<waypoint...
etc.

<!-- NPC waypoint and waypoint loop to do daily -->
<waypoint ... tag="NPC">    -- the npc waypoint

<waypoint...
<waypoint...
etc.

<!-- The last waypoint should loop back to the npc -->
<waypoint... > __WPL:setWaypointIndex(__WPL:findWaypointTag("NPC")) </waypoint>
</waypoints>
Hope that helps.
Celesteria wrote:oh and another idea is: what do you think about adding the posibility to use a destination from transportbook. if there is no existing connection then read the transportbook and look if there is a point with this destination as name ... just for extending the posibilities. I can implement the code to read the book, but to implement it into your script, I should have to have a closer look and understanding of what you are doing ... but I told you, I am a lazy person ;)
I think TravelTo is about using the teleporters to get to your destination. I thin using the Transport Book should be separate. Plus, even though using the transport book is fairly simple, implementing it in TravelTo would be hard because the transport points could be named anything.
  • 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

#77 Post by Celesteria » Thu Jun 04, 2015 12:49 pm

to 3: so it would be nice if you could add this in your next version :)

to 4: I dont really know when it was. I solved the problems using my solution. mostly it was between two scripts when the first one ended at a teleporter and another one starts there. I am also using scripts from other users and if the waypoint type is not set correctly at beginning, it starts to attack mobs f.e. at varanas or logar teleporter and at the butterflie-quest npc. I dont want to edit every script to fit my needs, so it was the easiest way to handle it with the travel function itself. I dont know if it is really required to check mounting at every transporter, but when the function uses one of the locationAToLocationB functions it would be nice.

apropos locationAToLocationB functionality: you allready implemented non-teleporter locations into the script statically. my idea is to make this part dynamic to extend the possibilities without editing the userfunction. many people write waypoint files for all type of quests or actions. but no one of them think about how to come to the starting point. I know how to do it for myself - I know the way how to use waypoint files. but if I want to connect 2 files (from other people) I dont want to write a 3rd file to come from one location to another. my files allways start at a teleporter but others dont. I am working on a plan to give the posibility to move to every possible important location (like mailboxes, housemaids, auctionhouse etc.) and between them. the best way to do it you allready wrote. so why should I reinvent the wheel?

all I need is a posibility to add a location node at runtime. to realize my plan there are a lot of functions and waypoint files to travel between two points and I dont want add it all static and dump the memory with unused informations. the best way I think is to have a separat waypoint folder from which the required way is loaded when it is used. so everybody can simply start there scripts with

Code: Select all

-- pseudo code --
registerNode ('myLocation', 'Varanas', __WPL.Waypoints[findWaypointTag ('start')])
travelTo ('myLocation')
and if this location is used the first time then he/she has to write a short waypoint file (or function) from the next teleporter (or existing location) to this location and share it with the others. so after a while it can become a big collection of connections between every required position and everybody can use it in theire own scripts. and there is no more needing of editing scripts and writing connections between scripts.

I dont know how others are handling there daily routine. but my bots not only do one thing a day. they have to travel around and are doing daylies, minigames, making manastones and more things. one after one and then login to the next char...

hope this helps understanding what I need :)


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

#78 Post by rock5 » Thu Jun 04, 2015 1:50 pm

3. Ok, I'll do that.

4. I think that might be getting too complex. TravelTo can't hold every destination in RoM, only the most common ones. Adding the ability to add functions doesn't make any sense to me because it is easier for a regular user to create a waypoint file to take to from A to B than it is to create a function that does the same. You have to create the waypoint file anyway so why bother converting it into a function? You are better off have a collection of AtoB waypoint files. Sorry if I'm not understanding you properly.
  • 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

#79 Post by noobbotter » Thu Jun 04, 2015 2:32 pm

The way I use mine is... for every waypoint file, I try to ensure it starts and ends at a transporter point. For some that I may not want to edit, such as Ancient Treasures, I have a "to_AT" waypoint file that I call instead of AT which will take me to where AT should start, and at the same time, I have an "after_AT" waypoint that I run after AT completes. If this is done for every waypoint file, then it makes it easy to use variable evaluations to decide what to run next and not have to worry about where the bot is. The only drawback I have to this is for any waypoint files that are far away from any transporters (such as the new EOJ script in Kashaylan). If I made them start and stop at a teleporter, then if I wanted to just run one script on a character (such as doing one round of EOJ's), It could be a waste of time to have to move all the way back to the transporter before running the script.

One of the ways I got around this problem is by looking for something specific prior to proceeding. For example, my script to buy fusion stones in Varanas West starts with this in the onLoad section:

Code: Select all

	myitem = player:findNearestNameOrId("Odeley Prole")
	if myitem then
		if 220 > distance(myitem, player) then
			__WPL:setWaypointIndex(__WPL:findWaypointTag("at_shop"))
		else
			travelTo("VaranasWest")
			__WPL:setForcedWaypointType("NORMAL")
			__WPL:setWaypointIndex(1)
		end
	else
		travelTo("VaranasWest")
		__WPL:setForcedWaypointType("NORMAL")
		__WPL:setWaypointIndex(1)
	end
With it this way, my bot can get there from any other waypoint file, or If I'm already in the vicinity of the vendor, I can run the file without first moving manually back to the transporter.

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

Re: Rock5's travelTo userfunction

#80 Post by Celesteria » Thu Jun 04, 2015 4:01 pm

@rock5

I think my english is not good enough to explain what I think. I dont want TravelTo to hold any location and I dont want to add a lot of functions to it. my intention is only that what you allready have implemented to make public. your script allready looks for a aToB-function, but it needs the A and B allready added to the nodelist. but the nodelist is private (local) and not accessable/extendable from any script while runtime. and the check functionality for the nodelist is running BEFORE my script starts. Your startup section should run as a function and there should be a function to add a node, which implements/reruns this checks. so i can add nodes and functions dynamically while runtime.

is this a better explanation?
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 :)

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests