bug default start location.

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

bug default start location.

#1 Post by beanybabe » Thu Jun 11, 2015 12:58 pm

i ran into a bug that i think needs changed.


This waypoint demonstrates it. if you run it you char will start running to 0 0 0 I think it needs to be changed that it runs to the location were you currently are at. This would prevent characters running off and getting stuck some where. I know this if not a likely bit of code but it can happen if you are testing new waypoints.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
print ("help i am running to impossible location")

 </onLoad>
 <waypoint>
 
 </waypoint>
</waypoints>
Last edited by beanybabe on Sun Jun 14, 2015 3:31 pm, edited 1 time in total.

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

Re: bug default start location.

#2 Post by rock5 » Thu Jun 11, 2015 1:33 pm

You added an empty waypoint. What do you expect it to do?
  • 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: bug default start location.

#3 Post by Celesteria » Sat Jun 13, 2015 4:41 am

I agree with beanybabe: an empty waypoint should have the current location of a char, not {x=0,z=0,y=0}. this makes a lot of things smarter ;)
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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: bug default start location.

#4 Post by lisa » Sat Jun 13, 2015 5:09 am

A while a go I did a lot of testing with Waypoints that had current location as the only waypoint, the bot kind of spins and shudders a bit because it is constantly trying to get to the exact spot it is standing in.

Only way you would not have any waypoints in the file is if you created it manually and if you can do that then you can add in a loop in the onload so it doesn't even get to using any waypoints.
In my opinion anyway =)

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
print ("help i am running to impossible location")

while(true) do
yrest(100)
end

 </onLoad>
 <waypoint>
 
 </waypoint>
</waypoints>
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: bug default start location.

#5 Post by BlubBlab » Sat Jun 13, 2015 6:14 am

beanybabe wrote:i ran into a but that i think needs changed.


This waypoint demonstrates it. if you run it you char will start running to 0 0 0 I think it needs to be changed that it runs to the location were you currently are at. This would prevent characters running off and getting stuck some where. I know this if not a likely bit of code but it can happen if you are testing new waypoints.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
print ("help i am running to impossible location")

 </onLoad>
 <waypoint>
 
 </waypoint>
</waypoints>
I would say this should give a error message and not do anything, taking the current coordinates are the second best option. I think the problem is that in earlier days Rombot had no z-coordinates because of this the bot handles the other 2 in a similar way.
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: bug default start location.

#6 Post by lisa » Sat Jun 13, 2015 5:27 pm

BlubBlab wrote:I would say this should give a error message and not do anything,
Except some WP don't have any waypoints at all, like the AT or commandline scripts where everything is dealt with inside the onload, so if having no waypoints made the WP error then those scripts would no longer work.

Do I agree that running off into the distance to try to get to 0,0,0 is not good, for sure.

Q. Would someone creating a WP using createpath make a WP with no waypoints?
A. Very unlikely.

So this issue is only an issue with people who create WP manually by typing in the code, they should understand how the coding currently works.

In waypoint.lua it has the CWaypoint class, if there are no X or Z cords in the information given to the class it sets the values to 0.

Code: Select all

		if( not self.X ) then self.X = 0.0; end;
		if( not self.Z ) then self.Z = 0.0; end;
Maybe you could try playing around with this code and seeing if you can improve it, test the changes and report how the changes worked and what didn't work.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: bug default start location.

#7 Post by BlubBlab » Sun Jun 14, 2015 5:11 am

lisa wrote:
BlubBlab wrote:I would say this should give a error message and not do anything,
Except some WP don't have any waypoints at all, like the AT or commandline scripts where everything is dealt with inside the onload, so if having no waypoints made the WP error then those scripts would no longer work.

Do I agree that running off into the distance to try to get to 0,0,0 is not good, for sure.

Q. Would someone creating a WP using createpath make a WP with no waypoints?
A. Very unlikely.

So this issue is only an issue with people who create WP manually by typing in the code, they should understand how the coding currently works.

In waypoint.lua it has the CWaypoint class, if there are no X or Z cords in the information given to the class it sets the values to 0.

Code: Select all

		if( not self.X ) then self.X = 0.0; end;
		if( not self.Z ) then self.Z = 0.0; end;
Maybe you could try playing around with this code and seeing if you can improve it, test the changes and report how the changes worked and what didn't work.
The problems is it to say it loud is not we haven't a waypoint we have a waypoint with no coordinates.
By the way when you run a waypointfile and you have no waypoint(s) so far I remember it gives an error at the moment you are past the onload section.

You can either do this:

Code: Select all

		if( not self.X ) then self.X = player.X; end;
		if( not self.Z ) then self.Z = player.Z; end;
or

Code: Select all

		if( not self.X ) then error("some message") end;
		if( not self.Z ) then error("some message") end;
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

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

Re: bug default start location.

#8 Post by rock5 » Sun Jun 14, 2015 9:32 am

lisa wrote:Except some WP don't have any waypoints at all, like the AT or commandline scripts where everything is dealt with inside the onload, so if having no waypoints made the WP error then those scripts would no longer work.
I think the point is, not that it would error just because it has no waypoints but to error if the onload completes and there are no waypoints. What's the point of continuing to the waypoints when there are no weaypoints? If it's an 'onload' only waypoint then it should stay in the onload and error out when finished (or load another file).

As it is, it works if there are no waypoints. It displays the error that there are no waypoints and ends. This assumes that someone created an onload only waypoint but forgot to exit it properly when finished. The bug, if you want to call it that, is that when you have an empty <waypoint> it still adds it to the __WPL list even though it's empty. This just means the user didn't create the waypoint properly. There is no real need to support faulty waypoint like that but it would be extremely easy to add a check before adding the waypoint. Something along the lines of "if x and z then add the waypoint". That should avoid empty waypoints from being added and should solve the OPs original query.
  • 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
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: bug default start location.

#9 Post by BlubBlab » Sun Jun 14, 2015 2:03 pm

If you simple skip it I would at least give a message out.
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

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

Re: bug default start location.

#10 Post by beanybabe » Sun Jun 14, 2015 3:43 pm

This came up when I was making a new waypoint in a public area and testing it and the character just took off running. lucky no one seen it. I thought id post about it in case it might cause others grief.

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

Re: bug default start location.

#11 Post by rock5 » Wed Jun 17, 2015 3:25 am

It shouldn't cause anyone grief. If you manually created a waypoint file and then tested it, if it takes off unexpectedly, you will see it and stop it. No one who sees it will think anything of it. All they will see is a character start to run, stop, then return.
  • 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: bug default start location.

#12 Post by Celesteria » Wed Jun 17, 2015 4:30 am

rock5 wrote:There is no real need to support faulty waypoint like that but it would be extremely easy to add a check before adding the waypoint. Something along the lines of "if x and z then add the waypoint". That should avoid empty waypoints from being added and should solve the OPs original query.
the definition of "faulty waypoint" is relative. an empty waypoint is not a faulty waypoint if you want to use the bot as it is supposed to do (in my understanding). the event-section (onload) is to set variables, define functions and check start properties of the script. the waypoint-section is to handle the bot using the functions defined above. i know, everybody uses the onload-section if there is no need of waypoints, but this is a workaround, not the correct way. from this point of view it should be the correct way to add an empty waypoint to the __WPL as the current location and not to avoid them from being added. this makes the bot perfect and makes sense to everyone who understand a "real programing style" 8-)
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: bug default start location.

#13 Post by rock5 » Wed Jun 17, 2015 4:56 am

Waypoint events are for executing code when you reach a specific location. There is no point in having a waypoint with no coordinates. If you want to execute code where ever you are and don't care about the location then you just do the code in the onload.

You just have to decide; do you want code to run when you reach a location then you put it in a waypoint, or do you want code to run when you load a file then you put it in the onload.
  • 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
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: bug default start location.

#14 Post by BlubBlab » Thu Jun 18, 2015 6:58 pm

Celesteria wrote:
rock5 wrote:There is no real need to support faulty waypoint like that but it would be extremely easy to add a check before adding the waypoint. Something along the lines of "if x and z then add the waypoint". That should avoid empty waypoints from being added and should solve the OPs original query.
the definition of "faulty waypoint" is relative. an empty waypoint is not a faulty waypoint if you want to use the bot as it is supposed to do (in my understanding). the event-section (onload) is to set variables, define functions and check start properties of the script. the waypoint-section is to handle the bot using the functions defined above. i know, everybody uses the onload-section if there is no need of waypoints, but this is a workaround, not the correct way. from this point of view it should be the correct way to add an empty waypoint to the __WPL as the current location and not to avoid them from being added. this makes the bot perfect and makes sense to everyone who understand a "real programing style" 8-)
The problem is an 'empty' waypoint is not defined doing something with it is just guessing what the user maybe meant.
If you want to stay there it is like Rock5 said make a waypoint there and it isn't so that an not defined waypoint had ever worked. On top you can also control the bot with out waypoint manually.
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: bug default start location.

#15 Post by BlubBlab » Sat Jun 20, 2015 5:39 pm

Rock? So what will you do ? I don't want to be impatient but it happened that the last time I left the work on my bot-framework for MM2 . I was building the XML-tree for the waypoint file. Today I got it to work so you can do it either the old way or xml.load(file).

So it would be cool how your code looks like :D , so I can change mine also.
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

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

Re: bug default start location.

#16 Post by rock5 » Sat Jun 20, 2015 10:25 pm

I just changed line 59 of waypointlist.lua from

Code: Select all

		if( string.lower(name) == "waypoint" ) then
to

Code: Select all

		if( string.lower(name) == "waypoint" ) and x and z then
That should stop it from adding empty waypoints to the waypoint list. Then it should trigger the "no waypoints" error message as it's supposed to instead of running off to 0,0.

I'll do a review of my current changes and see about doing a commit.
  • 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

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests