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.
|
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?
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.
Create the class:
EconomyReset.java
Save this as EcoCompiler.batCode: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 EcoReset.batCode:@echo off "C:\Program Files\Java\jdk1.6.0_24\bin\javac.exe" *.java pause
Code:@echo off title Eco Reset java EconomyReset pause
lol...
save this as ecoreset.bat:
and save this as EcoReset.java and put it in your main directory of your source...Code:@echo off Title Economy reset java -cp EcoReset pause
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!"); } }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |