SGather to GatherBuddy2 Converter menu

User Tag List

Results 1 to 5 of 5
  1. #1
    CptJesus's Avatar Site Donator
    Reputation
    25
    Join Date
    May 2007
    Posts
    29
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SGather to GatherBuddy2 Converter

    I already found the GB to SG converter, but I was looking for something to do it the reverse. Couldn't find anything so I wrote one in java. Its messy, but just open the file you want to convert and it'll do its thing. The file will be saved to the same directory where the jar file is.

    Source:
    Code:
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.util.Scanner;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    
    import javax.swing.JFileChooser;
    
    
    public class Main {
    	public static void main(String[] args) throws FileNotFoundException{
    		ConverterClass c = new ConverterClass();
    	}
    	
    	static class ConverterClass{
    		public ConverterClass() throws FileNotFoundException{
    				try {
    					doStuff();
    				} catch (IOException e) {
    					// TODO Auto-generated catch block
    					e.printStackTrace();
    				}
    			}
    		
    		private static void doStuff() throws IOException{
    			String x;
    			String y;
    			String z;
    			boolean cont = true;
    			Pattern p = Pattern.compile(">(.*)<");
    			final JFileChooser fc = new JFileChooser();
    			fc.setCurrentDirectory(new File(new File(".").getAbsolutePath()));
    			fc.showOpenDialog(fc);
    			
    			File f = new File(fc.getSelectedFile().getName().substring(0, fc.getSelectedFile().getName().length() - 4) + " - Converted.xml");
    			FileWriter fw = new FileWriter(f);
    			PrintWriter pw = new PrintWriter(fw);
    			
    			Scanner s = new Scanner(fc.getSelectedFile());
    			
    			//Write the Header for the HB Profile
    			pw.print("<HBProfile>\n\t<Name></Name>\n\t<MinDurability>0.4</MinDurability>\n\t<MinFreeBagSlots>1</MinFreeBagSlots>\n\n" +
    					"\t<MinLevel>1</MinLevel>\n\t<MaxLevel>86</MaxLevel>\n\t<Factions>99999</Factions>\n\n\t<MailGrey>False</MailGrey>\n\t<MailWhite>" +
    					"True</MailWhite>\n\t<MailGreen>True</MailGreen>\n\t<MailBlue>True</MailBlue>\n\t<MailPurple>True</MailPurple>\n\n\t<SellGrey>True</SellGrey>\n\t" +
    					"<SellWhite>True</SellWhite>\n\t<SellGreen>False</SellGreen>\n\t<SellBlue>False</SellBlue>\n\t<SellPurple>False</SellPurple>\n\n\t<Hotspots>");
    			
    			//Write the hotspots
    			while (s.hasNext()){
    				String line = s.nextLine();
    				if (line.contains("<Position>") && cont){
    					line = s.nextLine();
    					Matcher m = p.matcher(line);
    					m.find();
    					x = m.group(1);
    					
    					line = s.nextLine();
    					m = p.matcher(line);
    					m.find();
    					y = m.group(1);
    					
    					line = s.nextLine();
    					m = p.matcher(line);
    					m.find();
    					z = m.group(1);
    					
    					pw.print("\n\t\t<Hotspot X=\"" + x +"\" Y=\"" + y + "\" Z=\"" + z + "\" />");
    				}
    				
    				if (line.contains("/Waypoints")){
    					cont = false;					
    				}
    			}
    			
    			//Write the footer and close
    			pw.print("\n\t</Hotspots>\n</HBProfile>");
    			pw.close();
    		}
    	}
    }
    And yes, my code is not the prettiest...but it works.

    http://dl.dropbox.com/u/15286354/converter.jar

    If you're worried about safety, compile it yourself against the source, should work fine.

    Also, it wont convert the Town Waypoints or Blacklisted Nodes...I'll get around to those eventually. Town Waypoints probably wont be implemented simply because GB2 uses a different system.
    Last edited by CptJesus; 02-04-2011 at 02:41 PM.

    SGather to GatherBuddy2 Converter
  2. #2
    Silvera's Avatar Member
    Reputation
    10
    Join Date
    Oct 2009
    Posts
    139
    Thanks G/R
    0/1
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So what does this do exactly? Convert SGather profiles to GB2 profiles =)?

  3. #3
    Neer's Avatar Trend Rider Authenticator enabled
    Reputation
    1460
    Join Date
    Apr 2007
    Posts
    751
    Thanks G/R
    183/834
    Trade Feedback
    6 (100%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Silvera, did you actually bother to read the title even?

  4. #4
    CptJesus's Avatar Site Donator
    Reputation
    25
    Join Date
    May 2007
    Posts
    29
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Silvera View Post
    So what does this do exactly? Convert SGather profiles to GB2 profiles =)?
    Yep, thats all it does. Takes the hotspots from a SGather profile and turns it into a GatherBuddy2 profile. It currently ignores blacklisted nodes, because I would have to convert them into blackspots

  5. #5
    Silvera's Avatar Member
    Reputation
    10
    Join Date
    Oct 2009
    Posts
    139
    Thanks G/R
    0/1
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by alche001 View Post
    Silvera, did you actually bother to read the title even?
    Yes I did, I was just making sure I understood it correctly.

Similar Threads

  1. [Request] How to convert SGather profile to Piroxbots profile?
    By 191807847 in forum WoW Bots Questions & Requests
    Replies: 0
    Last Post: 02-26-2011, 08:49 AM
  2. [Sgather] Bugazi's Converted Profiles. Mostly Herbs
    By Bugazi in forum WoW Bot Maps And Profiles
    Replies: 2
    Last Post: 12-24-2010, 04:14 PM
  3. [Tool] GB to Sgather profile converter
    By stephen1617 in forum World of Warcraft Bots and Programs
    Replies: 8
    Last Post: 12-02-2010, 04:06 PM
  4. BLP converter?
    By Fault in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 09-17-2006, 11:57 AM
  5. A question about converting
    By krazy12766 in forum World of Warcraft General
    Replies: 2
    Last Post: 08-22-2006, 08:02 PM
All times are GMT -5. The time now is 06:09 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search