colornames <0|1|2>
Always colorize player names by team: disable (0), players, but no spectators (1), everyone (2)
This variable superseeds teamcolortext and teamcolornames.
(default: 1)
showtimeleft <0|1>
Shows a remaining map time counter.
(default: 1)
showpingdisplay <0|1>
Shows your ping on the gamehud.
(default: 1)
shownetworkdisplay <0|1>
Shows bandwith stats on the gamehud.
(default: 0)
Info: Left side = incoming, Right side = outgoing. p/s = packets/second.
Note: Width/Height needs to be >= 1.6 with showtimeleft and or showpingisplay enabled.
showstatsdisplay <0|1>
Shows game stats on the gamehud.
(default: 1)
statsdisplayfmt
(default: "Frags: ^f0%f ^f7Deaths: ^f3%d ^f7Kpd: ^f0%k ^f7Acc: ^f1%a%%")
Available format specifiers:
%n | Name |
%t | Team |
%i | Teamkills |
%f | Frags |
%d | Deaths |
%k | Kills per Death |
%a | Accuracy |
%p | Ping |
%s | State (alive, dead, ..) |
%x | Flags / Skulls |
%g | Gamemode |
%u | Gamespeed |
%l | Game Paused (string) "paused " or "" |
%m | Mapname |
%o | Mapinfo |
%e | Mastermode (string) |
demogamespeed <0|1>
Take over Gamespeed from demos instead of playing them in real time.
Note: This variable can't be changed during demo playback.
(default: 0)
demomillis <ms>
Jump forward to <ms> in demo. Attention: Jumping back is not supported!
scaletimeleft <0|1>
Scale Time Left timers always to real time.
(default: 1)
highlight <0|1|2|3>
Mark highlight words: disable (0), red (1), blinking (2), looping through all colors (3)
(default: 0)
highlightwords <word1 word2 "word 3" ... wordn>
Set the highlight words.
highlightteamkillmsg <0|1|2|3>
Mark teamkill message: disable (0), red (1), blinking (2), looping through all colors (3)
(default: 0)
chatsound <0|1>
Enable sounds for each chat (0) or highlighted (1) line.
(default: 1)
indentfrags <0-8>
Indent frag messages by NUM spaces.
(default: 4)
conshowtime <0|1>
Show a hh:mm:ss timestamp for each console message.
(default: 0)
contimecolor <0-9>
Color for console timestamp.
(default: 4)
centerconsize <0-5>
Number of lines in centered text console.
(default: 2)
centerconwidth <0-100>
Width of centered text consolde.
(default: 80)
centerconfade <0-60>
Time in seconds to display centered text console lines.
(default: 10)
centerconfilter <0-0x7FFFFFF>
-
(default: 0x20000 (CON_GAMEEVENT))
historywrite <0|1>
Write console input history to history.cfg on exit (1).
Any interactive call to writehistory
ignores this variable.
(default: 1)
historywritechat <0|1>
include chat in history.cfg (1)
(default: 0)
clientcountry <cn>
Client country.
clientcountrycode <cn>
Client country (ISO 6166-1) codes.
extinfopingrate <1000-10000>
Polling interval for extinfo.
(default: 2000)
wcautoversioncheck <0-1>
Check for new versions of WC on startup.
(default: 1)
wcinfo [<get>]
Shows WC version, Sauerbraten revision, Compiler version and Lib versions.
Pass 1 for get to return a string instead of outputing it in the console.
wccheckversion
Command to check if there is a new version of WC available.
wcupdategeoipdatabase
Get latest GeoIP Database.
isfullscreen
Return fullscreen status.
consearch <text> [0|1]
Filter out console lines not matching "text".
If the third parameter is 1, "text" has to be a valid Perl compatible regular expression.
condump [filename[.txt]]
Write filtered output of "full console" to filename.txt.
Default filename is condump.txt.
addhistory <flags> <prompt> <action> <text>
Add a new console input history entry.
writehistory [filename[.cfg]];
Write console input history to filename.cfg.
Default filename is history.cfg.
getclientcountry <cn>
Get Player Country.
getclientcountrycode <cn>
Get Player Country Code (Example: AT, DE, ... (ISO 6166-1))
getteamkills <cn>
Get Player teamkills.
getping <cn>
Get Player ping.
recordclientdemo [name]
Start client side demo recording.
stopclientdemo
Stop client side demo recording.
clientdemoautorecord <0|1>
Record demos automatically.
clientdemorecordextinfo <0|1>
Record extinfo into demos.
(Default: 1)
clientdemocompresslevel <0|9>
Sets compress level for client demos.
(Default: 5)
clientdemoskipservmsg <0|1>
Don't record server messages in client demos.
clientdemoskipservcmds <0|1>
Don't record result of commands in client demos.
clientdemorecording
Returns 1 if client demo recording is active.
clientdemorawsize
Returns the raw size of the demo being recorded.
searchdemo [[<gamemode>] [<servername>] [<mapname>] [<name>] [<frags>] [<deaths>] [<acc>] [<teamkills>] [<flags>] [<priv>]]
Search for demos / players in the demos matching the given parameters.
Note: This only works if the demo contains extinfo information.
There is also a GUI for this available in the ogros-menu: /searchdemogui
stopsearchdemo
Stops searchdemo.
searchdemothreadlimit <1|logical-cpu-count>
Sets how much threads should be use at a single time for searching.
(Default: logical-cpu-count)
searchdemomaxresults <0|250>
Sets how much entries will be shown in the result dialog.
(Default: 100)
searchdemomindemosize <0|0x7FFFFFFF>
Sets minimum demo size.
(Default: 0)
getdemoduration <demo>
Get duration of the demo in milliseconds. (Returns -1 on error).
jumpto <mm[:ss]>
Jump forward to mm[:ss] time left in demos. Attention: Jumping back is not supported!
gettotalmillis
Returns current totalmillis.
getlastmillis
Returns current lastmillis.
ifnotdeclared <variable name> <code>
Executes "code" if variable doesn't exist.
roundf <float num> <n-decimals>
Rounds given float number with n-decimals.
checkregex <rule> <text>
Returns 1 on match, otherwise 0.
getgamestatefmt <cn> <format>
Returns a formatted string with the given format specifiers
See statsdisplayfmt table for available format specifiers.
Note: Always requires a valid cn.
getosstring
Returns the operating system string.
The Result may be: win64, win32, linux64, linux32, osx64, osx32, bsd64, bsd32, other64, other32
guititleleftalign
Same as guititle, but aligns the text on the left side.
countryflagpath <country code>
Returns path to flag icon.
Colors
Shaders
Enable with /addpostfx sepia or /setpostfx sepia.
Enable with /nightvision <val>
Name Completion
Name completion works with SHIFT + TAB.
Console Input Search
Console input search works with CTRL + R or CTRL + S (unix shell style, S forward, R backward).
Note: On OS X CTRL is mapped to the META key.
filterservermod <mod num>
Filter servers by server mod, -3 for ogros mod, -2 for hopmod (0 for all).
filterservercountry <country code>
Filter servers by country code ("" for all).
filterserverdescription <description>
Filter serververs by server description ("" for all).
filterservermode <mode num>
Filter servers by game mode (-4 for all).
filterservermodestring <mode string>
Filterby servers by game mode string ("" for all).
filterservermastermode <mode num>
Filter servers by server mastermode (-2 for all).
serverbrowsermicrosecping <0|1>
Show ping in micro seconds instead of milliseconds in the serverbrowser.
(default: 0)
extinfoserverbrowser <0|2>
Shows the players which are on the server in a gui window,
when you click on a server in the serverbrowser, with connect buttons at the bottom.
If you set extinfoserverbrowser to 2, then the players from non empty servers will be already requested,
before you click on a server, therefore players will be shown earlier when you click on a server.
If you have problems using /extinfoserverbrowser 2 then use /extinfoserverbrowser 1 instead (increasing servpingrate might also help).
Some providers are dropping packets (german t-com for example) - which may cause some servers to disappear.
Note: Ping Rate is servpingrate and not extinfopingrate in this case.
(default: 1)
extinfoconnect <server> [<port> [<pass>]]
Use this command instead of connect to see the players which are on the server before connecting.
processservers
Keep processing/pinging the serverlist, useful for loopextinfoplayers/getextinfoplayercount.
loopextinfoplayers <playername> <country code> <callbackargs> <callback>
Loop through all players matching the given player/country name ("" for all).
Example:
loopextinfoplayers "" "" "server_ip ignore server_port ignore server_name ignore8 player_cn player_ping player_name ignore player_frags player_deaths" [ echo (format "Server Address:%1:%2 Server Name:%3 CN:%4 Name:%5 Ping: %6 Frags: %7 Deaths: %8" $server_ip $server_port $server_name $player_cn $player_ping $player_name $player_frags $player_deaths) ]
Full callback arg list:
hostname hostint port serverping serverdesc secleft numplayers maxplayers mastermode gamemode mapname gamepaused gamespeed cn ping playername playerteam frags flags deaths teamkills acc health armour gunselect priv state playercountrycode playercountry
getextinfoplayercount
Returns the total (extinfo) player count.
showextinfo <0|1>
Enable extended player infos.
(default: 1)
showfrags <0|1>
Show extended info frags.
(default: 1)
showdeaths <0|1>
Show extended info deaths.
(default: 1)
showkpd <0|1>
Show extended info kills per death.
(default: 0)
showacc <0|1>
Show extended info accuracy.
(default: 1)
showtks <0|1>
Show extended info teamkills.
(default: 0)
showspectatorping <0|1>
Show ping of spectators.
(default: 0)
showcountry <0|1|2|3|4|5>
Show country: ISO 6166-1 code (1|3), country name (2|4), country flag(3|4|5).
(default: 3)
showserveruptime <0|1>
Show Server Uptime in Scoreboard.
(default: 0)
showservermod <0|1>
Show Server Mod in Scoreboard (If info is available).
(default: 0)
scoreboardtextcolour <0x000000|0xFFFFFF>
Sets text colour in scoreboard (head).
(default: 0xFFFFDD)
scoreboardtextcolourhead <0x000000|0xFFFFFF>
Sets text colour in scoreboard.
(default: 0xFFFF80)
showplayerdisplay <0|1>
Shows a small scoreboard on the gamehud.
(default: 0)
playerdisplayshowspectators <0|1>
Show spectators in the player display.
(default: 1)
playerdisplayfontscale <25|30>
Player Display font scale.
(default: 25)
playerdisplayrightoffset <-100|100>
Player Display right offset (Frags / Acc column).
(default: 0)
playerdisplayheightoffset <0|600>
Player Display height offset.
(default: 250)
playerdisplaywidthoffset <-50|300>
Player Display height offset.
(default: 0)
playerdisplaylineoffset <-30|50>
Player Display line offset.
(default: 0)
playerdisplayplayerlimit <1|64>
Max Players shown in the Player Display.
(default: 32)
playerdisplaymaxnamelen <4|15>
Max shown player name length in the Player Display.
(default: 13)
playerdisplayalpha <20|255>
Alpha value of the Player Display (opacity / transparency).
(default: 150)
oldscoreboard <0|1>
Show name column on the same place as known from <=Justice Edition.
(default: 0)
showdemotime <0|1>
Shows the time it was in the game in the scoreboard (If available).
(default: 1)
scriptevent <eventname> <eventargs> <function>
Creates a new script event.
delscriptevent <eventid>
Deletes a script event.
delallscriptevents
Deletes all script events.
getthiseventid
Works only in events: Returns ID of current event.
getscripteventcount
Returns count of current installed events.
listscriptevents
Lists current installed events.
Examples:
scriptevent "playerrename" "player_cn player_name_old player_name_new" [ echo (concat $player_name_old "renamed to" $player_name_new) ]
If you only need the cn as an argument:
scriptevent "playerrename" "player_cn" [ echo (concat "cn" $player_cn "renamed") ]
If you don't need any arguments at all you may also skip the "arguments" and start with the function directly:
scriptevent "playerrename" [ echo "someone renamed" ]
You can also use | or , for event argument declaration:
scriptevent "playerrename" player_cn|player_name_old|player_name_new [ echo (concat $player_name_old "renamed to" $player_name_new) ]
scriptevent "playerrename" player_cn,player_name_old,player_name_new [ echo (concat $player_name_old "renamed to" $player_name_new) ]
If you want to be able to uninstall events at runtime, then you need to save the returned event id from the scriptevent command.
For example:
event_id = (scriptevent "playerrename" "player_cn player_name_old player_name_new" [ echo (concat $player_name_old "renamed to" $player_name_new) ])
if (delscriptevent $event_id) [ echo "uninstalled event!" ]
Keeping event functions as external functions:
playerrename_event = [ echo (concat $player_name_old "renamed to" $player_name_new) ]
scriptevent "playerrename" "player_cn player_name_old player_name_new" $playerrename_event
Player Events: | ||
playerconnect | clientnum, name | |
playerdisconnect | clientnum, name | |
playerrename | clientnum, oldname, newname | |
playerjoinspec | clientnum, name | |
playerleavespec | clientnum, name | |
playerswitchteam | clientnum, name, oldteam, newteam, reason | |
playertext | clientnum, name, text | use "result 1" to prevent console message from being shown |
playerteamtext | clientnum, name, text | use "result 1" to prevent console message from being shown |
playerfrag | clientnum, name, actor clientnum, actor name | use "result 1" to prevent console message from being shown |
playerteamkill | clientnum, name, actor clientnum, actor name | |
playerpingupdate | clientnum, name, ping value | |
CTF Events: | ||
flagscore | clientnum, actor name, actor flagcount, team flagcount, was dropped | returned string will be appended to display string |
flagdrop | clientnum, actor name, actor flagcount | returned string will be appended to the console message |
flagtake | clientnum, actor name, actor flagcount | returned string will be appended to the console message |
flagreturn | clientnum, actor name, actor flagcount | |
flagreset | - | |
coaf | team name | |
COLLECT Events: | ||
skullscore | clientnum, actor name, actor flagcount, team flagcount, was dropped | returned string will be appended to display string |
skulltake | clientnum, actor name, actor flagcount | returned string will be appended to the console message |
coas | team name | |
CAPTURE Events: | ||
basecaptured | owner team, enemy team, base name | |
baselost | owner team, enemy team, base name | |
coab | team name | |
Misc Events: | ||
startup | - | |
shutdown | - | |
frame | - | |
mapstart | gamemode name, map name | |
intermission | gamemode name, map name | |
servmsg | is wc message, text | use "result 1" to prevent console message from being shown |
masterupdate | master clientnum, master name, privilege (numeric) | |
mastermodeupdate | master clientnum, mastermode | master clientnum might be < 0 |
consoleinput | text | use console input (emits a warning when being installed) |
Plugin Events: | ||
pluginload | pluginname | |
pluginunload | pluginname | |
Demplayback Events: | ||
demostart | - | |
demoend | - | |
Extinfo Events: | ||
servermod | servermod | currently supported: oomod and hopmod |
extinfoupdate |
cn, ping, name, team, frags, flags, deaths, teamkills, acc, health, armour, gun, privilege, state |
|
countryupdate | cn, country, countrycode | |
Network Events: | ||
connect |
ip as string, port ip byte 1, ip byte 2, ip byte 3, ip byte 4 |
|
disconnect | ||
servermod | servermod | currently supported: oomod and hopmod |
bandwithupdate |
in (kb/s), out (kb/s), in packets (p/s), out packets (p/s), in (total kb), out (total kb), in packets (total), out packets (total), reliable packets lost (total) |
called once in a second when connected |
Event System Events: | ||
scriptinit | - | Only called in current file after loading, gets automaticly uninstalled after execution |
Demo Events: | ||
clientdemostart | demofilename | |
clientdemoend | demofilename | |
GUI Events: | ||
showgui | guiname | |
closegui | guiname |
Getting unused event variables warnings? Then you've declared event args, but you aren't using them.
You can simply fix this by replacing the variable name with ignore or null.
Hint: You can switch this warning off by setting eventsystemnounusedcallargwarning to 1.
Example:
scriptevent "playerconnect" "player_cn player_name" [ echo $player_name ]
In this case "player_cn" is unused, the fixed version would be:
scriptevent "playerconnect" "ignore player_name" [ echo $player_name ]
gettimestamp
Get current unix timestamp.
getgametimestamp
Get game timestamp.
Note: Returns 0 if not available.
formattimestamp <timestamp> <format>
Format given timestamp. See Link for available format specifiers.
scriptvector <name> [[<index>] [<value>] [<no-warnings>]]
Stores "value" with index "index" in vector "name".
If no value is given, then the value of "index" in vector "name" is returned.
Note: You always need to create a scriptvector first, before you can store values to it.
scriptvector "test" - creates / clears scriptvector test
scriptvector "test" "x" "z" - stores z in index x
scriptvector "test" "x" - returns value of index "x" = z
scriptvectorlength <name>
Return how much objects are stored in the given Script Vector.
loopscriptvector <name> <index (ident)> <value (ident)> <code> [<start> <end>]
Iterate through a Script Vector.
loadscriptvector <file>
Load Script Vector from a file.
writescriptvector <file>
Write Script Vector to a file.
delscriptvectorindex <name> <index>
Delete index "index" in vector "name", returns 1 on success.
delscriptvector <name>
Delete Script Vector "name", returns 1 on success.
httpproxy <host:port>
Use proxy for http requests.
(default: "")
httpspeedlimit <limit in kb/sec>
Limit download tranfser rate per request to .. kb/s - 0 for unlimited.
Will also take affect on currently running http requests.
(default: 0)
httprequest <url> [[<callback args>] [<callback>] [<referer>] [<useragent>]
Returns the request handle id, or 0 on error. This function returns 0, when there are too much active requests, or no url is given.
Binary files are NOT supported, because they may contain zeroes, which can't be seen from cubescript!
Limit is 10 concurrent requests. Connect timeout is 5 seconds.
delhttprequest <id>
Uninstalls an active http request. Returns 1 on success, otherwise 0.
Attention: Callback will be still called, but responsecode will be set to -2,
therefore always use httpresponsecodeok to check the response code.
httpresponsecodeok <response code>
Returns 1 if there haven't happened any internal errors, and response code is equal to 200.
Example:
rv = (httprequest "http://83.169.44.106/services/ipecho.php" "request_ok response_code response_data response_datalen" [ if (&& ($request_ok) (httpresponsecodeok $response_code)) [ echo (format "Response Code: %1 Response Data Length: %2 Response Data: %3" $response_code $response_datalen $response_data) ] [ error "http request failed, or was interrupted with delhttprequest" ] ]) if (= $rv 0) [ error "failed to create http request: too many active requests" ]
addplugins
Load all available plugins. Returns the number of loaded plugins for cubescript usage.
delplugins
Unload all loaded plugins. Returns the number of unloaded plugins for cubescript usage.
addplugin <name>
Load a plugin by name. Returns 1 if the plugin was successfully loaded, 0 otherwise (for cubescript usage).
delplugin <name>
Unload a plugin by name. Returns 1 if the plugin was successfully unloaded, 0 otherwise (for cubescript usage).
listplugins
List loaded plugins.
getplugins
Get all loaded plugins as a list for cubescript usage.
isplugin <pluginame>
Returns 1 if there is a loaded plugin with the given name, 0 otherwise for cubescript usage.
listpluginparams <pluginname>"
List plugin parameters.
getpluginparams <pluginname>"
Get available plugin parameters as a list for cubescript usage.
<pluginame> <param> [[value 1] ... [value n]]
Set a value for a plugin parameter.
setplugin <name> <param> [[value 1] ... [value n]]
Alternative to the previous command.
<pluginame>get <param>
Get a plugin parameter value for cubescript usage.
getplugin <name> <param>
Alternative to the previous command.
start
Start audio capture.
stop
Stop audio capture.
devices
List available devices.
device <id>
Set capture device. id is the respective value from the devices list.
mixratio <0-200>
Set the mixer ratio of the input sound and the sauer sound.
0 means no input sound, 200 means no sauer sound.
(default: 100)
srcgain <0-200>
Change sauer volume.
0 means no sound, 200 doubles the amplitude.
(default: 100)
mixgain <0-200>
Change capture volume.
0 means no sound, 200 doubles the aplitude.
(default: 100)
prefill <val>
Prefill the capture buffer before mixing.
(default: 20)
acodec "name"
Audio encoder string (supported by linked in ffmpeg/libavcodec)
vcodec "name"
Video encoder string (supported by linked in ffmpeg/libavcodec)
abr <NUM>
Audio bit rate in kb/s.
(default: 128)
asr <11025-96000>
Audio sample rate in Hz.
(default: 44100)
vbr <NUM>
Video bit rate in kb/s.
(default: 2000 for libx264/vp8 - 6000 otherwise)
gop <NUM>
Group of pictures (interval of the key/intra frames).
(default: 12 for mpeg1/2, $moviefps otherwise)
aopt <option> <value>
Set additional audio codec options (see man ffmpeg).
You have to set the opts each time before recording
vopt <option> <value>
Set additional video codec options (see man ffmpeg).
You have to set the opts each time before recording
threads <0-64>
Set number of threads for audio and video codec (sum).
The default of (0) sets the thread count to numbers of available CPUs.
athreads <0-64>
Set number of threads for audio codec.
The default of (0) sets the thread count to numbers of available CPUs.
vthreads <0-64>
Set number of threads for video codec.
The default of (0) sets the thread count to numbers of available CPUs.
Examples
First, load the plugin:
/addplugin movieencoder
Record an .avi using MPEG4 ASP (XVID, DIVX) video and MP3 audio:
/movie mymovie
Record an .avi using MPEG4 ASP (XVID, DIVX) video and MP3 audio, with video bitrate 2000 and gop 1 (gop 1 means here that you can easily cut the video at each frame without reencoding, but it increases the size of the resulting movie a lot!):
/movieencoder vbr 2000 /movieencoder gop 1 /movie mymovie
Record an .avi using the huffyuv video codec (lossless) and MP3 audio (note that there is also an FFmpeg ffvhuff encoder which is able to use the YUV420P format and therefore has a lower bitrate (12bpp instead of 16bpp):
/movieencoder vcodec huffyuv /movie mymovie.avi
Record a DVD compatible .vob file using MPEG2 video and MP2 audio:
/movie mymovie.vob
Record a .webm (Google WebM) compatible movie (VP8 video and VORBIS audio):
/movie mymovie.webm
Change the codec options of libvpx (VP8) for fast encoding
/movieencoder vopt quality realtime /movie mymovie.webm
Stream to ffserver (see ffserver.conf for examples / ffserver should be at the same version as linked in ffmpeg - see doc/ for version:
/movie http://localhost:18090/feed1.ffm
connect [<host> [<port> [<password>]]]
Connect to a mpd server.
disconnect
If connected, close the connection to the mpd server.
play [<pos>]
Starts playing the song-number specified. If none is specified, plays the last played song.
pause
Toggles between play and pause.
stop
Stops playing.
next
Starts playing next song.
prev
Starts playing previous song.
seek <percentage>
Seeks within current song by percentage (0-100).
queue <busy|curpos|length|get>
Playlist:
Get status, wheather playlist is busy due to updates.
Get position of the current song within the playlist.
Get playlist length.
Get song infos about song <num> in playlist. The output format can be changed by providing a format string <format>. See cpfmt for syntax.
(default format: "\f7%a: \f7%A | %T \f9[%t]\fr")
xfade <seconds>
Sets the amount of crossfading in seconds between songs (0 disables crossfading).
volp
Increases the volume by 5.
volm
Decreases the volume by 5.
vol <level>
Sets the volume to <level> (0-100).
mute
Toggles mute.
consume <0|1>
Enable/Disable consume mode.
random <0|1>
Enable/Disable random mode.
repeat <0|1>
Enable/Disable repeat mode.
single <0|1>
Enable/Disable single mode.
cp [<format>]
Returns the current song with the format specified in <format>. If no format provided, the format defined in cpfmt is used.
cpfmt <format>
Sets the default format for cp command.
(default: "\fs\f3\fs\fb%s\fr\f0%A \f1- \f0%T \f1[%e/%t] %p%% \f9(%v%%)\fr")
Available format specifiers:
%A | Artist |
%T | Title |
%a | Album |
%b | Bitrate in kbps |
%c | Comment |
%e | Elapsed time of current title in seconds |
%g | Genre |
%n | Track |
%p | Position within current title in percent |
%s | Pause status |
%t | Total time of current title |
%v | Volume |
drawtext <line text>
Example: drawtext "1 drawn on first line"
updatelcd
Flush text buffer to keyboard.
Q: Why is my ping in the scoreboard different compared to the one on the game hud?
A: Ping in scoreboard is less accurate due to rounding.
Q: I found a bug, how do I tell you?
A: Best way is to write us a detailed mail to admin@ogros.org.