use the bufferedReader to read it from a file and use the bufferedWritter to write it
|
|
Well Marshal told me I should make my pk point high scores read from a file, and I am not really sure how to convert this in to taking it from the file instead of righting in the file itself.
and then would I make it liek this?Code:bw = new BufferedWriter(new FileWriter("Pk Highscores.java", true));
or something like that, I kinda just wrote that out.Code:sendQuest(bw.write(server.rankPpl[i]+": "+server.ranks[i]), 8147);
use the bufferedReader to read it from a file and use the bufferedWritter to write it
Thanks not so good with reading and writing from other file stuff.
I still need help with this part...
how would I make it say it on the highscores?
I'm kinda lost I have never done this before.Code:sendQuest(br.write(server.rankPpl[i]+": Pk Points - "+server.ranks[i]), 8147);
Shamon_King is right, "BufferedWriter" is used to write to files whereas "BufferedReader" reads from a file. Here's a little method I made for my own server, use it as an outline:
Hope this helpsCode:public void loadMenu(String menu) // by narco: [email protected] { String toRead; int line = 8147; sendFrame126("@[email protected]" + capitalize(menu) + " Menu", 8144); //Helpmenu title clearQuestInterface(); sendFrame126("", 8145); try { BufferedReader io = new BufferedReader(new FileReader(server.configLoc + "menus\\" + menu.toLowerCase().replaceAll(" ", "_") + ".log")); while((toRead = io.readLine()) != null) { toRead = toRead.replaceAll(":playerName:", capitalize(playerName)); sendFrame126(toRead, line); line++; } io.close(); } catch(Exception e) { println_debug("<method:client.load_menu>Exception -> " + e); } sendQuestSomething(8143); showInterface(8134); }
EDIT: thanks Shamon![]()
im-not-alive you should close your buffers
| « NoClassDefFoundError - Please help! | [Help]Creating my own DNS Ip [Help] » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |