Re: Custom Commands Plug-in [message #390590 is a reply to message #390549] |
Sun, 14 June 2009 07:03 |
|
danpaul88
Messages: 5795 Registered: June 2004 Location: England
Karma:
|
General (5 Stars) |
|
|
In the command function in the plugin use;
1) Running batch file
system <patch_to_batch_file>;
Asks the OS to execute the given file
2) Restarting FDS
To stop server.dat (WARNING: tskill is a Windows XP system call which will stop ANY process with the given name or ID. The syntax above will stop ALL processes named server.dat, so if you have more than one server running it will kill them all. It also requires BRenBot to have admin rights or it wont have permission to call tskill).
This assumes you are using autorestart on the server, which will mean RenegadeServer.exe will relaunch the server.dat process automatically after this is called.
See replacement step below for a better method to perform this step.
3) Restarting BRenBot
Stops the current copy of BRenBot and launches a new copy.
References
System (Perl Function)
tskill (Windows XP system call)
Exec (Perl Function)
Edit : Replacement method for 2) Restarting FDS
Thinking about it, you could replace the tskill step with a simple RenRemCMD call to instruct the FDS to restart itself and sidestep the admin rights / multi server problems. Don't know why I didn't think of it first time around. Anyway, instead of that second code snippet regarding tskill above use;
plugin::RenRemCMD("restart");
[Updated on: Sun, 14 June 2009 07:10] Report message to a moderator
|
|
|