Last updated: 2017.03.29

Table of contents

  1. Events
  2. Global methods
  3. Global objects
  4. Parameter objects
  5. SQLite Database
  6. SQLite Table


When script loads
When script unloads
Called every ~ second.
onChatArrival(user=object, text=string)
When chat arrives from a user (return true to block sending)
onTextCommand(user=object, cmd=string, text=string)
On text command, all default with ! symbol. !help etc return true to block processing.
onDataArrival(user=object, cmd=string, text=string)
On protocol command/data, return true to ignore/do not process.
When user is validated/connect to hub
When a validated user disconnects from hub.
When a user calls help command.
When a user calls about command. Resulting string should be no more than 100 characters long.
Called when public protocol messages are sent (this does not cover masked messages).

Global methods

Print out to console/and or logfile
Create or open sqlite database
createTask('lua code')
Create an asyncronous task.
Encode string with escape characters $ and |
Decode string to use characters $ and |
Convert string ip address to host address representation.
Convert string ip address to net address representation.
Convert net address to string ip address.
Convert host address to string ip address.
Convert host address to 2-digit country code.

Global Objects

### (methods)

Get the process ID of the hub.
Create an empty permissions object for use with masks.
Create an empty supports object for use with masks.
Send data to all users (can be data, no pipe needed)
.sendToAll(nick=string, text=string)
Send chat to all users from nick
.mSendToAll(pmask,smask=uint64, text=string)
Same as sendToAll but with permission and support mask.
.mSendToAll(pmask,smask=uint64, nick=string, text=string)
Same as sendToAll but with permission and support mask
Send pm to all users (default bot name is used as sender)
.sendPMToAll(nick=string, text=string)
Send pm to all users from nick
.mSendPMToAll(pmask,smask=uint64, text=string)
Same as sendPMToAll but with permission mask
.mSendPMToAll(pmask,smask=uint64, nick=string, text=string)
Same as above but with specified nick
.mSendPMToAll(pmask,smask=uint64, nick1,nick2=string, text=string)
Same as above but with from and display nick.
.mSendPMToAll(pmask,smask=uint64, nick1,nick2=string, text=string, ignoreUser=user)
Same as above but ignore user that is passed.
.sendToUser(user=object, text=string)
Send data to specified user
.sendToUser(user=object, nick=string, text=string)
Send chat to user from nick
Drop user from hub (close connection)
Get a user object from nick, nil if not found
.banIP(ip=uint32, secs=uint32, op=string, reason=string)
Ban an ip (big endian uint32, e.g. 3232235877)
.banIP(ip=string, secs=uint32, op=string, reason=string)
Ban an ip by its corresponding string (e.g.
.addBot(nick=string, description=string, email=string)
Add a bot to the list.
Remove a bot from the list.

### (properties)
Uptime in seconds
Current user count
User peak count
Hub name.
Hub topic.
Hub default bot name.

Parameter Objects

### (methods)
Get permission object
Get supports object

### (properties)
User validated nick
Integer based ipv4
String value of ipv4
User description string
User connection string
User flag byte/char
User email string
User share size in bytes
Validated, true or false
Client string e.g. StrgDC++ V1...
Client mode A, P or S
Client slot count
Get profile level number 0 guest, 1..x
Get date/time of login (in seconds).

### (properties)
return the mask of this permissions object.
can reload lua scripts
can force settings/accounts save
can reload hub config files (including accounts etc)
can manage hub settings !set ....
this user is classified as an operator
requires password to join
can use commands......
has an operator key
can drop other users with !drop command
can kick users !kick ...
can redirect users !redirect ...
can ban users
can unban users
can be set invisible
visible to operators (even if invisible)
is hidden by default ?
can update own password
can update own password
can speak in main chat
can see main chat
can send private messages
can register users and delete own regs
can delete any accounts that have lower level
not checked for spamming main chat
can change hub name
can change hub topic
can change hub description
can change hub motd
can change bot security nick, desc etc
access to whois and seen commands
can view/use opchat (if any)
can set modes (using mode scripts)
can view full tags
can change nickname
can rename other users (lower or equal profile)
can view users ips
can view users ips
share requirements
hub security config

### (properties)
get the mask of this supports object.

SQLite Database

### (methods)
Return true or false if table exists.
.execSQL('sql code')
Execute a statement without result.
.openSQL('sql code')
Execute a statement and return an [SQL table object].

SQLite Table

### (methods)
Return all columns as variables.
Move to first row.
Move to next row.
Move to last row.
Get column value as integer.
Get column value as string.
Get column value as floating point.

### (properties)
True if there are no more rows available to method Next().
Total rows available.
Total columns available.


There are no comments for this page, you can write one here.