Table of Contents

About

Sometimes you may want to restart Corrade manually and that can be done via the execute Corrade command by telling the operating system to restart Corrade. On Windows, Corrade can run as a service and, if you run Corrade as a service, then it is fairly easy to write an LSL script to restart the Corrade service from within the grid. The following is an LSL script contributed by JP Bluebird from Bluebird Designs and will allow you to manually restart Corrade's service by using the "Execute" command and PowerShell.

Requirements

  • Execute Permission enabled in the Corrade configuration.
  • Windows PowerShell installed on Host computer.

Code

manual_corrade_restart.lsl
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CONFIGURATION
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
string CORRADE  = "00000000-0000-0000-0000-000000000000"; // The UUID / Key of the scripted agent.
string GROUP    = "My Group";                             // Bot's Group Name as defined in the ini File
string PASSWORD = "mypassword";                           // Bot's Password as defined in the ini File
 
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// END CONFIGURATION
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
string wasKeyValueEncode(list kvp)
{
  if(llGetListLength(kvp) < 2) return "";
  string k = llList2String(kvp, 0);
  kvp = llDeleteSubList(kvp, 0, 0);
  string v = llList2String(kvp, 0);
  kvp = llDeleteSubList(kvp, 0, 0);
  if(llGetListLength(kvp) < 2) return k + "=" + v;
  return k + "=" + v + "&" + wasKeyValueEncode(kvp);
}
 
default
{
  touch_start(integer num)
  {
    llInstantMessage(CORRADE, wasKeyValueEncode([
      "command",   "execute",
      "group",     llEscapeURL(GROUP),
      "password",  llEscapeURL(PASSWORD),
      "file",      "Powershell",
      "parameter", "Restart-Service Corrade"
    ]));
  }
}
 
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Contributed by JP Bluebird (Bluebird Designs)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////

secondlife/scripted_agents/corrade/projects/in_world/restart_corrade_with_powershell.txt ยท Last modified: 2022/11/24 07:45 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.