Thread: [PI] How to add econ reset?

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 [PI] How to add econ reset? 
    Expect the Unexpected

    Acquittal's Avatar
    Join Date
    Jan 2011
    Age
    30
    Posts
    1,182
    Thanks given
    627
    Thanks received
    233
    Rep Power
    238
    Hello.
    I am trying to reset my economy, and I have been told there are programs that do it for you. So I tried following this guide: http://www.rune-server.org/runescape...omy-reset.html
    I ran it, and it said click here to continue, but when I restarted server, everything was still there. Does anyone know what to do? There were no errors of any kind. And I looked at the code and it says it should say, "Reset player economy levels for... " but it doesnt. Can someone help me out?
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Oct 2007
    Posts
    2,413
    Thanks given
    254
    Thanks received
    479
    Rep Power
    2785
    All them stupid programs do is reset all the player's items and equipment. Make your own app that loops through each player save file and deletes the stuff you want to be reset.
    Reply With Quote  
     

  3. #3  
    Expect the Unexpected

    Acquittal's Avatar
    Join Date
    Jan 2011
    Age
    30
    Posts
    1,182
    Thanks given
    627
    Thanks received
    233
    Rep Power
    238
    I know I want it to delete all the items and equipment, I dont need a complex code. I am just wondering why its not working.
    Reply With Quote  
     

  4. #4  
    Expect the Unexpected

    Acquittal's Avatar
    Join Date
    Jan 2011
    Age
    30
    Posts
    1,182
    Thanks given
    627
    Thanks received
    233
    Rep Power
    238
    Really need help!
    Reply With Quote  
     

  5. #5  
    Registered Member Beanerrr's Avatar
    Join Date
    Feb 2011
    Posts
    598
    Thanks given
    78
    Thanks received
    28
    Rep Power
    6
    Create the class:
    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("Data/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(); 
    }
    }
    }
    Save this as EcoCompiler.bat
    Code:
    @echo off
    "C:\Program Files\Java\jdk1.6.0_24\bin\javac.exe" *.java
    pause
    Save this as EcoReset.bat
    Code:
    @echo off
    title Eco Reset
    java EconomyReset
    pause
    Quote Originally Posted by Galkon View Post
    The rules clearly state, if you can't help, don't reply.


    Quote Originally Posted by Mod Josh - Question: How do you ask girls out?
    I can't ask them out, I am banned from the kitchen
    Quote Originally Posted by Penor View Post
    How will i know if its PI based?? Omfg this is sooo confusing!!
    Reply With Quote  
     

  6. #6  
    Expect the Unexpected

    Acquittal's Avatar
    Join Date
    Jan 2011
    Age
    30
    Posts
    1,182
    Thanks given
    627
    Thanks received
    233
    Rep Power
    238
    I am pretty sure you just copied and pasted what that guide said.
    Reply With Quote  
     

  7. #7  
    Expect the Unexpected

    Acquittal's Avatar
    Join Date
    Jan 2011
    Age
    30
    Posts
    1,182
    Thanks given
    627
    Thanks received
    233
    Rep Power
    238
    Bump really need help!
    Reply With Quote  
     

  8. #8  
    Expect the Unexpected

    Acquittal's Avatar
    Join Date
    Jan 2011
    Age
    30
    Posts
    1,182
    Thanks given
    627
    Thanks received
    233
    Rep Power
    238
    please anyone?
    Reply With Quote  
     

  9. #9  
    #packeting

    God's Avatar
    Join Date
    Feb 2011
    Posts
    1,007
    Thanks given
    315
    Thanks received
    115
    Rep Power
    181
    lol...

    save this as ecoreset.bat:

    Code:
    @echo off
    Title Economy reset
    java -cp EcoReset
    pause
    and save this as EcoReset.java and put it in your main directory of your source...

    Code:
    import java.io.*;
    
    		/**
                      *@author Genc
                      * 
                      */
    public class EcoReset
    {
            public static void main(String args[])
            {
                      
                      /**
                      * Don't put notes, though. It will cause problems.
                      */
    
    		
                    int[] rares = {995, 617};
                    File charFolder;
                    BufferedWriter bw;
                    BufferedReader br;
                    BufferedWriter tmpwr;
                    BufferedReader tmpr;
                    boolean overwrite = false;
                    String read;
                    String dir = "data/characters/";
                    double done = 0;
                    int percent = 0;
                    int percentRounded = 0;
    
                    charFolder = new File(dir);
    
                    if(!charFolder.exists())
                    {
                            System.out.println("The directory "+dir+" was not found.");
                            return;
                    }
                    else
                    if(charFolder.list().length == 0)
                    {
                            System.out.println("The specified directory is empty.");
                            return;
                    }
                    String file[] = charFolder.list();
                    for(String s : file)
                    {
                            try
                            {
                                    boolean isAdmin = false;
                                    File charFile = new File(dir+s);
                                    File tmpFile = new File(dir+s+".tmp");
                                    tmpFile.createNewFile();
                                    br = new BufferedReader(new FileReader(charFile));
                                    tmpwr = new BufferedWriter(new FileWriter(tmpFile, true));
    
                                    while((read = br.readLine()) != null)
                                    {
                                            if(read.contains("character-rights"))
                                            {
                                                    if(read.charAt(read.length() - 1) > '1')
                                                    {
                                                            System.out.println("Bank saved for admin "+s.substring(0, s.indexOf(".")));
                                                            isAdmin = true;
                                                    }
                                            }
    
                                            if(read.equals("[ITEMS]") || read.equals("[EQUIPMENT]"))
                                            {
                                                    if(!isAdmin)
                                                    {
                                                            overwrite = true;
                                                    }
                                            }
    
                                            if(read.equals("[FRIENDS]") || read.equals("[LOOK]"))
                                                    overwrite = false;
    
                                            if(!overwrite)
                                            {
                                                    tmpwr.write(read);
                                                    tmpwr.newLine();
                                            }
                                            else if(!isAdmin)
                                            {
                                                    boolean found = false;
                                                    for(int i : rares)
                                                    {
                                                            if(read.contains("\t" + i + "\t") || read.contains("\t" + (i + 1) + "\t"))
                                                            {
                                                                    found = true;
                                                            }
                                                    }
                                                    if(!found)
                                                    {
                                                            tmpwr.write(read);
                                                            tmpwr.newLine();
                                                    }
                                            }
                                    }
                                    tmpwr.flush();
                                    tmpwr.close();
                                    br.close();
    
                                    charFile.delete();
    
                                    bw = new BufferedWriter(new FileWriter(charFile, true));
                                    tmpr = new BufferedReader(new FileReader(tmpFile));
    
                                    while((read = tmpr.readLine()) != null)
                                    {
                                            bw.write(read);
                                            bw.newLine();
                                    }
    
                                    bw.flush();
                                    bw.close();
                                    tmpr.close();
                                    tmpFile.delete();
    
                                    done++;
    
                                    if((percent = (int)(done / file.length * 100)) % 5 < 5 && percent - percent % 5 != percentRounded)
                                            System.out.println((percentRounded = (int)(percent - percent % 5))+"%");
                            }
                            catch(IOException Ioe)
                            {
                                    Ioe.printStackTrace();
                            }
                    }
                    System.out.println("Finished!");
            }
    }




    LOL^

    [Today 12:51 AM] Stewie: If at first you don't succeed, you probably just realized you're a woman.

    ...oh stewie
    Reply With Quote  
     

  10. #10  
    Expect the Unexpected

    Acquittal's Avatar
    Join Date
    Jan 2011
    Age
    30
    Posts
    1,182
    Thanks given
    627
    Thanks received
    233
    Rep Power
    238
    Would I put the ecoreset.bat in the main directory too?
    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. econ pk
    By Jabookman in forum Chat
    Replies: 0
    Last Post: 06-29-2009, 12:24 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
  •