Thread: ItemReseter

Results 1 to 4 of 4
  1. #1 ItemReseter 
    Registered Member
    Markian's Avatar
    Join Date
    Apr 2009
    Posts
    613
    Thanks given
    17
    Thanks received
    26
    Rep Power
    373
    This is what I have at the moment (EconomyReset.java):

    Code:
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.DataInputStream;
    import java.io.BufferedWriter;
    import java.io.FileWriter;
    
    public class EconomyReset
    {
    
    	private static File charDir = new File("./characters/");
    
    	public static void main(String[] args)
    	{
    		if(charDir.exists() && charDir.isDirectory())
    		{
    			File[] charFiles = charDir.listFiles();
    		for(int i = 0; i < charFiles.length; i++)
    		{
    			resetEcoChar(charFiles[i]);
    			System.out.println("Reset player economy levels for... "+charFiles[i].toString());
    			}
    		}
    	}
    
    	private static void resetEcoChar(File charFile)
    	{
    		try
    		{
    
    			String cheatStatus, tempData, tempAdd = ""; int curEquip = 0, curItem = 0, curBank = 0;
    			File tempCharFile = new File(charDir.toString()+"ECOBOOST$TEMP");
    			DataInputStream fileStream = new DataInputStream(new FileInputStream(charFile));
    			BufferedWriter tempOut = new BufferedWriter(new FileWriter(tempCharFile));
    
    		while((tempData = fileStream.readLine()) != null)
    		{
    			if((!tempData.trim().startsWith("character-item =")) && (!tempData.trim().startsWith("character-bank =")))
    			{
    				tempAdd = tempData.trim();
    
    				if(tempData.trim().startsWith("character-equip =")) 
    				{
    					tempAdd = "character-equip = "+curEquip+"\t-1\t0";
    					curEquip++;
    				}
    			tempOut.write(tempAdd); tempOut.newLine();
    				}
    			}
    				fileStream.close(); tempOut.close();
    				charFile.delete();
    				tempCharFile.renameTo(charFile);
    			}
    		catch(Exception e) { e.printStackTrace(); 
    		}
    	}
    }
    I played around with it, but couldnt get it to delete certain items. For example, if I wanted to delete a Rune Scimitar off everyone's account it would be item codes 1333 and 1334 (Noted and Un-Noted). Can't figure out how to only delete those items. Please help, will rep.

    Regards, Mark
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Sep 2008
    Posts
    2,219
    Thanks given
    148
    Thanks received
    204
    Rep Power
    1570
    Try this, I didn't really look at it, just kind of scimmed over
    Code:
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.DataInputStream;
    import java.io.BufferedWriter;
    import java.io.FileWriter;
    
    public class EconomyReset
    {
    
    	private static File charDir = new File("./characters/");
    
    	public static void main(String[] args)
    	{
    		if(charDir.exists() && charDir.isDirectory())
    		{
    			File[] charFiles = charDir.listFiles();
    		for(int i = 0; i < charFiles.length; i++)
    		{
    			resetEcoChar(charFiles[i]);
    			System.out.println("Reset player economy levels for... "+charFiles[i].toString());
    			}
    		}
    	}
    
    	private static void resetEcoChar(File charFile)
    	{
    		try
    		{
    
    			String cheatStatus, tempData, tempAdd = ""; int curEquip = 0, curItem = 0, curBank = 0;
    			File tempCharFile = new File(charDir.toString()+"ECOBOOST$TEMP");
    			DataInputStream fileStream = new DataInputStream(new FileInputStream(charFile));
    			BufferedWriter tempOut = new BufferedWriter(new FileWriter(tempCharFile));
    
    		while((tempData = fileStream.readLine()) != null)
    		{
    				for (int j = 0; j < 300; j++) {
    					if((!tempData.trim().startsWith("character-item = j	1334")) && (!tempData.trim().startsWith("character-bank = j	1334"))) {
    				tempAdd = tempData.trim();
    
    				if(tempData.trim().startsWith("character-equip =")) 
    				{
    					tempAdd = "character-equip = "+curEquip+"\t-1\t0";
    					curEquip++;
    				}
    			tempOut.write(tempAdd); tempOut.newLine();
    				}
    			}
    				fileStream.close(); tempOut.close();
    				charFile.delete();
    				tempCharFile.renameTo(charFile);
    			}
    		catch(Exception e) { e.printStackTrace(); 
    		}
    	}
    }



    Reply With Quote  
     

  3. #3  
    jack24
    Guest
    what base r u using? if delta then i got it. pm me and i will give u
    Reply With Quote  
     

  4. #4  
    Fuckin PRO

    Damien's Avatar
    Join Date
    Feb 2008
    Age
    32
    Posts
    2,658
    Thanks given
    928
    Thanks received
    82
    Rep Power
    369
    Jack, give it to me please.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •