Discovered GM Commands [Dedicated]

General discussion about Life is Feudal MMO and Life is Feudal: Your Own, The main section and backbone of the forums.

Kobiwaldi
 
Posts: 32
Joined: 08 Sep 2014, 04:22

Re: Discovered GM Commands [Dedicated]

Post by Kobiwaldi » 28 Sep 2014, 05:43

It's the Admin password that you have set in your config/world_1.xml


Sunlol
 
Posts: 2
Joined: 28 Sep 2014, 08:24

Re: Discovered GM Commands [Dedicated]

Post by Sunlol » 28 Sep 2014, 08:38

Hello

My server dont execute this command : /addobj 520 "School (wooden)"

I'm doing this
/addobj 520 "School (wooden)" Does not work new update (0.2.0.0)....

Also have ids that does not work on command

exemple

27 Chainmail armors

/setmyskill 27 10


Inxane
 
Posts: 6
Joined: 23 Sep 2014, 12:29

Re: Discovered GM Commands [Dedicated]

Post by Inxane » 28 Sep 2014, 13:58

Sunlol wrote:Hello

My server dont execute this command : /addobj 520 "School (wooden)"

I'm doing this
/addobj 520 "School (wooden)" Does not work new update (0.2.0.0)....

Also have ids that does not work on command

exemple

27 Chainmail armors

/setmyskill 27 10


/addobj 520

That should work on it's own, only type that in the chat. Don't forget to turn on GM mode first. The "School (wooden)" They just told you the ID is that building.


/setmyskill "Chainmail armors" 27

That should work.

Hope it works for you, if anyone have any questions, i could try to help you all.


Inxane
 
Posts: 6
Joined: 23 Sep 2014, 12:29

Re: Discovered GM Commands

Post by Inxane » 28 Sep 2014, 14:00

Hassanpasa wrote:
Kobiwaldi wrote:Hm... tried it via console to become a GM. Working. (/gm password)

*edit*

Work on Dedi Server



I tried with /gm password in console but i get Invalid password message... Anyone can help


/GM put the password that you choose inside your world_1 file here, not the actual word "Password", hope it helps:)


Sunlol
 
Posts: 2
Joined: 28 Sep 2014, 08:24

Re: Discovered GM Commands [Dedicated]

Post by Sunlol » 28 Sep 2014, 16:31

Inxane wrote:
Sunlol wrote:Hello

My server dont execute this command : /addobj 520 "School (wooden)"

I'm doing this
/addobj 520 "School (wooden)" Does not work new update (0.2.0.0)....

Also have ids that does not work on command

exemple

27 Chainmail armors

/setmyskill 27 10


/addobj 520

That should work on it's own, only type that in the chat. Don't forget to turn on GM mode first. The "School (wooden)" They just told you the ID is that building.


/setmyskill "Chainmail armors" 27

That should work.

Hope it works for you, if anyone have any questions, i could try to help you all.


/addobj 520 dont work man help


Inxane
 
Posts: 6
Joined: 23 Sep 2014, 12:29

Re: Discovered GM Commands [Dedicated]

Post by Inxane » 28 Sep 2014, 17:47

Sunlol wrote:
Inxane wrote:
Sunlol wrote:Hello

My server dont execute this command : /addobj 520 "School (wooden)"

I'm doing this
/addobj 520 "School (wooden)" Does not work new update (0.2.0.0)....

Also have ids that does not work on command

exemple

27 Chainmail armors

/setmyskill 27 10


/addobj 520

That should work on it's own, only type that in the chat. Don't forget to turn on GM mode first. The "School (wooden)" They just told you the ID is that building.


/setmyskill "Chainmail armors" 27

That should work.

Hope it works for you, if anyone have any questions, i could try to help you all.


/addobj 520 dont work man help


Hm, strange, didn't work for me either when i tried it... When i do it, i build the house and then use the command /complete instead, it's much better if you ask me. :)


Godcomplex
 
Posts: 10
Joined: 18 Jan 2014, 06:51

Re: Discovered GM Commands [Dedicated]

Post by Godcomplex » 29 Sep 2014, 09:11

Has anyone worked out any terraforming commands yet, would love to collapse a mine tunnel


TorZar
 
Posts: 46
Joined: 20 Sep 2014, 15:47

Re: Discovered GM Commands [Dedicated]

Post by TorZar » 29 Sep 2014, 12:55

Updated main post.. switched out broken godmode for newbie pack and setting all skills/stats..

EDIT: Cleaner version

EDIT 2: Updated links, fixed a couple wrong itemID's in simple script...

I've only spent a few minutes (roughly 10, tops) peaking into TorqueScript.. but if I get time and/or the ambition to dig deep into LIF, and the devs continue to allow GM's/Server admins to execute their own scripts... There seems to be some decent potential for GM's and creating your own abilities/functions/content for scripters.

Code: Select all
//AUTO-CONNECT TO (FAVORITE/OWN) SERVER FROM TITLE SCREEN WITH ALT+M - AVOIDING SERVER LIST DELAY
GlobalActionMap.bindCmd(keyboard, "alt m", "", "joinToRemoteServer(\"###.###.###.###:28000\",\"\");");

//Z = TOGGLE GM MODE
moveMap.bindCmd(keyboard, z, "doSlashCommand(\"/GM password\");");

//ALT+N = NEWBIE PACK TO PASS OUT
GlobalActionMap.bind(keyboard, "alt n", newbiePack);

//ALT+Z = NEW GM CHAR. ALL SKILLS & STATS
GlobalActionMap.bind(keyboard, "alt z", allSkills);

function allSkills()
{
warn("ALL SKILLS");
doSlashCommand("/setmystat 0 110");
doSlashCommand("/setmystat 1 110");
doSlashCommand("/setmystat 2 110");
doSlashCommand("/setmystat 3 110");
doSlashCommand("/setmystat 4 110");
for(%i = 1; %i < 66; %i++)
   {
      %commandToSend = "/setmyskill " @ %i @ " 90";
      doSlashCommand(%commandToSend);
   }
}

function newbiePack()
{
warn("NewbiePack");
doSlashCommand("/ADD 458 1"); //backpack
doSlashCommand("/ADD 40 1 100 50000"); //shovel
doSlashCommand("/ADD 555 1 100 50000"); //practice sword
doSlashCommand("/ADD 48 1 100 50000"); //pickaxe
doSlashCommand("/ADD 45 1 100 50000"); //primitive axe
doSlashCommand("/ADD 51 1 100 50000"); //saw
doSlashCommand("/ADD 33 1 100 50000"); //sickle
doSlashCommand("/ADD 974 25 50 50000"); //semiSuperAppleBuns
doSlashCommand("/ADD 885 1 50"); //helm
doSlashCommand("/ADD 886 1 50"); //chest
doSlashCommand("/ADD 887 1 50"); //arms
doSlashCommand("/ADD 888 1 50"); //gaunlets
doSlashCommand("/ADD 889 1 50"); //leggings
doSlashCommand("/ADD 890 1 50"); //boots
}
Last edited by TorZar on 30 Sep 2014, 22:08, edited 1 time in total.


Indianbay
 
Posts: 2
Joined: 30 Sep 2014, 13:55

Re: Discovered GM Commands [Dedicated]

Post by Indianbay » 30 Sep 2014, 14:00

Anyone have a list of the skill tree codes? When I try and mod a skill w/ multiple words it doesn't work... any suggestions?

User avatar
Arrakis
 
Posts: 5455
Joined: 25 Oct 2013, 14:11
Location: Space

Re: Discovered GM Commands [Dedicated]

Post by Arrakis » 30 Sep 2014, 14:59

Indianbay wrote:Anyone have a list of the skill tree codes? When I try and mod a skill w/ multiple words it doesn't work... any suggestions?


list-jobs-id-s-t3088/


TorZar
 
Posts: 46
Joined: 20 Sep 2014, 15:47

Re: Discovered GM Commands [Dedicated]

Post by TorZar » 30 Sep 2014, 22:20

Godcomplex wrote:Has anyone worked out any terraforming commands yet, would love to collapse a mine tunnel

It has been driving me crazy to not be able to level a pre-defined area to work on a GM base for our GM's or fill in some of the ill-dug tunnels that, at this point, can screw everything up.. This would be a game-changing default mechanic.. And would definitely change my view on how much time I'd spend playing around with this..

User avatar
Dwolf
 
Posts: 9
Joined: 21 Sep 2014, 12:52

Re: Discovered GM Commands [Dedicated]

Post by Dwolf » 01 Oct 2014, 13:29

Is there anyway to eliminate tunnels and mines or bans?


Zoneg
 
Posts: 1
Joined: 23 Oct 2014, 05:18

Re: Discovered GM Commands [Dedicated]

Post by Zoneg » 23 Oct 2014, 05:19

/addobj - no work. How ON this command? I want spawn horses :D

User avatar
Dwolf
 
Posts: 9
Joined: 21 Sep 2014, 12:52

Re: Discovered GM Commands [Dedicated]

Post by Dwolf » 24 Oct 2014, 21:39

Zoneg wrote:/addobj - no work. How ON this command? I want spawn horses :D

You can't, horses aren't in game yet (I think they don't have a 3d model yet), they are like chickens and hares, parchments; you can add them to your inventory using /add

User avatar
Vamyan
 
Posts: 198
Joined: 23 Oct 2014, 22:29

Re: Discovered GM Commands [Dedicated]

Post by Vamyan » 25 Oct 2014, 22:59

Not exactly a GM command, unless someone can help me understand Torque 3D enough to make this a client-initiated option, but here's a serverside script to restart the server.

Executed by calling RestartServer(15); (for example) in the server console, can be canceled by calling CancelRestart();

The following code can be inserted into whatever serverside scripts you have loading, i.e. any script with an exec() line in main.cs, or a new script added as an exec() line there.

Code: Select all
function RestartServer(%minutes)
{
   CancelRestart();
   %shutdown = %minutes * 60000;
   %one = %shutdown - 60000;
   %two = %shutdown - 120000;
   %five = %shutdown - 300000;
   %ten = %shutdown - 600000;
   hack("Initiating server restart in " @ %minutes @ " minutes.");
   centerPrintAll("Server going down for restart in " @ %minutes @ " minutes.\n\nPlease ensure you are in a safe area.",15,2);
   if (%minutes > 12)
   {
      $TIMER_TEN = schedule(%ten, 0, "onTimerAnnounce","Server going down for restart in 10 minutes.\n\nPlease ensure you are in a safe area.");
   }
   if (%minutes > 7)
   {
      $TIMER_FIVE = schedule(%five, 0, "onTimerAnnounce","Server going down for restart in 5 minutes.\n\nLog out at your earliest convenience.");
   }
   if (%minutes > 3)
   {
      $TIMER_TWO = schedule(%two, 0, "onTimerAnnounce","Server going down for restart in 2 minutes.\n\nLog out now!");
   }
   if (%minutes > 1)
   {
      $TIMER_ONE = schedule(%one, 0, "onTimerAnnounce","Server going down for restart in 1 minute.\n\nLog out now!");
   }
   $TIMER_Shutdown = schedule(%shutdown, 0, "onTimerShutdown");

}

function CancelRestart()
{
   cancel($TIMER_TEN);
   cancel($TIMER_FIVE);
   cancel($TIMER_TWO);
   cancel($TIMER_ONE);
   cancel($TIMER_SHUTDOWN);
}

CancelRestart();

function OnTimerAnnounce(%str)
{
   hack("Sending server restart message:" SPC %str);
   centerPrintAll(%str,10,2);
}

function onTimerShutdown()
{
   hack("Server restart initiated.");
   shellExecute("check_server.cmd",$cm_config::worldID);
   Quit();
}


and the check_server.cmd batch file:

Code: Select all
@echo off

REM Delay until server process is closed...
<nul (set/p _any_variable=Waiting for server to exit.)
:WAITCLOSE
<nul (set/p _any_variable=.)
ping ::1 -n 3 >NUL 2>NUL
tasklist /FI "imagename eq ddctd_cm_yo_server.exe" /V | find "world ID %1" >NUL && goto :WAITCLOSE
echo done.
ping ::1 -n 5 >NUL 2>NUL

:LOOP
REM If server is started, exit batch file.
tasklist /FI "imagename eq ddctd_cm_yo_server.exe" /V | find "world ID %1" >NUL && goto :END

REM If not, try to start it.
echo Launching WorldID %1.
start ddctd_cm_yo_server.exe -WorldID %1
REM Wait 30 seconds before next check to give server time to initialize titlebar with world ID.
echo Waiting 30 seconds to ensure server has started.
PING ::1 -n 30 >NUL 2>NUL

REM Loop to check if server is initialized.
GOTO :LOOP

:END


<EDIT> Tweaked code for functionality with multiple worlds.
<EDIT2> Much improved code. Batch file launch now shows window with status output, and relaunches the server without excessive wait times.
Last edited by Vamyan on 31 Oct 2014, 08:14, edited 1 time in total.

User avatar
Adamld85
 
Posts: 40
Joined: 06 Oct 2014, 00:38

Re: Discovered GM Commands [Dedicated]

Post by Adamld85 » 26 Oct 2014, 07:11

Vamyan wrote:Not exactly a GM command, unless someone can help me understand Torque 3D enough to make this a client-initiated option, but here's a serverside script to restart the server.

Executed by calling RestartServer(15); (for example) in the server console, can be canceled by calling CancelRestart();

The following code can be inserted into whatever serverside scripts you have loading, i.e. any script with an exec() line in main.cs, or a new script added as an exec() line there.

Code: Select all
function RestartServer(%minutes)
{
   CancelRestart();
   %shutdown = %minutes * 60000;
   %one = %shutdown - 60000;
   %two = %shutdown - 120000;
   %five = %shutdown - 300000;
   %ten = %shutdown - 600000;
   centerPrintAll("Server going down for restart in " @ %minutes @ " minutes.\n\nPlease ensure you are in a safe area.",15,3);
   if (%minutes > 12)
   {
      $TIMER_TEN = schedule(%ten, 0, "onTimerAnnounce","Server going down for restart in 10 minutes.\n\nPlease ensure you are in a safe area.");
   }
   if (%minutes > 7)
   {
      $TIMER_FIVE = schedule(%five, 0, "onTimerAnnounce","Server going down for restart in 5 minutes.\n\nLog out at your earliest convenience.");
   }
   if (%minutes > 3)
   {
      $TIMER_TWO = schedule(%two, 0, "onTimerAnnounce","Server going down for restart in 2 minutes.\n\nLog out now!");
   }
   if (%minutes > 1)
   {
      $TIMER_ONE = schedule(%one, 0, "onTimerAnnounce","Server going down for restart in 1 minute.\n\nLog out now!");
   }
   $TIMER_Shutdown = schedule(%shutdown, 0, "onTimerShutdown");

}

function CancelRestart()
{
   cancel($TIMER_TEN);
   cancel($TIMER_FIVE);
   cancel($TIMER_TWO);
   cancel($TIMER_ONE);
   cancel($TIMER_SHUTDOWN);
}

CancelRestart();

function OnTimerAnnounce(%str)
{
   centerPrintAll(%str,10,3);
}

function onTimerShutdown()
{
   hack("Server restart initiated.");
   launchExternalApplication("check_server.cmd",$cm_config::worldID);
   Quit();
}


and the check_server.cmd batch file:

Code: Select all
@echo off
REM Delay about 60 seconds...
PING ::1 -n 30 >NUL 2>NUL
:LOOP
PING ::1 -n 30 >NUL 2>NUL
tasklist /FI "imagename eq ddctd_cm_yo_server.exe" /V | find "world ID %1" >NUL && goto :END
start ddctd_cm_yo_server.exe -WorldID %1
tasklist /FI "imagename eq ddctd_cm_yo_server.exe" /V | find "world ID %1" >NUL || goto :LOOP
:END


<EDIT> Tweaked code for functionality with multiple worlds.


Thanks man. I couple questions - does it check whether the server is alive even if it has crashed with the MUTEX error? I've got it detecting when it isn't running but when that MUTEX lock error appears it just halts the server and it doesn't know to restart until you click ok to the error box.

Also, is there a way to send global messages at certain intervals? This would be very useful for serverwide messages about the rules, where to find help, etc.
LT.
Image
7Gamers.com.au

User avatar
Vamyan
 
Posts: 198
Joined: 23 Oct 2014, 22:29

Re: Discovered GM Commands [Dedicated]

Post by Vamyan » 26 Oct 2014, 08:20

Adamld85 wrote:
Thanks man. I couple questions - does it check whether the server is alive even if it has crashed with the MUTEX error? I've got it detecting when it isn't running but when that MUTEX lock error appears it just halts the server and it doesn't know to restart until you click ok to the error box.

Also, is there a way to send global messages at certain intervals? This would be very useful for serverwide messages about the rules, where to find help, etc.


1) Well, this isn't an auto-restart mod, it's more of a manual "restart server in X minutes with global notices" mod... I don't know anything about the MUTEX error, but if I start encountering it I'll certainly work on fixing it.

2) As for global messages at intervals, that's pretty easy. As you see, this script uses both the schedule() and centerPrintAll() functions. To have messages pop up on everyone's screen on a timer, you'd just set up a function to call centerPrintAll() with the message, and reschedule the callback.

Example script:
Code: Select all
// schedule(ms delay,0,callback function,callback args...)
schedule(100,0,"SpamInfo","The information line goes here.\nBackslash-n inserts a line break.",10,2,120000);
// This auto-starts the SpamInfo() timer, with the above line, to stay on screen for 10 seconds.
// Two lines of background will be reserved, and the timer will repeat every 120 seconds (120000 ms)
function SpamInfo(%str,%seconds,%lines,%repeat)
{
   centerPrintAll(%str,%seconds,%lines);
   schedule(%repeat,0,"SpamInfo",%str,%seconds,%lines,%repeat);
}

User avatar
Adamld85
 
Posts: 40
Joined: 06 Oct 2014, 00:38

Re: Discovered GM Commands [Dedicated]

Post by Adamld85 » 26 Oct 2014, 08:23

That's, that's great. Is it the center of their screen and with a dialog box that they have to click or does it go to globalchat?
LT.
Image
7Gamers.com.au

User avatar
Vamyan
 
Posts: 198
Joined: 23 Oct 2014, 22:29

Re: Discovered GM Commands [Dedicated]

Post by Vamyan » 26 Oct 2014, 08:24

it's just a transparent-background window with green text that pops up in the middle of their screen, nothing to click, and it disappears after the %seconds elapses. Make sure to set %seconds to something non-zero though or it stays up forever (or until a clearCenterPrintAll() is sent)

User avatar
Vamyan
 
Posts: 198
Joined: 23 Oct 2014, 22:29

Re: Discovered GM Commands [Dedicated]

Post by Vamyan » 26 Oct 2014, 08:27

Also note there's a bottomPrintAll() function, which presumably prints on everyone's screen the same way, but at the bottom instead of in their field of view. Might be better to use this for something that might get annoying...?

User avatar
Adamld85
 
Posts: 40
Joined: 06 Oct 2014, 00:38

Re: Discovered GM Commands [Dedicated]

Post by Adamld85 » 26 Oct 2014, 12:26

Thanks man. Really helpful
LT.
Image
7Gamers.com.au

User avatar
Vamyan
 
Posts: 198
Joined: 23 Oct 2014, 22:29

Re: Discovered GM Commands [Dedicated]

Post by Vamyan » 26 Oct 2014, 19:30

Actually, on further testing, bottomPrintAll() doesn't seem to work. centerPrintAll() is it for now...

User avatar
Dwolf
 
Posts: 9
Joined: 21 Sep 2014, 12:52

Re: Discovered GM Commands [Dedicated]

Post by Dwolf » 27 Oct 2014, 14:27

Vamyan wrote:Not exactly a GM command, unless someone can help me understand Torque 3D enough to make this a client-initiated option, but here's a serverside script to restart the server.

Executed by calling RestartServer(15); (for example) in the server console, can be canceled by calling CancelRestart();

The following code can be inserted into whatever serverside scripts you have loading, i.e. any script with an exec() line in main.cs, or a new script added as an exec() line there.

Code: Select all
function RestartServer(%minutes)
{
   CancelRestart();
   %shutdown = %minutes * 60000;
   %one = %shutdown - 60000;
   %two = %shutdown - 120000;
   %five = %shutdown - 300000;
   %ten = %shutdown - 600000;
   centerPrintAll("Server going down for restart in " @ %minutes @ " minutes.\n\nPlease ensure you are in a safe area.",15,3);
   if (%minutes > 12)
   {
      $TIMER_TEN = schedule(%ten, 0, "onTimerAnnounce","Server going down for restart in 10 minutes.\n\nPlease ensure you are in a safe area.");
   }
   if (%minutes > 7)
   {
      $TIMER_FIVE = schedule(%five, 0, "onTimerAnnounce","Server going down for restart in 5 minutes.\n\nLog out at your earliest convenience.");
   }
   if (%minutes > 3)
   {
      $TIMER_TWO = schedule(%two, 0, "onTimerAnnounce","Server going down for restart in 2 minutes.\n\nLog out now!");
   }
   if (%minutes > 1)
   {
      $TIMER_ONE = schedule(%one, 0, "onTimerAnnounce","Server going down for restart in 1 minute.\n\nLog out now!");
   }
   $TIMER_Shutdown = schedule(%shutdown, 0, "onTimerShutdown");

}

function CancelRestart()
{
   cancel($TIMER_TEN);
   cancel($TIMER_FIVE);
   cancel($TIMER_TWO);
   cancel($TIMER_ONE);
   cancel($TIMER_SHUTDOWN);
}

CancelRestart();

function OnTimerAnnounce(%str)
{
   centerPrintAll(%str,10,3);
}

function onTimerShutdown()
{
   hack("Server restart initiated.");
   launchExternalApplication("check_server.cmd",$cm_config::worldID);
   Quit();
}


and the check_server.cmd batch file:

Code: Select all
@echo off
REM Delay about 60 seconds...
PING ::1 -n 30 >NUL 2>NUL
:LOOP
PING ::1 -n 30 >NUL 2>NUL
tasklist /FI "imagename eq ddctd_cm_yo_server.exe" /V | find "world ID %1" >NUL && goto :END
start ddctd_cm_yo_server.exe -WorldID %1
tasklist /FI "imagename eq ddctd_cm_yo_server.exe" /V | find "world ID %1" >NUL || goto :LOOP
:END


<EDIT> Tweaked code for functionality with multiple worlds.

I don't know what it's wrong but it doesn't work, I add them to the server and modify main.cs to execute them but nothing... could anyone explain me a little more how to add and use them? and the same with global messages...

User avatar
Vamyan
 
Posts: 198
Joined: 23 Oct 2014, 22:29

Re: Discovered GM Commands [Dedicated]

Post by Vamyan » 27 Oct 2014, 16:04

The commands need to be entered into the server console, not from a client console... that may be where you're going wrong?

in the server console, entering:

RestartServer(15);

will send a global notice to everyone connected to the server and start the timers for more notices and shutdown/restart.

Also in the server console, entering:

centerPrintAll("text to send",<seconds>);

will display a global notice to everyone.

I'm sure there's a way to implement these as a client function that calls the server function through the network, but I don't know how.

User avatar
Dwolf
 
Posts: 9
Joined: 21 Sep 2014, 12:52

Re: Discovered GM Commands [Dedicated]

Post by Dwolf » 27 Oct 2014, 16:35

Vamyan wrote:The commands need to be entered into the server console, not from a client console... that may be where you're going wrong?

in the server console, entering:

RestartServer(15);

will send a global notice to everyone connected to the server and start the timers for more notices and shutdown/restart.

Also in the server console, entering:

centerPrintAll("text to send",<seconds>);

will display a global notice to everyone.

I'm sure there's a way to implement these as a client function that calls the server function through the network, but I don't know how.

That may be the problem, I tried to use them in the game via the console, how I can access to the server console?
I can access to it if I use Life is Feudal: Your Own Dedicated Server from Steam and it works but I can't with a real server, I tried with Filezilla but I couldn't and I've no idea how I could do that... :cry: Thank you for your help
Last edited by Dwolf on 28 Oct 2014, 11:33, edited 2 times in total.


TorZar
 
Posts: 46
Joined: 20 Sep 2014, 15:47

Re: Discovered GM Commands [Dedicated]

Post by TorZar » 27 Oct 2014, 16:40

Vamyan wrote:Not exactly a GM command, unless someone can help me understand Torque 3D enough to make this a client-initiated option, but here's a serverside script to restart the server.

Executed by calling RestartServer(15); (for example) in the server console, can be canceled by calling CancelRestart();

The following code can be inserted into whatever serverside scripts you have loading, i.e. any script with an exec() line in main.cs, or a new script added as an exec() line there.

Code: Select all
function RestartServer(%minutes)
{
   CancelRestart();
   %shutdown = %minutes * 60000;
   %one = %shutdown - 60000;
   %two = %shutdown - 120000;
   %five = %shutdown - 300000;
   %ten = %shutdown - 600000;
   centerPrintAll("Server going down for restart in " @ %minutes @ " minutes.\n\nPlease ensure you are in a safe area.",15,3);
   if (%minutes > 12)
   {
      $TIMER_TEN = schedule(%ten, 0, "onTimerAnnounce","Server going down for restart in 10 minutes.\n\nPlease ensure you are in a safe area.");
   }
   if (%minutes > 7)
   {
      $TIMER_FIVE = schedule(%five, 0, "onTimerAnnounce","Server going down for restart in 5 minutes.\n\nLog out at your earliest convenience.");
   }
   if (%minutes > 3)
   {
      $TIMER_TWO = schedule(%two, 0, "onTimerAnnounce","Server going down for restart in 2 minutes.\n\nLog out now!");
   }
   if (%minutes > 1)
   {
      $TIMER_ONE = schedule(%one, 0, "onTimerAnnounce","Server going down for restart in 1 minute.\n\nLog out now!");
   }
   $TIMER_Shutdown = schedule(%shutdown, 0, "onTimerShutdown");

}

function CancelRestart()
{
   cancel($TIMER_TEN);
   cancel($TIMER_FIVE);
   cancel($TIMER_TWO);
   cancel($TIMER_ONE);
   cancel($TIMER_SHUTDOWN);
}

CancelRestart();

function OnTimerAnnounce(%str)
{
   centerPrintAll(%str,10,3);
}

function onTimerShutdown()
{
   hack("Server restart initiated.");
   launchExternalApplication("check_server.cmd",$cm_config::worldID);
   Quit();
}


and the check_server.cmd batch file:

Code: Select all
@echo off
REM Delay about 60 seconds...
PING ::1 -n 30 >NUL 2>NUL
:LOOP
PING ::1 -n 30 >NUL 2>NUL
tasklist /FI "imagename eq ddctd_cm_yo_server.exe" /V | find "world ID %1" >NUL && goto :END
start ddctd_cm_yo_server.exe -WorldID %1
tasklist /FI "imagename eq ddctd_cm_yo_server.exe" /V | find "world ID %1" >NUL || goto :LOOP
:END


<EDIT> Tweaked code for functionality with multiple worlds.


Nice work, just happened to pop back in after a while and glad to see this here. If they leave the scripting available to the public the possibilities are endless for features. Given the community bites into it.

Sadly I've lost the ambition in my little spare time to play with this project but glad to see others doing it.

I'll add a link to your work in main post.

User avatar
Vamyan
 
Posts: 198
Joined: 23 Oct 2014, 22:29

Re: Discovered GM Commands [Dedicated]

Post by Vamyan » 31 Oct 2014, 08:17

Edited RestartServer() and batch file code in this post on this thread. Better, Cleaner, Awesomer!


Revv
 
Posts: 76
Joined: 22 Sep 2014, 12:53

Re: Discovered GM Commands [Dedicated]

Post by Revv » 02 Nov 2014, 12:14

Anyone else having issues with the ~ not opening the console anymore or is it just me? I haven't played in a few weeks and it just won't open the console for me now?

EDIT: Nevermind ctrl+` did it *slaps self across face*

User avatar
Darkbouzouf
Beta Tester
 
Posts: 19
Joined: 25 Nov 2014, 00:02

Re: Discovered GM Commands [Dedicated]

Post by Darkbouzouf » 15 Dec 2014, 15:22

How to acces server console (i have a server hosted by vilayer) ?

in game i can open console but of course it's client side so it's useless to use function centerprintall(text,5) :Search:
Image

User avatar
Azzerhoden
Alpha Tester
 
Posts: 1621
Joined: 08 May 2014, 17:44

Re: Discovered GM Commands [Dedicated]

Post by Azzerhoden » 15 Dec 2014, 22:26

How the heck did I miss the last entries to this thread? This is fantastic!
| - Alpha Tester and Zealous Believer
Image

Kingdom of Hyperion founding Duchy - A practical RP Community est. 1999 - Apply Today!

Return to General Discussion