Es createscriptlist

From EventScripts Community Encyclopedia


Overview

Syntax: es_createscriptlist <keygroup-name>

Note: Command parameters are described inside the < and > characters. Optional parameters are contained within [ and ] characters.

Variation of this command that doesn't expand variables: '

Description

Creates a keygroup with a list of all scripts currently loaded and their status.


Parameters

  • keygroup-name - name of the keygroup to create (be sure it doesn't already exist).

Examples

es_createscriptlist test

would create a keygroup similar to the following:

"test"
{
	"corelib"
	{
		"status"		" enabled"
	}
	"corelib/score"
	{
		"status"		" enabled"
	}
	"corelib/average"
	{
		"status"		" enabled"
	}
	"corelib/xalias"
	{
		"status"		" enabled"
	}
	"corelib/playergetset"
	{
		"status"		" enabled"
	}
	"corelib/refcount"
	{
		"status"		" enabled"
	}
	"popup"
	{
		"status"		" enabled"
	}
	"noderunner"
	{
		"status"		" enabled"
	}
	"rocketguns"
	{
		"status"		" enabled"
	}
	"vswear"
	{
		"status"		" enabled"
	}
}

Sample code to show loaded scripts:

event player_say
{
   if (event_var(text) == loadedscripts) do
   {
      // create a keygroup with all loaded scripts.
      es_createscriptlist scripts
 
      es_xsetinfo script 0
      // loop through each script and tell the player it's loaded.
      es_foreachkey script in scripts "es_tell event_var(userid) #multi #lightgreen server_var(script)#green is loaded!"
   }
}


Notes

  • You need to call es_keygroupdelete on the keygroup created by this, or the keygroup will stay around forever.
  • This is particularly handy when you need to loop through scripts with es_foreachkey.


See also

blog comments powered by Disqus