Thread: 667 Item Finder

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 667 Item Finder 
    Registered Member
    Join Date
    Jan 2015
    Age
    28
    Posts
    210
    Thanks given
    2
    Thanks received
    53
    Rep Power
    2
    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:
    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");
    	}
    }
    And then go to wherever you want this tool to be, and create a .bat file named "ItemFinder"

    In that .bat file, copy and paste the following:
    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
    Hopefully you will find this useful!
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jun 2012
    Posts
    126
    Thanks given
    1
    Thanks received
    10
    Rep Power
    10
    If you wrote this urself then good job man.
    Reply With Quote  
     

  3. #3  
    Member 667 Item Finder Market Banned
    Mr Joopz's Avatar
    Join Date
    Aug 2012
    Age
    26
    Posts
    1,410
    Thanks given
    259
    Thanks received
    96
    Rep Power
    14
    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");
    	}
    }
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Mar 2010
    Posts
    2,218
    Thanks given
    170
    Thanks received
    262
    Rep Power
    0
    Reply With Quote  
     

  5. #5  
    Member 667 Item Finder Market Banned
    Mr Joopz's Avatar
    Join Date
    Aug 2012
    Age
    26
    Posts
    1,410
    Thanks given
    259
    Thanks received
    96
    Rep Power
    14
    Quote Originally Posted by Teek View Post
    Itemdb isn't going to check your player files for items now is it?
    Reply With Quote  
     

  6. #6  
    :^)

    ___.'s Avatar
    Join Date
    Nov 2013
    Posts
    227
    Thanks given
    209
    Thanks received
    157
    Rep Power
    100
    Quote Originally Posted by Teek View Post
    Did you even read the code?
    Reply With Quote  
     

  7. #7  
    Donator


    Join Date
    Jul 2013
    Posts
    1,233
    Thanks given
    1
    Thanks received
    493
    Rep Power
    0
    http://www.rune-server.org/runescape...ml#post4869927 isnt this the same thing?

    *Other than your input for an id
    Reply With Quote  
     

  8. #8  
    Banned
    Join Date
    Dec 2012
    Posts
    558
    Thanks given
    24
    Thanks received
    115
    Rep Power
    0
    why is all the logic in the try statement
    Reply With Quote  
     

  9. #9  
    Registered Member

    Join Date
    Feb 2010
    Posts
    715
    Thanks given
    133
    Thanks received
    378
    Rep Power
    550
    Code:
    for (int id = 0; id < 30000; id++) {
    ...
    								if (id == itemID){
    Nice.
    Reply With Quote  
     

  10. Thankful user:


  11. #10  
    Banned
    Join Date
    Jul 2012
    Age
    27
    Posts
    996
    Thanks given
    646
    Thanks received
    266
    Rep Power
    0
    Neato, thanks for the share.
    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)


User Tag List

Similar Threads

  1. Adding 667+ items
    By Phat Stacks in forum Help
    Replies: 2
    Last Post: 03-20-2012, 11:06 PM
  2. 667 Item Models GZipped.
    By Miner in forum Models
    Replies: 4
    Last Post: 12-21-2011, 08:19 PM
  3. 667 item models
    By Celeroni in forum Requests
    Replies: 7
    Last Post: 11-10-2011, 04:56 AM
  4. Buying 667 items/Auto cache downloader
    By B B F in forum Buying
    Replies: 5
    Last Post: 10-28-2011, 06:27 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •