Page 1 of 1

Script to show current position

Posted: Tue Mar 30, 2010 8:45 pm
by rock5
Hi guys, I just created a simple script to show your current position as you move.

Useful when testing your newly created waypoint files. Just run it in another window. When you come to a point in your waypoint file you want to change, just pause your waypoint script, move to the correct position, read the co-ords from this script and edit your waypoint file.

Hope people find it useful. Maybe it could be included with the rombot. People let me know what you think.

This was created by stripping down bot.lua and adding a little code. It could probably be stripped further or improved by the administrator.

Administrator, please feel free to further edit it as you please.

Re: Script to show current position

Posted: Tue Mar 30, 2010 9:07 pm
by Administrator
Is this any different than getpos.lua that is included with the bot?

Re: Script to show current position

Posted: Tue Mar 30, 2010 9:53 pm
by rock5
Doh! :oops:

You're probably right. How long has that been there?

Anyway I just tried it and got an error

Code: Select all

...:/Program Files/micromacro/scripts/rom/functions.lua:696: attempt to index global 'database' (a nil value)

Re: Script to show current position

Posted: Wed Mar 31, 2010 12:42 pm
by rock5
Even though getpos.lua is not working I can see from the script that I like mine better.

Even though they should do about the same thing, I made a couple of changes, I think that make it better.

1. Mine only displays the co-ordinates if they change, not just spam the same co-ordinates over and over again.
2. I noticed when I did mine that pressing delete to stop the bot also stopped the pos script. Then I realized there is no need to pause the script. All you need is Ctrl-L to stop it so I disabled the DEL and END buttons.

Do you agree? are these improvements in the functionality?

Re: Script to show current position

Posted: Wed Mar 31, 2010 2:52 pm
by Administrator
I've fixed up the numerous problems that have crept into getpos.lua (due to changes in other files). It's now in at least a working state.
1. Mine only displays the co-ordinates if they change, not just spam the same co-ordinates over and over again.
getpos.lua doesn't spam. Actually, it uses the same, continuously-updating line the whole time.
2. I noticed when I did mine that pressing delete to stop the bot also stopped the pos script. Then I realized there is no need to pause the script. All you need is Ctrl-L to stop it so I disabled the DEL and END buttons.
Yeah, this makes sense. Actually, it looks like you just left the default start and stop/pause keys (F5/F6). You should set them to 0 to disable them.

Re: Script to show current position

Posted: Wed Mar 31, 2010 4:05 pm
by rock5
Administrator wrote:getpos.lua doesn't spam. Actually, it uses the same, continuously-updating line the whole time.
Ah, that's what \r does. Yeah, that looks much better.
Administrator wrote:Yeah, this makes sense. Actually, it looks like you just left the default start and stop/pause keys (F5/F6). You should set them to 0 to disable them.
I've done that. Now it runs just the way I want it.

If "this makes sense" why didn't you implement it?

Re: Script to show current position

Posted: Wed Mar 31, 2010 4:12 pm
by Administrator
rock5 wrote:If "this makes sense" why didn't you implement it?
I made the change after the last commit, and don't think that small of a chance is worthy of a commit by itself. It'll be in the next revision.

Re: Script to show current position

Posted: Thu Apr 01, 2010 7:06 am
by rock5
Administrator wrote:
rock5 wrote:If "this makes sense" why didn't you implement it?
I made the change after the last commit, and don't think that small of a chance is worthy of a commit by itself. It'll be in the next revision.
OK. No probs.