Thread: 667 dumped and packed bonuses!

Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1 667 dumped and packed bonuses! 
    Alition-Gaming


    Join Date
    Dec 2011
    Posts
    817
    Thanks
    44
    Thanked 119 Times in 71 Posts
    Rep Power
    107
    Download bonuses.zip @ UppIT
    these are the bonuses from runewiki as of 4/25

    now to pack them delete the "bonuses.ib" file and make a file called bonuspacker.bat and put this in it
    Code:
    @echo off
    title ITEMS
    "C:/Program Files (x86)/Java/jre7/bin/java.exe" -Xmx512m -cp bin;lib/* com.rs.tools.ItemBonusesPacker
    pause

    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jul 2011
    Posts
    1,462
    Thanks
    429
    Thanked 284 Times in 178 Posts
    Rep Power
    49
    Quote Originally Posted by Beta View Post
    Download bonuses.zip @ UppIT
    these are the bonuses from runewiki as of 4/25

    now to pack them delete the "bonuses.ib" file and make a file called bonuspacker.bat and put this in it
    Code:
    @echo off
    title ITEMS
    "C:/Program Files (x86)/Java/jre7/bin/java.exe" -Xmx512m -cp bin;lib/* com.rs.tools.ItemBonusesPacker
    pause
    It won't pack them at 80% of the people. The packer is not 100% coded. It only reads it.
    Reply With Quote  
     

  3. #3  
    Registered Member SS_Alophonse's Avatar
    Join Date
    Mar 2012
    Posts
    352
    Thanks
    55
    Thanked 21 Times in 15 Posts
    Rep Power
    35
    Thanks still
    Reply With Quote  
     

  4. #4  
    Alition-Gaming


    Join Date
    Dec 2011
    Posts
    817
    Thanks
    44
    Thanked 119 Times in 71 Posts
    Rep Power
    107
    Quote Originally Posted by maffia-rpg View Post
    It won't pack them at 80% of the people. The packer is not 100% coded. It only reads it.
    it packed 100% for me :L

    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Mar 2010
    Posts
    1,108
    Thanks
    227
    Thanked 117 Times in 82 Posts
    Rep Power
    0
    How do I make it pack for my server? :[ DIdn't work, sorry for the fag quesiton x[)
    edit:Nvm got it myself xD fail
    Reply With Quote  
     

  6. #6  
    Registered Member `Basher's Avatar
    Join Date
    May 2011
    Posts
    428
    Thanks
    97
    Thanked 39 Times in 31 Posts
    Rep Power
    23
    Code:
    package com.rs.tools;
    
    import java.io.BufferedWriter;
    import java.io.File;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.net.MalformedURLException;
    
    import com.rs.cache.Cache;
    import com.rs.cache.loaders.ItemDefinitions;
    import com.rs.utils.Utils;
    
    public class RuneWikiBonusDumper {
    
    	public static final void main(String[] args) throws IOException {
    		Cache.init();
    		for(int itemId = 0; itemId < Utils.getItemDefinitionsSize(); itemId++) {
    			if(ItemDefinitions.getItemDefinitions(itemId).isWearItem()) {
    					if (itemId >= Utils.getItemDefinitionsSize()) {
    						return;
    					}
    				if(dumpItem(itemId))
    									if (dumpItem(itemId))
    						System.out.println("Dumped ITEM: "
    								+ itemId
    								+ ", "
    								+ ItemDefinitions.getItemDefinitions(itemId)
    										.getName());
    			}
    		}
    	}
    	
    	public static boolean dumpItem(int itemId) {
    		String pageName = ItemDefinitions.getItemDefinitions(itemId).getName();
    		if(pageName == null || pageName.equals("null"))
    			return false;
    		pageName = pageName.replace("(p)", "");
    		pageName = pageName.replace("(p+)", "");
    		pageName = pageName.replace("(p++)", "");
    		pageName = pageName.replaceAll(" ", "_");
    		try {
    			WebPage page = new WebPage("http://runescape.wikia.com/wiki/"+pageName);
    			try {
    				page.load();
    			}catch (Exception e) {
    				System.out.println("Invalid page: "+itemId+", "+pageName);
    				return false;
    			}
    			
    			int bonusId = 0;
    			int[] bonuses = new int[18];
    			for(String  line : page.getLines()) {
    				
    				if(bonusId == 0 || bonusId == 5) {
    					String replace = "<td colspan=\"2\" width=\"30\" align=\"center\">";
    					if(line.startsWith(replace)) {
    						line = line.replace(replace, "").replaceAll(" ", "").replace("+", "").replace("<br/>", "").replace("+", "").replace("64&nbsp;to100", "");
    						int bonus = Integer.valueOf(line);
    						bonuses[bonusId++] = bonus;
    						continue;
    					}
    				}else if ((bonusId >= 1 && bonusId <= 4) || (bonusId >= 6 && bonusId <= 10)) {
    					String replace = "</td><td colspan=\"2\" width=\"30\" align=\"center\">";
    					if(line.startsWith(replace)) {
    						line = line.replace(replace, "").replaceAll(" ", "").replace("+", "").replace("64to100", "100").replace("+", "").replace("64&nbsp;to100", "");
    						int bonus = Integer.valueOf(line);
    						bonuses[bonusId++] = bonus;
    						continue;
    					}	
    				}else if (bonusId == 11) {
    					String replace = "<td colspan=\"4\" width=\"60\" align=\"center\">";
    					if(line.startsWith(replace)) {
    						line = line.replace(replace, "").replaceAll(" ", "").replace("%", "").replace(".0", "").replace("+", "").replace("64&nbsp;to100", "");
    						int bonus = Integer.valueOf(line);
    						bonuses[bonusId++] = bonus;
    						continue;
    					}	
    				}else if (bonusId == 12 || bonusId == 13) {
    						String replace = "</td><td colspan=\"4\" width=\"60\" align=\"center\">";
    						if(line.startsWith(replace)) {
    							line = line.replace(replace, "").replaceAll(" ", "").replace("%", "").replace(".0", "").replace("+", "").replace("64&nbsp;to100", "");
    							int bonus = Integer.valueOf(line);
    							bonuses[bonusId++] = bonus;
    							continue;
    						}	
    				}else if (bonusId == 14) {
    					String replace = "<td colspan=\"3\" width=\"45\" align=\"center\">";
    					if(line.startsWith(replace)) {
    						line = line.replace(replace, "").replaceAll(" ", "").replace("+", "").replace(".0", "").replace(".1", "").replace(".5", "").replace("+", "").replace("64&nbsp;to100", "");
    						int bonus = Integer.valueOf(line);
    						bonuses[bonusId++] = bonus;
    						continue;
    					}	
    				}else if (bonusId >= 15 && bonusId <= 17) {
    					String replace = "</td><td colspan=\"3\" width=\"45\" align=\"center\">";
    					if(line.startsWith(replace)) {
    						line = line.replace(replace, "").replaceAll(" ", "").replace("%", "").replace("+", "").replace(".0", "").replace("52to70", "70").replace("0(4trimmed)", "4").replace("15(Slayertasksonly)", "0").replace(".5", "").replace("?", "0").replace("<i>Varies</i>", "0").replace("+", "").replace("64&nbsp;to100", "");
    						int bonus = Integer.valueOf(line);
    						bonuses[bonusId++] = bonus;
    						if(bonusId == 18)
    							break;
    						continue;
    					}	
    				}
    			}
    			
    			if(bonusId != 18)
    				return false;
    			boolean end = true;
    			for(int bonus : bonuses) {
    				if(bonus != 0)  {
    					end = false;
    					break;
    				}
    			}
    			if(end)
    				return false;
    			try {
    				BufferedWriter writer = new BufferedWriter(new FileWriter("bonuses/"+itemId+".txt"));
    				writer.write("Attack bonus");//BASHER WAS HERE
    				writer.newLine();
    				writer.flush();
    				for(int index = 0; index < 5; index++) {
    					writer.write(""+bonuses[index]);
    					writer.newLine();
    					writer.flush();
    				}
    				writer.write("Defence bonus");
    				writer.newLine();
    				writer.flush();
    				for(int index = 5; index < 11; index++) {
    					writer.write(""+bonuses[index]);
    					writer.newLine();
    					writer.flush();
    				}
    				writer.write("Damage absorption");
    				writer.newLine();
    				writer.flush();
    				for(int index = 11; index < 14; index++) {
    					writer.write(""+bonuses[index]);
    					writer.newLine();
    					writer.flush();
    				}
    				writer.write("Other bonuses");
    				writer.newLine();
    				writer.flush();
    				for(int index = 14; index < 18; index++) {
    					writer.write(""+bonuses[index]);
    					writer.newLine();
    					writer.flush();
    				}
    				writer.close();
    			} catch (IOException e) {
    				e.printStackTrace();
    			}
    			return true;
    		} catch (MalformedURLException e) {
    			e.printStackTrace();
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    		return false;
    	}
    	
    }
    If you want to get bonuses on your own just use this RuneWikiBonusDumper and the packer should work fine.

    *Also create a new file called bonuses were the .bats are handled.
    ▒▐█▀▄░ ▄▀▄ ▄▀▀ █░░ █▀▀ █▀▀▄
    ▒▐█▀▀▄ █▀█ ░▀▄ █▀▄ █▀▀ █▐█▀
    ▒▐█▄▄▀ ▀░▀ ▀▀░ ▀░▀ ▀▀▀ ▀░▀▀
    Done with RSPS!
    Reply With Quote  
     

  7. #7  
    Donator


    Join Date
    Sep 2006
    Age
    19
    Posts
    2,094
    Thanks
    73
    Thanked 53 Times in 43 Posts
    Rep Power
    491
    Quote Originally Posted by `Basher View Post
    Code:
    package com.rs.tools;
    
    import java.io.BufferedWriter;
    import java.io.File;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.net.MalformedURLException;
    
    import com.rs.cache.Cache;
    import com.rs.cache.loaders.ItemDefinitions;
    import com.rs.utils.Utils;
    
    public class RuneWikiBonusDumper {
    
        public static final void main(String[] args) throws IOException {
            Cache.init();
            for(int itemId = 0; itemId < Utils.getItemDefinitionsSize(); itemId++) {
                if(ItemDefinitions.getItemDefinitions(itemId).isWearItem()) {
                        if (itemId >= Utils.getItemDefinitionsSize()) {
                            return;
                        }
                    if(dumpItem(itemId))
                                        if (dumpItem(itemId))
                            System.out.println("Dumped ITEM: "
                                    + itemId
                                    + ", "
                                    + ItemDefinitions.getItemDefinitions(itemId)
                                            .getName());
                }
            }
        }
        
        public static boolean dumpItem(int itemId) {
            String pageName = ItemDefinitions.getItemDefinitions(itemId).getName();
            if(pageName == null || pageName.equals("null"))
                return false;
            pageName = pageName.replace("(p)", "");
            pageName = pageName.replace("(p+)", "");
            pageName = pageName.replace("(p++)", "");
            pageName = pageName.replaceAll(" ", "_");
            try {
                WebPage page = new WebPage("http://runescape.wikia.com/wiki/"+pageName);
                try {
                    page.load();
                }catch (Exception e) {
                    System.out.println("Invalid page: "+itemId+", "+pageName);
                    return false;
                }
                
                int bonusId = 0;
                int[] bonuses = new int[18];
                for(String  line : page.getLines()) {
                    
                    if(bonusId == 0 || bonusId == 5) {
                        String replace = "<td colspan=\"2\" width=\"30\" align=\"center\">";
                        if(line.startsWith(replace)) {
                            line = line.replace(replace, "").replaceAll(" ", "").replace("+", "").replace("<br/>", "").replace("+", "").replace("64&nbsp;to100", "");
                            int bonus = Integer.valueOf(line);
                            bonuses[bonusId++] = bonus;
                            continue;
                        }
                    }else if ((bonusId >= 1 && bonusId <= 4) || (bonusId >= 6 && bonusId <= 10)) {
                        String replace = "</td><td colspan=\"2\" width=\"30\" align=\"center\">";
                        if(line.startsWith(replace)) {
                            line = line.replace(replace, "").replaceAll(" ", "").replace("+", "").replace("64to100", "100").replace("+", "").replace("64&nbsp;to100", "");
                            int bonus = Integer.valueOf(line);
                            bonuses[bonusId++] = bonus;
                            continue;
                        }    
                    }else if (bonusId == 11) {
                        String replace = "<td colspan=\"4\" width=\"60\" align=\"center\">";
                        if(line.startsWith(replace)) {
                            line = line.replace(replace, "").replaceAll(" ", "").replace("%", "").replace(".0", "").replace("+", "").replace("64&nbsp;to100", "");
                            int bonus = Integer.valueOf(line);
                            bonuses[bonusId++] = bonus;
                            continue;
                        }    
                    }else if (bonusId == 12 || bonusId == 13) {
                            String replace = "</td><td colspan=\"4\" width=\"60\" align=\"center\">";
                            if(line.startsWith(replace)) {
                                line = line.replace(replace, "").replaceAll(" ", "").replace("%", "").replace(".0", "").replace("+", "").replace("64&nbsp;to100", "");
                                int bonus = Integer.valueOf(line);
                                bonuses[bonusId++] = bonus;
                                continue;
                            }    
                    }else if (bonusId == 14) {
                        String replace = "<td colspan=\"3\" width=\"45\" align=\"center\">";
                        if(line.startsWith(replace)) {
                            line = line.replace(replace, "").replaceAll(" ", "").replace("+", "").replace(".0", "").replace(".1", "").replace(".5", "").replace("+", "").replace("64&nbsp;to100", "");
                            int bonus = Integer.valueOf(line);
                            bonuses[bonusId++] = bonus;
                            continue;
                        }    
                    }else if (bonusId >= 15 && bonusId <= 17) {
                        String replace = "</td><td colspan=\"3\" width=\"45\" align=\"center\">";
                        if(line.startsWith(replace)) {
                            line = line.replace(replace, "").replaceAll(" ", "").replace("%", "").replace("+", "").replace(".0", "").replace("52to70", "70").replace("0(4trimmed)", "4").replace("15(Slayertasksonly)", "0").replace(".5", "").replace("?", "0").replace("<i>Varies</i>", "0").replace("+", "").replace("64&nbsp;to100", "");
                            int bonus = Integer.valueOf(line);
                            bonuses[bonusId++] = bonus;
                            if(bonusId == 18)
                                break;
                            continue;
                        }    
                    }
                }
                
                if(bonusId != 18)
                    return false;
                boolean end = true;
                for(int bonus : bonuses) {
                    if(bonus != 0)  {
                        end = false;
                        break;
                    }
                }
                if(end)
                    return false;
                try {
                    BufferedWriter writer = new BufferedWriter(new FileWriter("bonuses/"+itemId+".txt"));
                    writer.write("Attack bonus");//BASHER WAS HERE
                    writer.newLine();
                    writer.flush();
                    for(int index = 0; index < 5; index++) {
                        writer.write(""+bonuses[index]);
                        writer.newLine();
                        writer.flush();
                    }
                    writer.write("Defence bonus");
                    writer.newLine();
                    writer.flush();
                    for(int index = 5; index < 11; index++) {
                        writer.write(""+bonuses[index]);
                        writer.newLine();
                        writer.flush();
                    }
                    writer.write("Damage absorption");
                    writer.newLine();
                    writer.flush();
                    for(int index = 11; index < 14; index++) {
                        writer.write(""+bonuses[index]);
                        writer.newLine();
                        writer.flush();
                    }
                    writer.write("Other bonuses");
                    writer.newLine();
                    writer.flush();
                    for(int index = 14; index < 18; index++) {
                        writer.write(""+bonuses[index]);
                        writer.newLine();
                        writer.flush();
                    }
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                return true;
            } catch (MalformedURLException e) {
                e.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return false;
        }
        
    }
    If you want to get bonuses on your own just use this RuneWikiBonusDumper and the packer should work fine.

    *Also create a new file called bonuses were the .bats are handled.
    Hey dude how come your wiki dumper cuts out at 20000+? says invalid page
    Reply With Quote  
     

  8. #8  
    Registered Member SS_Alophonse's Avatar
    Join Date
    Mar 2012
    Posts
    352
    Thanks
    55
    Thanked 21 Times in 15 Posts
    Rep Power
    35
    Quote Originally Posted by SS_Alophonse View Post
    Thanks still
    my dumper worksperfect i use runewikibonusdumper and it packs everything it had to pack correctly
    Reply With Quote  
     

  9. #9  
    Alition-Gaming


    Join Date
    Dec 2011
    Posts
    817
    Thanks
    44
    Thanked 119 Times in 71 Posts
    Rep Power
    107
    guys i did this so you wouldnt have to sit there for a year waiting L

    Reply With Quote  
     

  10. #10  
    Registered Member `Basher's Avatar
    Join Date
    May 2011
    Posts
    428
    Thanks
    97
    Thanked 39 Times in 31 Posts
    Rep Power
    23
    Quote Originally Posted by Pixel View Post
    Hey dude how come your wiki dumper cuts out at 20000+? says invalid page
    It shouldn't do that for long sometimes the pages either haven't been created for that item or the dumper doesn't have a special symbol for that item.
    ▒▐█▀▄░ ▄▀▄ ▄▀▀ █░░ █▀▀ █▀▀▄
    ▒▐█▀▀▄ █▀█ ░▀▄ █▀▄ █▀▀ █▐█▀
    ▒▐█▄▄▀ ▀░▀ ▀▀░ ▀░▀ ▀▀▀ ▀░▀▀
    Done with RSPS!
    Reply With Quote  
     


Page 1 of 2 12 LastLast
Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 13
    Last Post: 07-04-2012, 11:23 AM
  2. 667 item bonuses?!?
    By Beta in forum Help
    Replies: 6
    Last Post: 06-08-2012, 09:15 PM
  3. How to edit item bonuses 667/711
    By edgar1016 in forum Help
    Replies: 13
    Last Post: 04-18-2012, 11:39 PM
  4. 667 add bonuses to items
    By Zond in forum Help
    Replies: 5
    Last Post: 03-30-2012, 01:54 PM
  5. 667/681 packed files.
    By kingcobra805 in forum Requests
    Replies: 1
    Last Post: 03-08-2012, 02:34 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •