Thanks A ton I will try it and this will probably save me a **** load of time because I am completely redoing the autospawn in the server I am devolping.
|
|
Purpose: Fix the ::npc command to put npcs into autospawn.cfg via method/buffered writer
Difficulty: -2/10
Assumed Knowledge: Copy/paste
Server Base: Hellz end, should work on ANY of the new server sources
Classes Modified: Client.java
I have noticed Most of the "newer" more "popular" server sources
Dont have the buffered writer method for AUTOSPAWN.CFG like the old fashions servers have,
So I thought to myself...
So I looked into some of the older sources and dugg out the proper way"WTF the new servers dont have what the old servers do?!"
Procedure
Step 1: first search for
hopefuly your server has the ::npc command ><Code:"npc"
you should see something like this:
and after that a bunch of codeCode:else if (command.startsWith("npc")) { try
Step 2: Ok find this
press enter after the ; and put this.Code:sendMessage("You spawn an npc");
Code:NpcMapper(newNPC);
Step 3: Then Search for this
above this press ENTER a few times,Code:public void
WATCH FOR THE } IF THERE IS ONE, PRESS ENTER AFTER THIS BEFORE THE PUBLIC VOID OR YOUL GET 100 ERRORS, BELEVE IT!
then put this:
Code:public void NpcMapper(int newNPC) { try { BufferedWriter bufferedwriter; bufferedwriter = null; bufferedwriter = new BufferedWriter(new FileWriter("autospawn.cfg", true)); bufferedwriter.write((new StringBuilder()).append("spawn = ").append(newNPC).append(" ").append(absX).append(" ").append(absY).append(" ").append(heightLevel).append(" ").append(absX + 1).append(" ").append(absY + 1).append(" ").append(absX + -1).append(" ").append(absY + -1).append(" ").append("2").append(" ").append("NewNPC").toString()); bufferedwriter.newLine(); bufferedwriter.flush(); } catch(Exception e) { sendMessage("NpcMapper failed."); } }
Credits: 90% to me and 10% to shadow (for teaching me on buffered writers)
therenow all your npcs you spawn will be in AUTOSPAWN.CFG and you dont gotta do it the old fashion way
(note: if your server has an [endofspawnlist] the codes will go under that, so just copy/paste them to above it)I havent seen this and I noticed that so just posting it, If it's already there then just let the thread die, I'm sure someone will find this useful
![]()
ty i add to my server![]()
god ur amazing rep ++ and if ur that good maybe could you make one for adding objects?
EDIT:: i got no errors but when i do ::npc #### (any monster id) it doesn't spawn and it doesn't write in the autospawn.cgf
You ripped this right out of reenscape, right? Not saying you leeched or anything, just curious what source you took this out of.
| « Party room baloons [][][] | [TUT]Basic Barrows » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |