What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

[Plugin] Mapping Tool

swolbyn

New Member
Joined
Apr 24, 2010
Messages
796
Reaction score
7
Basically, I find it annoying to manually get my position via the info dumping tab in the bot, one by one then paste into a profile. I created this tool to assist me in this.

This tool binds two hotkeys:
F1 - Adds a single way point to the buffer
F2 - Takes all of the way points in the buffer and copies them to the clipboard (also clears the buffer) Only used for LogMode of "clipboard" or "both"
F3 - Increases pathPrecision by 5
F4 - Decreases pathPrecision by 5

You can change the variable "LogMode" at the top of the file. This changes if you use only clipboard functionality, only logFile dumping or a combination of both.

Just enable the plugin in game, load the Combat Bot.xml profile and run around playing the map. recording way points with F1 as you go. Keep the profile in mind. Record in batches because this simply helps you create blocks of moveto's for use in your profiles. When you are done with a block, press F2 to copy to your clipboard, then switch over to your text editor / IDE and paste the block into your profile xml.

Update: added v0.2 tweaked the thread code a bit. let me know if this improves for the folks who are having problems.
Update: Many thanks to sinterlkaas and Giles for their contributions, i've rolled together new clipboard changes as well as the logFile functionality and added a "LogMode" setting you can adjust yourself for your preference.

***NOTE**** disable all plugins while you are using this to avoid problems. I've done all my testing with only my plugin enabled. Tested 100+ waypoints and it seems to work fine.
 

Attachments

Last edited:
just tested this out. did probably 60+ WP with F1 key finished my run Pressed f2 and it said Copying and then Db crashed :S

tried with 1 Wp and db crashed again
 
Looks useful, but can't get it to work. Nothing was in the clipboard after I F2ed. Using latest version of DB and instructions followed (I think)
 
Deleting that line will remove the clipboard functionality... Hmm.. it's not working for you guys? Seems to still work for me...

I will see if I can figure out another way to utilize the clipboard
 
try using this ...

Code:
 [DllImport("user32.dll", SetLastError = true)]
        static extern bool OpenClipboard(IntPtr hWndNewOwner);
        [DllImport("user32.dll")]
        static extern bool EmptyClipboard();

        [DllImport("user32.dll", SetLastError = true)]
        static extern int SetClipboardData(int uFormat, IntPtr hMem);

        [DllImport("user32.dll", SetLastError = true)]
        static extern bool CloseClipboard();

        enum format : int
        {
            CF_TEXT = 1,
            CF_BITMAP = 2,
            CF_SYLK = 4,
            CF_DIF = 5,
            CF_TIFF = 6,
            CF_OEMTEXT = 7,
            CF_DIB = 8,
            CF_PALETTE = 9,
            CF_PENDATA = 10,
            CF_RIFF = 11,
            CF_WAVE = 12,
            CF_UNICODETEXT = 13,
        }



public static void SetClipboardText(string text)
        {
            try
            {
                if (OpenClipboard(IntPtr.Zero))
                {
                    if (EmptyClipboard())
                    {
                        IntPtr hClipboard = Marshal.StringToHGlobalAnsi(text);
                        SetClipboardData((int)format.CF_TEXT, hClipboard);
                        Marshal.FreeHGlobal(hClipboard);
                    }
                    else
                        Console.WriteLine("empty clipboard failed");
                    CloseClipboard();
                    
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
 
Deleting that line will remove the clipboard functionality... Hmm.. it's not working for you guys? Seems to still work for me...

I will see if I can figure out another way to utilize the clipboard

Shouldnt you just open a save file dialog and serialize the stuff to xml :) ?
 
Shouldnt you just open a save file dialog and serialize the stuff to xml :) ?

I did not want to save the content into a file. clipboard makes more sense in usefulness to me. it's working great for me.
 
try using this ...

Code:
 [DllImport("user32.dll", SetLastError = true)]
        static extern bool OpenClipboard(IntPtr hWndNewOwner);
        [DllImport("user32.dll")]
        static extern bool EmptyClipboard();

        [DllImport("user32.dll", SetLastError = true)]
        static extern int SetClipboardData(int uFormat, IntPtr hMem);

        [DllImport("user32.dll", SetLastError = true)]
        static extern bool CloseClipboard();

        enum format : int
        {
            CF_TEXT = 1,
            CF_BITMAP = 2,
            CF_SYLK = 4,
            CF_DIF = 5,
            CF_TIFF = 6,
            CF_OEMTEXT = 7,
            CF_DIB = 8,
            CF_PALETTE = 9,
            CF_PENDATA = 10,
            CF_RIFF = 11,
            CF_WAVE = 12,
            CF_UNICODETEXT = 13,
        }



public static void SetClipboardText(string text)
        {
            try
            {
                if (OpenClipboard(IntPtr.Zero))
                {
                    if (EmptyClipboard())
                    {
                        IntPtr hClipboard = Marshal.StringToHGlobalAnsi(text);
                        SetClipboardData((int)format.CF_TEXT, hClipboard);
                        Marshal.FreeHGlobal(hClipboard);
                    }
                    else
                        Console.WriteLine("empty clipboard failed");
                    CloseClipboard();
                    
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }

Thanks. I will toy with this some over the weekend. In the meantime if anybody wants to comment out the clipboard line, you can just copy and paste it manually from the DB log output. it dumps it there also when F2 is pressed.
 
As a side note. Is anybody else (other than me) having this tool work for them without issues?
 
It craps out when the waypoints reach a certain ammount :)

Interesting. might be a limitation with the clipboard. I may make a config that toggles between clipboard or dumping to a file. I'd say the majority of people probably wont be doing giant bulk amounts of 50+.... seems kind of silly and no map in the game really requires that many waypoints to navigate. (in a single step of a quest i mean). Each time you clear the buffer it starts fresh.
 
This will Fix Db from crashing? and then how would i get my info? :P

Its in the DB log window also... highlight and copy it. ... but honestly just do smaller chunks of waypoints... 5-20 waypoint batches should be fine. i tested it quite a bit just not with HUGE blocks.
 
Great idea. Thanks for sharing this. I did find issues using the buffers/clipboard method when adding too many, and I also wanted a quick way to change path precision. I have changed this plugin so that;
F1 adds waypoints to a logfile in the plugin folder (with date-separation for different sessions).
F2 increases pathprecision (up to max of 30).
F3 decreases pathprecision (down to 0 - and if at 0, path precision isn't added to the moveto commands).

Buffering/clipboard stuff no longer necessary. I've attached the modified code @ the bottom of this post, if you want to use this for future updates. Below is a sample log-file output;
Code:
<!-- Following added after 21/07/2012 00:14:44 -->
<MoveTo questId="1" x="3006.099" y="2835.355" z="24.04533" pathPrecision="15" />
<MoveTo questId="1" x="2989.098" y="2847.273" z="24.04535" pathPrecision="15" />
<MoveTo questId="1" x="2960.726" y="2851.272" z="24.04533" pathPrecision="8" />
<MoveTo questId="1" x="2944.267" y="2836.651" z="23.93551" pathPrecision="8" />
<MoveTo questId="1" x="2946.63" y="2812.509" z="24.04533" pathPrecision="5" />

<!-- Following added after 21/07/2012 00:15:38 -->
<MoveTo questId="1" x="2986.726" y="2718.157" z="24.04533" pathPrecision="2" />
<MoveTo questId="1" x="2963.167" y="2707.963" z="24.04533" pathPrecision="1" />
<MoveTo questId="1" x="2953.437" y="2684.229" z="23.70111" />

This does require the plugin to be in a folder called "MappingTool". I haven't added any safety checks to make sure this is the case before trying to create the logfile. A quick "if (!Directory.Exists(<path string>)" with a log output to DB and a graceful fail telling the user to check folder names could be added easily :)
 
Last edited:
Its in the DB log window also... highlight and copy it. ... but honestly just do smaller chunks of waypoints... 5-20 waypoint batches should be fine. i tested it quite a bit just not with HUGE blocks.
''

I did 2 WP and it crashed DB when i pressed f2...so
 
Great idea. Thanks for sharing this. I did find issues using the buffers/clipboard method when adding too many, and I also wanted a quick way to change path precision. I have changed this plugin so that;
F1 adds waypoints to a logfile in the plugin folder (with date-separation for different sessions).
F2 increases pathprecision (up to max of 30).
F3 decreases pathprecision (down to 0 - and if at 0, path precision isn't added to the moveto commands).

Buffering/clipboard stuff no longer necessary. I've attached the modified code @ the bottom of this post, if you want to use this for future updates. Below is a sample log-file output;
Code:
<!-- Following added after 21/07/2012 00:14:44 -->
<MoveTo questId="1" x="3006.099" y="2835.355" z="24.04533" pathPrecision="15" />
<MoveTo questId="1" x="2989.098" y="2847.273" z="24.04535" pathPrecision="15" />
<MoveTo questId="1" x="2960.726" y="2851.272" z="24.04533" pathPrecision="8" />
<MoveTo questId="1" x="2944.267" y="2836.651" z="23.93551" pathPrecision="8" />
<MoveTo questId="1" x="2946.63" y="2812.509" z="24.04533" pathPrecision="5" />

<!-- Following added after 21/07/2012 00:15:38 -->
<MoveTo questId="1" x="2986.726" y="2718.157" z="24.04533" pathPrecision="2" />
<MoveTo questId="1" x="2963.167" y="2707.963" z="24.04533" pathPrecision="1" />
<MoveTo questId="1" x="2953.437" y="2684.229" z="23.70111" />

This does require the plugin to be in a folder called "MappingTool". I haven't added any safety checks to make sure this is the case before trying to create the logfile. A quick "if (!Directory.Exists(<path string>)" with a log output to DB and a graceful fail telling the user to check folder names could be added easily :)

Very cool. Those with issues feel free to use this one for now. I personally still wish to keep clipboard functionality in. I don't want to swap to files back and forth to paste things around. I'll use parts of your version and hopefully integrate a toggle between the two modes. Very nice work giles. Thanks
 
Back
Top