Waypoint Renumbering

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.
Post Reply
Message
Author
Tooney
Posts: 26
Joined: Fri Oct 07, 2011 12:48 am

Waypoint Renumbering

#1 Post by Tooney » Sat Oct 08, 2011 6:08 pm

I know there's an AutoIt script already to do this but I don't use AutoIt so I made a userfunction for renumbering waypoint files.
Usage is Renumber("YourWayPointFile") and it saves a renumbered copy.
I'm sure it could be done better with RegEx but it works on the handful of files I tried.

Feedback welcomed.
Attachments
userfunction_Renumber.zip
A waypoint renumbering userfunction.
(761 Bytes) Downloaded 270 times

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

Re: Waypoint Renumbering

#2 Post by rock5 » Sat Oct 08, 2011 8:40 pm

Well done. Nice and neat code.
  • 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

Tooney
Posts: 26
Joined: Fri Oct 07, 2011 12:48 am

Re: Waypoint Renumbering

#3 Post by Tooney » Sun Oct 09, 2011 1:38 am

Thanks rock. That's high praise indeed coming from you.

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Waypoint Renumbering

#4 Post by kanta » Wed Oct 12, 2011 8:20 am

Thank you very much for sharing this. Works like a charm.
Scout/Knight/Rogue 70/66/66

Tooney
Posts: 26
Joined: Fri Oct 07, 2011 12:48 am

Re: Waypoint Renumbering

#5 Post by Tooney » Wed Oct 12, 2011 3:22 pm

Great. glad I could help.

imaginethat
Posts: 61
Joined: Sun Jul 10, 2011 10:39 pm

Re: Waypoint Renumbering

#6 Post by imaginethat » Wed Nov 09, 2011 7:21 pm

Hi Tooney
wow, this is awesome, and works perfectly. Really nicely done.

I was not actually sure how you intended for it to be implemented, started, but I added a couple of lines of code to make it standalone, so you could just run "rom\renumber" from the MicroMacro window and it would do the renumbering. This means the game does not need to be running etc.

So I created "Renumber.lua" file, containing your awesome function, and wrapped it in a function main()

You add the name of the file to the main function and then run "rom\renumber" from the MM window and you are good to go.

Thanks Tooney
Attachments
Renumber.lua
(1.83 KiB) Downloaded 201 times

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

Re: Waypoint Renumbering

#7 Post by rock5 » Wed Nov 09, 2011 10:54 pm

Excellent. But you should be able to specify the file name as an argument.

If you look at bot.lua as an example, around line 72, you will see how it uses arguments. If you include it in your file then you could use something like this

Code: Select all

rom\renumber waypointfile.xml
  • 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

Tooney
Posts: 26
Joined: Fri Oct 07, 2011 12:48 am

Re: Waypoint Renumbering

#8 Post by Tooney » Fri Nov 11, 2011 3:40 am

Thanks for your comments.
I like what you've done. It hadn't occurred to me that people would want it offline. It was intended to be run via RomBot's commandline option.
I also like Rock's idea of adding the file name as an argument.

Cheers,
Tooney.

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Waypoint Renumbering

#9 Post by Rickster » Fri Dec 09, 2011 8:06 pm

Nice script :)

I added a filename input option in main() so you can start the script without an argument. the script asks for a filename itself, so its easy to make a windows shortcut just starting the script.

Else I extended Renumber() not only to check if filname == nil but also to check if filename == "".
Then I put the whole part for renumbering in an else part, so that there will not be an empty file ("_renumbered") created when filename is nil or empty. So nil should never occure, because at least an empty string is given as an argument when Renumber(filename) is called in main().

Long story short, just place renumber.lua in MM/scripts/rom and make a win shortcut to start:

Code: Select all

.\micromacro\micromacro.exe scripts/rom/renumber.lua
ric
Attachments
renumber.lua
Version 0.1
(2.54 KiB) Downloaded 224 times

Tooney
Posts: 26
Joined: Fri Oct 07, 2011 12:48 am

Re: Waypoint Renumbering

#10 Post by Tooney » Sat Dec 10, 2011 2:08 am

Nice work Rickster.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests