GetInfo
Script function world.GetInfo Read about scripting Type Method Summary Gets information about the current world Prototype `VARIANT GetInfo(long InfoType);` View list of data type meanings Description `Gets details about the current world. You can obtain various "types" of information about the world by specifying an "InfoType". The possible InfoTypes are: (strings - configuration) 1 - Server name (IP address) 2 - World name 3 - Character name 4 - Send to world - file preamble 5 - Send to world - file postamble 6 - Send to world - line preamble 7 - Send to world - line postamble 8 - World notes 9 - Sound on new activity 10 - Scripts editor 11 - Log file preamble 12 - Log file postamble 13 - Log file line preamble - player input 14 - Log file line preamble - notes 15 - Log file line preamble - MUD output 16 - Log file line postamble - player input 17 - Log file line postamble - notes 18 - Log file line postamble - MUD output 19 - Speed Walk Filler 20 - Output window font name 21 - Speed walk prefix 22 - Text sent on connecting 23 - Input font name 24 - Paste to world - file preamble 25 - Paste to world - file postamble 26 - Paste to world - line preamble 27 - Paste to world - line postamble 28 - Scripting language 29 - Script function for world open 30 - Script function for world close 31 - Script function for world connect 32 - Script function for world disconnect 31 - Script function for world get focus 32 - Script function for world lose focus 35 - Script file name 36 - Scripting prefix 37 - Auto-say string 38 - Auto-say override 39 - Tab-completion defaults 40 - Auto-log file name 41 - Recall window - line preamble 42 - Terminal ID (telnet negotiation) 43 - Mapping failure message 44 - Script function for MXP starting up 45 - Script function for MXP closing down 46 - Script function for MXP error 47 - Script function for MXP tag open 48 - Script function for MXP tag close 49 - Script function for MXP variable set 50 - Sound to play for beeps (strings - calculated at runtime) 51 - Current log file name 52 - Last "immediate" script expression 53 - Current status line message 54 - World file pathname 55 - World title 56 - MUSHclient application path name 57 - World files default path (directory) 58 - Log files default path (directory) 59 - Script files default path (directory) 60 - Plugin files default path (directory) 61 - World TCP/IP address (as string, after DNS lookup, eg. 10.0.0.16) 62 - Proxy server TCP/IP address (as string, after DNS lookup, eg. 10.0.0.22) 63 - Host name (name of this PC) 64 - Current directory 65 - Script function for world save 66 - MUSHclient application directory 67 - World file directory 68 - MUSHclient startup (initial) directory (booleans - calculated at runtime) 101 - 'No Echo' flag 102 - Debug incoming packets 103 - Decompressing 104 - MXP active 105 - Pueblo active 106 - Disconnected flag (true if not connected) 107 - Currently-connecting flag 108 - OK-to-disconnect flag 109 - Trace flag 110 - Script file changed 111 - 'World file is modified' flag 112 - Automapper active flag 113 - 'World is active' flag 114 - 'Output window paused' flag (numbers (longs) - calculated at runtime) 201 - Total lines received 202 - Lines received but not yet seen (new lines) 203 - Total lines sent 204 - Packets received 205 - Packets sent 206 - Total uncompressed bytes received 207 - Total compresssed bytes received 208 - MCCP protocol in use (0=none, 1 - or 2) 209 - MXP error count 210 - MXP tags received 211 - MXP entities received 212 - Output font height 213 - Output font width 214 - Input font height 215 - Input font width 216 - Total bytes received 217 - Total bytes sent 218 - Count of variables 219 - Count of triggers 220 - Count of timers 221 - Count of aliases 222 - Count of queued commands 223 - Count of mapper items 224 - Count of lines in output window 225 - Count of custom MXP elements 226 - Count of custom MXP entities 227 - Connect phase: (0=not connected, 1=MUD name lookup, 2=Proxy server name lookup, 3=connecting to MUD, 4=connecting to proxy server, 5=proxy server phase 1, 6=proxy server phase 2, 7=proxy server phase 3, 8=connected to MUD) 228 - World TCP/IP address (after DNS lookup, as a number) 229 - Proxy server TCP/IP address (after DNS lookup, as a number) 230 - Script execution depth 231 - Log file size (0 if no log file open) 232 - High-performance counter output (in seconds) (double) 233 - Time spent executing trigger matching (double) 234 - Time spent executing alias matching (double) - note: see GetScriptTime function for the time taken to execute scripts 235 - Number of world windows open 236 - First column of the selection in the command window (1-relative) - if no selection, the column to the right of the cursor. - If the cursor is at the start of the window, it will return 1. 237 - Last column of the selection in the command window (1-relative) - if no selection, returns 0. - For example, if "abcd" is in the command window and "bc" is selected then - GetInfo (236) will return 2 and GetInfo (237) will return 3. 238 - Current "show state" for the first world window of this world. Hide = 0 Shownormal = 1 Normal = 1 Showminimized = 2 Showmaximized = 3 Maximize = 3 Shownoactivate = 4 Show = 5 Minimize = 6 Showminnoactive= 7 Showna = 8 Restore = 9 Showdefault = 10 239 - The "source" of the current scripted action. It is intended for scripters who want to know if a particular script is running because of user (player) action, or some sort of automated response. Effectively this can be used to determine if the player is AFK or not. The returned value will be a number in the range 0 to 10, with these meanings: UnknownActionSource = 0 --> no particular reason, could be plugin saving UserTyping = 1 --> user typed something in the command area and pressed <Enter> UserMacro = 2 --> user typed a macro (eg. F2) UserKeypad = 3 --> user used the numeric keypad UserAccelerator = 4 --> user used an accelerator key UserMenuAction = 5 --> item chosen from pop-up menu TriggerFired = 6 --> trigger fired TimerFired = 7 --> timer fired InputFromServer = 8 --> input arrived (eg. packet received) WorldAction = 9 --> some sort of world action (eg. world open, connect, got focus) LuaSandbox = 10 --> executing Lua sandbox Effectively, if GetInfo (239) returns a number in the range 1 to 5 inclusive, then the script is running in response to direct player input. Other numbers would indicate automated processing like a trigger or timer firing, input from the MUD, a plugin callback being called, and so on. There is no entry in the list above for an alias being called, because aliases can be triggered by user input, "send to script (Execute function)", macros and so on. Thus, the number above would indicate the "real" reason an alias was called. 240 - The average width, in pixels, of a character in the output window, in the current output font. This figure is used when calculating how many characters would fit in the current width of the output window. 241 - The height, in pixels, of a character in the output window, in the current output font. (dates - calculated at runtime) 301 - Time connected 302 - Time log file was last flushed to disk 303 - When script file was last modified 304 - The current date/time` VBscript example
    '
    '  List the lot
    '

    dim i, info

    for i = 1 to 304
      info = world.GetInfo (i)
      if not isnull (info) then
       world.note i & " = " & info
      end if
    next

    '
    ' Find world IP address
    '

    world.note world.getinfo (1)
Jscript example
    //
    //  display all information
    //

    for (i = 1; i <= 304; i++)
      {
      info = world.getinfo (i);
      if (info)
        world.note (i + " = " + info);
      }
PerlScript example
    #
    #  Display world IP address
    #

    $world->note ($world->GetInfo (1));
Python example
    #
    #  display all information
    #

    for i in range (304):
      info = world.getinfo (i)
      if (info):
        world.note (str(i) + " = " + str(info))
Lua example
    --
    --  display all information
    --

    for i = 1, 304 do
      info = GetInfo(i)
      if info then
        Note (i, " = ", info)
      end
    end
Return value
    The specified information about the world, as described above.
    An EMPTY variant, if a date is undefined.
    A NULL variant if the InfoType is not a valid type.
See Also ... Topic Information Functions Debug (Displays debugging information about the world) EchoInput (A flag to indicate whether we are echoing command input to the output window) GetAliasInfo (Gets details about an alias) GetConnectDuration (Returns the number of seconds this world has been connected.) GetEntity (Retrieves the value of an MXP server-defined entity) GetHostAddress (Returns a list of IP addresses that correspond to a host name on the Internet) GetHostName (Returns the host name that corresponds to an IP address on the Internet) GetInternalCommandsList (Returns a list of the internal MUSHclient command names) GetLineCount (Gets count of lines received) GetLineInfo (Gets details about a specified line in the output window) GetLinesInBufferCount (Returns the number of lines in the output window) GetMainWindowPosition (Returns the position and size of the main MUSHclient window) GetNotepadWindowPosition (Returns the position and size of the specified notepad window) GetNotes (Gets the world's notes) GetQueue (Returns a variant array which is a list of queued commands) GetReceivedBytes (Returns the number of bytes received from the world) GetRecentLines (Assembles a block of text from recent MUD output) GetSelectionEndColumn (Returns the endling column of the selection in the output window) GetSelectionEndLine (Returns the last line of the selection in the output window) GetSelectionStartColumn (Returns the starting column of the selection in the output window) GetSelectionStartLine (Returns the starting line of the selection in the output window) GetSentBytes (Returns the number of bytes sent to the world) GetStyleInfo (Gets details about a specified style run for a specified line in the output window) GetSysColor (Gets the colour of various windows items) GetSystemMetrics (Returns selected system information from Windows) GetTimerInfo (Gets details about a timer) GetTriggerInfo (Gets details about a named trigger) GetWorldID (Returns the 24-character ID of the current world) GetWorldWindowPosition (Returns the position and size of the current world window) GetWorldWindowPositionX (Returns the position and size of a specific world window) GetXMLEntity (Retrieves the value of a standard entity) IsConnected (Tests to see if the world is connected to the MUD server) SetChanged (Sets or clears the "document has changed" flag) SetEntity (Sets the value of an MXP entity) UdpPortList (Returns an array of all the UDP ports in use by this world) Version (Gets the MUSHclient version string.) WorldAddress (Returns the TCP/IP address of the current world.) WorldName (Gets the world's name) WorldPort (Returns the port number of the current world.) (Help topic: function=GetInfo) Documentation contents page