Waypoint Renumbering
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Only post additional bot resources here. Please do not ask unrelated questions.
Waypoint Renumbering
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.
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
Re: Waypoint Renumbering
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
Re: Waypoint Renumbering
Thanks rock. That's high praise indeed coming from you.
Re: Waypoint Renumbering
Thank you very much for sharing this. Works like a charm.
Scout/Knight/Rogue 70/66/66
Re: Waypoint Renumbering
Great. glad I could help.
-
- Posts: 61
- Joined: Sun Jul 10, 2011 10:39 pm
Re: Waypoint Renumbering
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
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
Re: Waypoint Renumbering
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
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
Re: Waypoint Renumbering
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.
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.
Re: Waypoint Renumbering
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:
ric
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
- Attachments
-
- renumber.lua
- Version 0.1
- (2.54 KiB) Downloaded 224 times
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests