xbot/mods/lua
Aaron Blakely 71090d244b added command line arguments 2024-03-08 04:14:06 -06:00
..
Makefile more work on lua module 2024-02-27 01:16:58 -06:00
README.md update lua mod readme 2024-03-02 02:30:15 -06:00
events.c lua module working on windows 2024-02-29 20:49:33 -06:00
handlers.c lua module now loading/unloading scripts 2024-02-27 02:37:29 -06:00
init.lua test 2024-02-29 04:54:18 -06:00
lua.c added command line arguments 2024-03-08 04:14:06 -06:00
lua.h more work on lua module 2024-03-02 02:11:50 -06:00
make.bat more work on lua module 2024-03-02 02:11:50 -06:00
scripts.tmp db.c working on windows 2024-03-06 03:45:01 -06:00
wrappers.c more work on lua module 2024-03-02 02:11:50 -06:00

README.md

API

Events

Event Types

  • PRIVMSG_SELF - user, host, message
  • PRIVMSG_CHAN - user, host, channel, message
  • JOIN - user, host, channel
  • JOIN_MYSELF - channel
  • PART - user, host, channel, reason
  • PART_MYSELF - channel, reason
  • QUIT - user, host, reason
  • NICK - user, host, newnick
  • NICK_MYSELF - newnick
  • NICK_INUSE - newnick
  • CTCP - user, host, to, message
  • IRC_CONNECTED
  • TICK

add_handler(event, handler)

Adds a handler for an event.

Example:

function msg(user, host, channel, message)
    print(user .. " said: " .. message)
end

add_handler(PRIVMSG_CHAN, msg)

del_handler(event, handler)

Removes a handler for an event.

Example:

del_handler(PRIVMSG_CHAN, msg)

IRC Commands

raw(message)

Sends a raw message to the server.

privmsg(to, message)

Sends a message to a channel or user.

notice(to, message)

Sends a notice to a channel or user.

join(channel)

Joins a channel.

part(channel, reason)

Leaves a channel.

kick(channel, user, reason)

Kicks a user from a channel. Reason is optional.

mode(channel, mode, target)

Sets a mode on a channel.

ctcp(to, message)

Sends a CTCP message to a channel or user.