Skip to content

Instantly share code, notes, and snippets.

View andsve's full-sized avatar
🍎
Coding

Sven Andersson andsve

🍎
Coding
View GitHub Profile
local socket = require("socket")
function create_bot(nick, channels)
local bot = {nick = nick, -- nickname of bot
firstresponse = false, -- got any data?
connection_ok = false,
channels = channels
}
function bot:connect(serv, port)
local socket = require("socket")
function create_bot(nick, channels)
local bot = {nick = nick, -- nickname of bot
firstresponse = false, -- got any data?
connection_ok = false,
channels = channels
}
function bot:connect(serv, port)
local socket = require("socket")
function create_bot(nick, channels)
local bot = {nick = nick, -- nickname of bot
firstresponse = false, -- got any data?
connection_ok = false,
channels = channels
}
function bot:connect(serv, port)
module("modules/testmod/testmod")
function parse_message(bot, msg)
local i,j,s,c = string.find(msg, ":(.-)!.- PRIVMSG (.-) :poopshoot")
if not (i == nil) then
bot:say(c, "Hey, " .. tostring(s) .. ", watch your language!!")
end
end
module("modules/define/define")
function parse_message(bot, msg)
local i,j,sender,chan,q = string.find(msg, ":(.-)!.- PRIVMSG (.-) :" .. tostring(bot.config.triggerprefix) .. "define (.+)")
if not (i == nil) then
if not (string.sub(chan, 1, 1) == "#") then
chan = sender
end
module("modules/title/title")
function parse_message(bot, msg)
local i,j,chan,s = string.find(msg, ":.-!.- PRIVMSG (.-) :(.+)")
if not (i == nil) then
function get_title(url, block_hosts, loop_control)
if (loop_control <= 0) then
return nil
module("modules/tr/tr")
function parse_message(bot, msg)
local i,j,sender,chan,q = string.find(msg, ":(.-)!.- PRIVMSG (.-) :" .. tostring(bot.config.triggerprefix) .. "tr(.*)")
if not (i == nil) then
if not (string.sub(chan, 1, 1) == "#") then
chan = sender
end
Afrikaans -> af
Albanian -> sq
Arabic -> ar
Armenian -> hy
Azerbaijani -> az
Basque -> eu
Belarusian -> be
Bulgarian -> bg
Catalan -> ca
Chinese (Simplified) -> zh-CN
module("modules/wp/wp")
function parse_message(bot, msg)
local i,j,sender,chan,q = string.find(msg, ":(.-)!.- PRIVMSG (.-) :" .. bot.config.triggerprefix .. "wp (.+)")
if not (i == nil) then
if not (string.sub(chan, 1, 1) == "#") then
chan = sender
end
module("modules/xb/xb")
function parse_message(bot, msg)
local i,j,chan,n = string.find(msg, ":.-!.- PRIVMSG (.-) ::xb (.+)")
if not (i == nil) then
local http = require("socket.http")
local b, c, h = http.request("http://profile.mygamercard.net/" .. tostring(n))
if not (b == nil) then