# UOX3 Script Engine

### API and Event handling

### Console Related Methods

Print
Prototype |
    void Print( string );
Purpose | Note: Include \n at the end of the string unless you're sending multiple messages
Example of Usage |
    console.Print( "Hello World!\n" );

Log
Prototype |
    void Log( logMsg );
    void Log( logMsg, filename );
Purpose | Logs a message either in default log file or in specified file. Note: Include \n at the end of the string unless you're sending multiple messages Optional second parameter is the name of the file to log the message into
Example of Usage |
    console.Log( "Logging a custom message to default logfile!" );
    console.Log( "Logging a custom message to a specific logfile!", "myCustomLogFile.log" );

Error
Prototype |
    void Error( errorMsg );
Purpose | Logs an error-message in default error log file
Example of Usage |
    console.Error( "I found an error, and I'm logging it!" );

Warning
Prototype |
    void Warning( warningMsg );
Purpose | Logs a warning-message in default log file
Example of Usage |
    console.Warning( "Logging a warning message!" );

PrintSectionBegin
Prototype |
    void PrintSectionBegin();
Purpose | Prints a section separator in the console
Example of Usage |
    console.PrintSectionBegin();

TurnYellow
Prototype |
    void TurnYellow();
Purpose | Activates yellow text in console
Example of Usage |
    console.TurnYellow();

TurnRed
Prototype |
    void TurnRed();
Purpose | Activates red text in console
Example of Usage |
    console.TurnRed();

TurnGreen
Prototype |
    void TurnGreen();
Purpose | Activates green text in console
Example of Usage |
    console.TurnGreen();

TurnBlue
Prototype |
    void TurnBlue();
Purpose | Activates blue text in console
Example of Usage |
    TurnBlue();

TurnNormal
Prototype |
    void TurnNormal();
Purpose | Activates normal text in console
Example of Usage |
    console.TurnNormal();

TurnBrightWhite
Prototype |
    void TurnBrightWhite();
Purpose | Activates bright white text in console
Example of Usage |
    console.TurnBrightWhite();

PrintDone
Prototype |
    void PrintDone();
    void PrintDone( bool );
Purpose | Prints colored [done] message in console
Example of Usage |
    console.PrintDone();

PrintFailed
Prototype |
    void PrintFailed();
    void PrintFailed( bool);
Purpose | Prints colored [failed] message in console
Example of Usage |
    console.PrintFailed();

PrintPassed
Prototype |
    void PrintPassed();
    void PrintPassed( bool );
Purpose | Prints colored [skipped] message in console
Example of Usage |
    console.PrintPassed();

ClearScreen
Prototype |
    void ClearScreen()
Purpose | Clear the console screen
Example of Usage |
    console.ClearScreen();

PrintBasedOnVal
Prototype |
    void PrintBasedOnVal( boolean );
Purpose | Prints [done] or [failed] based on provided boolean (true/false)
Example of Usage |
    console.PrintBasedOnVal( true );

MoveTo
Prototype |
    void MoveTo( x, y );
Purpose | Moves console cursor position to specified x, y location. If you want the same line, y == -1
Example of Usage |
    console.MoveTo( 100, 100 );

PrintSpecial
Prototype |
    void PrintSpecial( textColour, string );
Purpose | Prints a special tag in console similar to [done] and [failed], but with custom text and colour Available colours: 0 - Normal 1 - Blue 2 - Red 3 - Green 4 - Yellow 5 - Bright White
Example of Usage |
    console.PrintSpecial( 3, "Success" );

BeginShutDown
Prototype |
    void BeginShutdown();
Purpose | Start the UOX3 shutdown sequence
Example of Usage |
    console.BeginShutdown();

Reload
Prototype |
    void Reload( reloadType )
Purpose | Reloads server data from console. Available reload types: 0 Reload INI 1 Reload Accounts 2 Reload Regions 3 Reload Spawn Regions 4 Reload Spells 5 Reload Commands 6 Reload Definition Files 7 Reload JS 8 Reload HTML
Example of Usage |
    console.Reload( 4 ); //Reloads spells

©Copyright 2000-2001 WWW.UOX3.NET (Daniel Stratton/Matthew Randall)