Thread: [REPOST]how to fix ::npc to put your npcs in AUTOSPAWN.CFG!!

Results 1 to 6 of 6
  1. #1 [REPOST]how to fix ::npc to put your npcs in AUTOSPAWN.CFG!! 
    RSSJ
    Guest
    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...
    "WTF the new servers dont have what the old servers do?!"
    So I looked into some of the older sources and dugg out the proper way


    Procedure
    Step 1: first search for
    Code:
    "npc"
    hopefuly your server has the ::npc command ><
    you should see something like this:
    Code:
    else if (command.startsWith("npc")) {
                    try
    and after that a bunch of code


    Step 2: Ok find this
    Code:
    sendMessage("You spawn an npc");
    press enter after the ; and put this.
    Code:
    NpcMapper(newNPC);


    Step 3: Then Search for this
    Code:
    public void
    above this press ENTER a few times,
    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 )
    there now 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
     

  2. #2  
    Registered Member
    Eternal Darknes's Avatar
    Join Date
    Jul 2007
    Age
    27
    Posts
    384
    Thanks given
    0
    Thanks received
    0
    Rep Power
    95
    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.
    [Only registered and activated users can see links. ]

    Not allowed
     

  3. #3  
    multiscape
    Guest
    ty i add to my server
     

  4. #4  
    Money
    Guest
    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
     

  5. #5  
    Registered Member Dakota Lesmercy's Avatar
    Join Date
    Sep 2007
    Posts
    289
    Thanks given
    0
    Thanks received
    0
    Rep Power
    13
    TYVM for solving all the problems with my server!
    [Only registered and activated users can see links. ][Only registered and activated users can see links. ]
     

  6. #6  
    Registered Member
    BamBam's Avatar
    Join Date
    Jan 2007
    Posts
    270
    Thanks given
    24
    Thanks received
    8
    Rep Power
    153
    You ripped this right out of reenscape, right? Not saying you leeched or anything, just curious what source you took this out of.

    Runekeep®
     


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
  •