If you wrote this urself then good job man.
|
Hello! I was just looking around for an item I couldn't find in my logs, so I wrote this quick ItemFinder that will tell you who has that item and how many of that item are in game.
Make a new class in src.com.rs.tools named "ItemFinder.java"
In this class, copy and paste the following code:
And then go to wherever you want this tool to be, and create a .bat file named "ItemFinder"Code:package com.rs.tools; import java.io.File; import java.io.IOException; import java.util.Scanner; import com.rs.cache.Cache; import com.rs.game.item.Item; import com.rs.game.player.Player; import com.rs.utils.SerializableFilesManager; import com.rs.utils.Utils; import com.rs.cache.loaders.ItemDefinitions; public class ItemFinder { public static void main(String[] args) { try { Cache.init(); } catch (IOException e) { e.printStackTrace(); } System.out.println("Enter Item ID:"); Scanner in = new Scanner(System.in); int itemID = in.nextInt(); Item i = new Item(itemID); String itemName = i.getDefinitions().getName(); System.out.println("Searching for item: "+itemName); File[] chars = new File("data/saves").listFiles(); int counter =0; for (File acc : chars) { try { Player player = (Player) SerializableFilesManager .loadSerializedFile(acc); try { for (int id = 0; id < 30000; id++) { try { Item item = player.getBank().getItem(id); if (item == null) continue; if (id == itemID){ counter++; System.out.println(acc.getName() + " has at least one of:"+itemName); } } catch(Exception k) { k.printStackTrace(); } } } catch(Exception e) { e.printStackTrace(); } try { for (Item item : player.getInventory().getItems().getItems()) { if (item == null) continue; if (item.getId() == itemID) { counter++; System.out.println(acc.getName() + " has at least one of:"+itemName); } } } catch(Exception e) { } try { for (Item item : player.getEquipment().getItems().getItems()) { if (item == null) continue; if (item.getId() == itemID){ counter++; System.out.println(acc.getName() + " has at least one of:"+itemName); } } } catch(Exception e) { } } catch (Throwable e) { } } System.out.println("Done searching for item: "+itemName); System.out.println("There are " +counter +" " +itemName+ "s ingame"); } }
In that .bat file, copy and paste the following:
Hopefully you will find this useful!Code:@echo off title Achilles667 ItemFinder echo starting... "C:\Program Files\Java\jdk1.7.0_75/bin/java.exe" -Xmx512m -cp bin;lib/* com.rs.tools.ItemFinder true true false pause
If you wrote this urself then good job man.
Nice work buddy
P-S Added a simple code to your system output to display the amount of the item the player has.
Code:package com.rs.tools; import java.io.File; import java.io.IOException; import java.util.Scanner; import com.rs.cache.Cache; import com.rs.game.item.Item; import com.rs.game.player.Player; import com.rs.utils.SerializableFilesManager; import com.rs.utils.Utils; import com.rs.cache.loaders.ItemDefinitions; public class ItemFinder { public static void main(String[] args) { try { Cache.init(); } catch (IOException e) { e.printStackTrace(); } System.out.println("Enter Item ID:"); Scanner in = new Scanner(System.in); int itemID = in.nextInt(); Item i = new Item(itemID); String itemName = i.getDefinitions().getName(); System.out.println("Searching for item: "+itemName); File[] chars = new File("data/characters").listFiles(); int counter =0; for (File acc : chars) { try { Player player = (Player) SerializableFilesManager .loadSerializedFile(acc); try { for (int id = 0; id < 30000; id++) { try { Item item = player.getBank().getItem(id); if (item == null) continue; if (id == itemID){ counter += item.getAmount(); System.out.println(acc.getName() + " has at "+item.getAmount()+" one of:"+itemName); } } catch(Exception k) { k.printStackTrace(); } } } catch(Exception e) { e.printStackTrace(); } try { for (Item item : player.getInventory().getItems().getItems()) { if (item == null) continue; if (item.getId() == itemID) { counter += item.getAmount(); System.out.println(acc.getName() + " has at "+item.getAmount()+" one of:"+itemName); } } } catch(Exception e) { } try { for (Item item : player.getEquipment().getItems().getItems()) { if (item == null) continue; if (item.getId() == itemID){ counter += item.getAmount(); System.out.println(acc.getName() + " has at "+item.getAmount()+" one of:"+itemName); } } } catch(Exception e) { } } catch (Throwable e) { } } System.out.println("Done searching for item: "+itemName); System.out.println("There are " +counter +" " +itemName+ "s ingame"); } }
http://www.rune-server.org/runescape...ml#post4869927 isnt this the same thing?
*Other than your input for an id
why is all the logic in the try statement
Nice.Code:for (int id = 0; id < 30000; id++) { ... if (id == itemID){
Neato, thanks for the share.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |