Global

Name: alert
Type: function
Return type: void
Argument 1 type: string

// show a message box with OK button

alert("hello world");

Name: canHTML
Type: function
Return type: bool

// show a message box if HTML is enabled

if (canHTML())
    alert("cb0t is configured to receive HTML from chatrooms");

Name: clearInterval
Type: function
Return type: bool
Argument 1 type: int

// delete a reoccurring timer

clearInterval(timer_id);

Name: clearTimeout
Type: function
Return type: bool
Argument 1 type: int

// delete a timer

clearTimeout(timer_id);

Name: clientVersion
Type: function
Return type: string

// get the version of cb0t

var version = clientVersion();
alert("you are using " + version);

Name: confirm
Type: function
Return type: bool
Argument 1 type: string

// show a message box with OK and Cancel buttons

var result = confirm("click a button");

if (result == true)
    alert("you clicked OK");
else
    alert("you clicked cancel");

Name: getControlById
Type: function
Return type: ICustomUI
Argument 1 type: string

// get a UI control by it's id

var textbox = getControlById("my_textbox");
textbox.value = "hello world";

Name: include
Type: function
Return type: bool
Argument 1 type: string

// load additional source code into a script

var result = include("extra_code.js");

if (result == true)
    alert("it loaded successfully");

Name: openBrowser
Type: function
Return type: bool
Argument 1 type: string

// open the default web browser

var result = openBrowser("http://www.google.com/");

if (result == true)
    alert("it opened successfully");

Name: room
Type: function
Return type: Room
Argument 1 type: string

// find a Room object

var my_room = room("noobs");
alert("topic is " + my_room.topic);

Name: rooms
Type: function
Return type: void
Argument 1 type: function

// action all rooms currently open

rooms(function (roomobj)
{
    var name = roomobj.name;
    var topic = roomobj.topic;
    alert(name + "'s topic is " + topic);
});

Name: scriptName
Type: function
Return type: string

// get the name of the current script

var name = scriptName();
alert("this script is called " + name);

Name: scriptVersion
Type: function
Return type: string

// get the version of the script model

var version = scriptVersion();
alert("your client supports " + version + " and below");

Name: setInterval
Type: function
Return type: int
Argument 1 type: function
Argument 2 type: int

// create a reoccurring timer

var timer_id = setInterval(function ()
{
    alert("this message appears every 1 second");
}, 1000);

Name: setTimeout
Type: function
Return type: int
Argument 1 type: function
Argument 2 type: int

// create a timer

var timer_id = setTimeout(function ()
{
    alert("your timer has completed");
}, 1000);

Last edited Jun 2, 2014 at 6:48 PM by oobenoob, version 5