Scripting support for HeXHub.

Index

About

HexScript is a plugin for HeXHub 5.04 or newer. When a new HeXHub features are added to the plugin older versions of HeXHub will not be supported anymore. HexScript will never have support for the firewall or the web server part of HeXHub. HexScript is intended for hubowners with lua scripting skills, to allow them to extend the apearence of their hub and to add small features and validation. Scripts cannot send $ConnectToMe and $RevConnectToMe protocol messages to clients. HexScript was in no way intended to be used for writing full hub systems or robots. HexScript does only interface HeXHub and lua, and in some cases converts data and parameters so they become lua friendly. In other words HexScript tries only to wrap HeXHub API for use in lua scripts. Besides that HexScript does also include a async scheduler that allows for inter script communications, execute and more. HexScript does also include a embedded HeXHub gui for configuration and script control.

If you are a Lua scripter you might want to check out the Hex Script API reference index

Hex Script Changelog

2008-08-22 Hex Script 1.2.0.2-unstable 2008-08-16 Hex Script 1.2.0.1-unstable 2008-08-31 Hex Script 1.2.0.0-unstable 2008-08-19 Hex Script 1.1.0.2-unstable 2008-08-18 Hex Script 1.1.0.1-unstable the following changes apply only to the plugin if its running on Windows XP or newer *** 2008-06-03 Hex Script 1.0.1.0-unstable 2008-05-25 Hex Script 1.0.0.4-unstable 2008-05-20 Hex Script 1.0.0.3-unstable 2008-05-19 Hex Script 1.0.0.2 Public Beta 3 2008-05-18 Hex Script 1.0.0.1 Private Beta 2

Supported HeXHub callbacks/events

HexHub callback/event
Implemented in HexScript
Description
InitPlugin
Yes
First function that is called when a plugin is loaded by HeXHub. This is emulated for scripts with OnLoad()
UnloadPlugin
Yes
Function called just before a plugin is being unloaded by HeXHub. This is emulated for scripts with OnUnload()
SaveSettings
Yes: OnSaveSettings()
Called by HeXHub when its about to exit or when the save settings trigger or gui button has been invoked.
GetConfig
Yes
HexScript displays a message box redirecting the user if the config button in the HeXHub plugins page is being clicked.
SetWelcomeText
Yes, used by HexScript, but WILL NOT be supported for scripts
Allows HexScript to append its name and version to HeXHubs welcome message.
onDataFromUser
No
Not planned
onUnknownData
No
Not planned
onCommand
Yes: OnCommand()
HeXHub calls this function when it receives a valid protocol message
onUnknownCommand
Yes: OnUnknownCommand()
HeXHub calls this function when it receives a protocol message it does not understand
onChatMessage
Yes: OnChatMessage()
HeXHub calls this function when a private or mainchat message is being sent.
onPublicMessage
Yes: OnPublicMessage()
HeXHub calls this function when a public message is broadcasted
onNickChange
Yes: OnNickChange()
HeXHub calls this when a client changes nickname
onError
Yes: OnClientConnected(), OnClientDisconnected()
HeXHub calls this function when a client has connected or disconnected.
onUserIdle
No
Not planned
BannedUserJoins0
Yes: BannedUserJoins0()
HeXHub calls this function when a _ban0_ user tries to join the hub
BannedUserJoins1
Yes: BannedUserJoins1()
HeXHub calls this function when a _ban1_ user tries to join the hub
BannedUserJoins2
Yes: BannedUserJoins2()
HeXHub calls this function when a _ban2_ user tries to join the hub
onNicklistChange
Yes: OnUserJoined(), OnUserParts()
HeXHub calls this function when a user is added or removed from the nicklist
GetAboutText
Yes: Hex.SetAboutString()
HeXHub calls this function when it displays the !about trigger to a user. HeXScript adds it's own about info and allows scripts to do the same
onBadSettings
No
Not planned
UserSearch
No
Not planned
GetConfigurationStringsTable
No
Not planned
onHTTPRequest
No
HexScript will not support the web-part
onHTTPerror
No
HexScript will not support the web-part
HTTPFormatPage
No
HexScript will not support the web-part
HTTPEnumData
No
HexScript will not support the web-part
FirewallIOCTL
No
HexScript will not support the firewall-part

Supported HeXHub functions

HeXHub function
Implemented in HexScript
Description
GetFunction
Yes
Used by HexScript to lookup other HeXHub functions
GetVersion
Yes: Hex._GetVersion
Returns HeXHubs version
SendTo
Yes: User class
Sends data to the client
SendToAll
Yes: Hex.Broadcast()
Sends data to all clients
SendNotificationMessage
Yes: Hex.OpchatMessage()
Post a message to opchat
NickFromId
Yes: User class
Gets the client nick
ClientnickFromId
Yes: User class
Gets the client nick
IdFromNick
Yes: Hex.GetUserId()
Resolves a nickname to a identifier that can be used with the User class
GetInfo
Yes: User class
Gets the clients myinfo
GetFullInfo
Yes: User class
Gets the clients myinfo
SetInfo
Yes: User class
Sets the clients myinfo
GetDescription
Yes: User class
Gets the clients description
SetDescription
Yes: User class
Sets the clients description
GetTag
Yes: User class
Gets the clients tag
SetTag
Yes: User class
Sets the clients tag
GetConnection
Yes: User class
Gets the clients connection string
SetConnection
Yes: User class
Sets the clients connection string
GetMail
Yes: User class
Gets the clients email address
SetMail
Yes: User class
Sets the clients email address
GetShareString
Yes: User class
Gets the share size of a client
SetShareString
Yes: User class
Sets the share size of a client
GetIP
Yes: User class
Gers the clients IP
GetIPString
Yes: User class
Gets the clients IP in dotted notation
GetISPName
Yes: User class
Gets the clients ISP name
GetOpStatus
Yes: User class
Gets the operator status for a client
SetOpStatus
Yes: User class
Sets the operator status for a client
GetLanguage
Yes: User class
Gets the hub langauge of the client
SetLanguage
Yes: User class
Sets the hub language of the client
GetMode
Yes: User class
Gets the users mode string
SetMode
Yes: User class
Sets the users mode string
ModeTransform
No
Not planned
GetUserCount
Yes: Hex.UserCount()
Gets the number of connected users
GetUserIds
Yes: User class
Used for iterating
GetMastersCount
Yes: User class
Used for iterating
GetMasterIds
Yes: User class
Used for iterating
GetIpCacheInfo
No
Not planned
SetIpCacheInfo
No
Not planned
GetAccessLevel
Yes: User class
Gets the clients access level
SetAccessLevel
Yes: User class
Sets the clients access level
GetRights
Yes: Rights class
Gets the clients rights
SetRights
Yes: Rights class
Sets the clients rights
GetProfileId
Yes: User class
Gets the clients profile identifier
GetAccountId
Yes: User class
Gets the accound identifier
CreateAccount
No
Not planned
DeleteAccount
No
Not planned
MoveAccount
No
Not planned
SetProfile
No
Not planned
GetProfile
Yes: Profile class
Used for iteration
GetNextProfile
Yes: Profile class
Used for iteration
SetAccount
No
Not planned
GetAccount
No
Not planned
GetNextAccount
No
Not planned
AllocUserData
No
Not planned
FreeUserData
No
Not planned
GetUserData
No
Not planned
SetUserData
No
Not planned
RegisterCommand
Yes: Trigger class
Allows a script to register a trigger and get notification when a client invoked it
UnregisterCommand
Yes: Trigger class
Automatic on garbage collect
RegisterHelpString
Yes: HelpString class
Allows a script to register a string that will be inserted in the !help trigger
UnregisterHelpString
Yes: HelpString class
Automatic on garbage collect
RegisterUserCommand
Yes: UserCommand and UserCommandEx classes
Allows a script to register a $UserCommand string that will be sent to clients during login
UnregisterUserCommand
Yes: UserCommand and UserCommandEx classes
Automatic on garbage collect
RegisterChatFilter
No
Not planned
UnregisterChatFilter
No
Not planned
RegisterBot
Yes: Bot class
Allows a script to register a bot
UnregisterBot
Yes: Bot class
Automatic on garbage collect
CallHubCommand
No
Not planned
ProcessUserTraffic
No
Not planned
DisableOutputToUser
No
Not planned
AcceptUser
No
Not planned
DisconnectUser
Yes: User class
Disconnects a client from the hub
GetTopic
Yes: Hex.GetTopic()
Gets the topic
SetTopic
Yes: Hex.SetTopic()
Sets the topic
GetMOTD
Yes: Hex.GetMOTD()
Gets the message of the day
SetMOTD
Yes: Hex.SetMOTD()
Sets the message of the day
GetHubUptime
Yes: Hex.Uptime()
HeXHub uptime
RegisterBotEx
No
HexScript uses RegisterBot instead
SetBan
Yes: User class
Used to ban a user connected to the hub
FirewallGetVersion
No
HexScript will not support the firewall-part
FirewallGetAboutString
No HexScript will not support the firewall-part
FirewallEnable
No HexScript will not support the firewall-part
FirewallDisable
No HexScript will not support the firewall-part
FirewallBanRange
No HexScript will not support the firewall-part
FirewallUnbanRange
No HexScript will not support the firewall-part
FirewallLookupRange
No HexScript will not support the firewall-part
FirewallGetSettings
No HexScript will not support the firewall-part
FirewallChangeSettings
No HexScript will not support the firewall-part
FirewallRegisterHubPort
No HexScript will not support the firewall-part
FirewallUnregisterHubPort
No HexScript will not support the firewall-part
FirewallGetStats
No HexScript will not support the firewall-part
FirewallGetPortStats
No HexScript will not support the firewall-part
DDoSFilterIP
No HexScript will not support the firewall-part
DDoSDeleteFilter
No HexScript will not support the firewall-part
DDoSCountFilteredIPs
No HexScript will not support the firewall-part
DDoSGetFilter
No HexScript will not support the firewall-part
HTTPSendTo
No
HexScript will not support the web-part
HTTPSendHeaders
No
HexScript will not support the web-part
HTTPRedirect
No
HexScript will not support the web-part
GetHubWindow
Yes
HexScript uses this function for it's embedded HeXHub gui
RegisterPluginWindow
Yes
HexScript uses this function for it's embedded HeXHub gui
UnregisterPluginWindow
Yes
HexScript uses this function for it's embedded HeXHub gui
GetHubInfo
Yes: Hex.GetHubInfo()
Gets lots of hub details
SetHubInfo
Yes: Hex.SetHubInfo()
Sets lots of hub details

Hex Script API reference index

Hex Script supported lua extensions and how to

Lua extensions in form of lua scripts and loadable dll's can be placed in the \HeXHub\Plugins\Scripts\LuaExtensions directory.

Hex Script includes the following lua extensions:
LuaSql with the sqlite3 driver and can be used by requiring the namespace luasql.sqlite3. LuaSocket can be used in the same fashion as a LuaSql by requiring the namespaces socket.core, mime.core, socket.http, socket.ftp, ect.

Acknowledgements

Hex Script Copyright (C) 2008-2009 Morten Larsen
Hex Script includes Lua Copyright (C) 1994-2008 Lua.org, PUC-Rio.
Hex Script includes LuaSocket Copyright © 2004-2007 Diego Nehab. All rights reserved.
Hex Script includes LuaSql Copyright © 2003-2007 The Kepler Project.
Hex Script includes sqlite3 wich is in the public domain.

Generated on Sat Aug 22 21:09:31 2009 for Hex Script by  doxygen 1.5.8