Thread: [PI] Command that will reset server but turn back on?

Results 1 to 3 of 3
  1. #1 [PI] Command that will reset server but turn back on? 
    Donator

    Anthony's Avatar
    Join Date
    Dec 2007
    Age
    29
    Posts
    1,344
    Thanks given
    198
    Thanks received
    129
    Rep Power
    355
    i need a command that will reset the server but turn it back on aswell.
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Sep 2011
    Posts
    5,121
    Thanks given
    1,333
    Thanks received
    1,795
    Rep Power
    1731
    Put this under your Owner commands in commands.java

    Code:
    						if(playerCommand.startsWith("restart") && (c.playerName.equalsIgnoreCase("YOURNAMEGOESHERE"))) {
    	for(Player p : PlayerHandler.players) {
    		if(p == null)
    		         continue;	
    		PlayerSave.saveGame((Client)p);
    	}
    System.exit(0);
    	}
    Here's an auto restarter you can also use if your server has memory leaks - Make sure you put this where your run.bat is and name the file to something like AutoRestarter.bat, make sure it's .bat or it will not work.

    Code:
       ::Copyright © MMVIII all rights reserved 2008
           @echo off
                      title Server Automated Restarter
               :start
                      set time=10800 //time in seconds
                      start run.bat
               :loop
                      cls
                      IF %time% GTR 0 (
                       set /a time=%time% - 1
                        set /a min=%time%/60
                         echo Next Restart In %time% Seconds.
                        echo   %time% Seconds is %min% Minutes.
                       ping YOURIPADDRESS -n 2 > NUL
                      goto loop
                      ) 
               taskkill /f /im java.exe
              cls
             goto start
         ::Made By RSC/Logical

    Hope I helped.
    Reply With Quote  
     

  3. #3  
    OoO Donor <3
    Rockstar Jax's Avatar
    Join Date
    Mar 2011
    Age
    27
    Posts
    608
    Thanks given
    77
    Thanks received
    78
    Rep Power
    21
    Code:
    if(playerCommand.startsWith("restart") && (c.playerName.equalsIgnoreCase("rockstar"))) {
    	for(Player p : PlayerHandler.players) {
    		if(p == null)
    		         continue;	
    		PlayerSave.saveGame((Client)p);
    	}
    System.exit(0);
    	}
    your run.bat

    under

    Code:
    java -Xmx800m -cp your shit here.
    add

    Code:
    start runeservername.bat
    and change pause to exit
    Reply With Quote  
     


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. Replies: 18
    Last Post: 01-03-2013, 01:09 AM
  2. Replies: 3
    Last Post: 08-05-2011, 06:33 PM
  3. Turn on drops or npc reset command[PI]
    By trayswizzle25 in forum Help
    Replies: 0
    Last Post: 11-03-2010, 01:27 AM
  4. Replies: 2
    Last Post: 08-11-2010, 08:39 PM
  5. Replies: 6
    Last Post: 02-15-2010, 08:13 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •