User Tools

Site Tools


scripting:reference:system_functions

This is an old revision of the document!


System Functions

The scripting engine provides a set of 'System Functions', usually preceded by sys. Below is the complete list of system functions currently available.

(Note also the list of special system control functions which includes special cases like the 'Sleep' function etc)

Text Functions
Player Information
Inventory and Wealth manipulation
Building Information
World map functions
ConstructionFunctions
Scripted Subgames
Building Ownership
Town information and control
Maths Functions
Misc. other functions

Battle game Functions

BattleSetPreludeTime

BattleSetNumRounds

BattleSetRoundTime

BattleSetRoundScore

BattleSendChallenge

Misc other functions

sysRealTime

Format sysRealTime ( [Type] )
Description Returns details of the current real time (according to the server clock)
Parameters Type field specifying the date or time to fetch
Returns Depending on the type field:
Year - returns the current year (e.g. 2014)
Month - returns the current month number (1 to 12)
Day - returns the current day number (1 to 31)
Hour - returns the current hour (0 to 23)
Minute - returns the current minute (0 to 59)
Second - returns the current second (0 to 59)
UnixTime - number of seconds passed since 1st Jan, 1970

Example:

Event( "UseItem", "Tea" )
{
   $hour = sysRealTime( "Hour" )
   if ( $hour < 18 )
   {
      *msg %PLAYER% Tea can only be used at tea-time (6pm - 8pm)
    }
    else if ( $hour >= 20 )
    {
      *msg %PLAYER% Tea can only be used at tea-time (6pm - 8pm)    
    }
    else
    {
        *notifylarge %PLAYER% Tea-time!
    }
}

sysRaceIsActive

TBD

scripting/reference/system_functions.1580294638.txt.gz · Last modified: 2020/01/29 04:43 by mit

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki