Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --LuaSocket IRC Bot by Expert700
- local socket = require("socket")
- __DEBUG = true
- local nick = "Au"
- local host = "na.irc.esper.net"
- local pass = "imnotabot"
- local chan = "#OTEGamers"
- local nametop = 2400
- local ver_maj = 0
- local ver_min = 1
- local ver_rev = 1
- local ver = ver_maj.."."..ver_min.."."..ver_rev
- local nametab = {"Edward_Elric", "Alphonse_Elric", "Albus_Dumbledore", "Harry_Potter", "Lelouch_Vi_Britannia", "Hatsune_Miku", "Spike_Spiegel", "Kamina", "Light_Yagami", "Kirito", "Asuna", "Eren_Yeager", "Tasumi", "Akame", "Mine", "Leone", "Sheele", "Inaho", "Slaine", "Asseylum",
- "Alucard", "Seras_Victoria", "Rin_Okumura", "Yukio_Okumura", "Monkey_D._Luffy", "Saber", "Lancer", "Archer", "Gilgamesh", "Caster", "Berserker", "Assassin", "Natsu_Dragneel", "Happy", "Lucy", "Gray", "Erza", "Wendy", "Gajeel", "Meliodas", "Naruto", "Sakura", "Sasuke", "Kakashi",
- "Kakashi", "Madara", "Obito", "Sage_of_Six_Paths", "Mustang", "Lt. Hawkeye", "Envy", "Greed", "Lust", "Wrath", "Pride", "Gluttony", "Celty", "Vash_the_Stampede", "Shiroe", "Naotsugu", "Akatsuki", "Nyanta", "Crusty", "Yuno_Gasai", "Akane_Tsunemori", "Shinya_Kogami", "Nobuchika_Ginoza",
- "Rintaro_Okabe", "Kurisu_Makise", "Suzaku_Kururugi", "Ryuk", "L", "C.C", "Yusuke_Urameshi", "Kazuma_Kuwabara", "Kurama", "Hiei", "Genkai", "Hakurei_Reimu", "Kirisame_Marisa", "Patchoulu_Knowledge", "Flandre_Scarlet", "Remilia_Scarlet", "Birdy_Cephon", "Tsutomu_Senkawa", "Soul", "Death_the_Kid",
- "Rikka_Takanashi", "Gundam"}
- function sleep(n)
- os.execute("timeout " .. tonumber(n))
- end
- local client = assert(socket.connect("na.irc.esper.net", 6667))
- client:settimeout(1)
- client:send(string.format("PASS %s\r\n", pass))
- client:send(string.format("NICK %s\r\n", nick))
- client:send(string.format("USER %s 0 * :%s [OpenComputers]\r\n", nick:lower(), nick))
- function changename()
- local newname = nametab[math.random(#nametab)]
- client:send(string.format("NICK %s\r\n", newname))
- end
- local okrep = 0
- repeat
- print(okrep)
- local line, ok = client:receive()
- if ok then okrep = okrep + 1 end
- if not ok and line then
- print(line)
- if line:find("PING") then
- print("Received PING")
- local pongnum = line:sub(6)
- resp = "PONG "..pongnum
- print(resp)
- client:send(resp)
- end
- end
- if okrep == 20 then
- client:send(string.format("JOIN %s\r\n", chan))
- end
- until okrep == 30
- print("Waiting to join")
- sleep(10)
- print("Attempting to join")
- client:send(string.format("JOIN %s\r\n", chan))
- sleep(2)
- client:send("PRIVMSG expert700 :Exbot ["..ver.."] is online\r\n")
- local namerep = 5000
- while true do
- namerep = namerep + 1
- local line, ok = client:receive()
- if not ok and line then
- print(line)
- if line:find("PING") then
- print("Received PING")
- local pongnum = line:sub(6)
- resp = "PONG "..pongnum
- print(resp)
- client:send(resp)
- end
- if line:find("␁") then
- print("CTCP")
- elseif line:find("!newname") then
- changename()
- elseif line:find("!setint") then
- local valmsg = nil
- for half in string.gmatch(line, '([^:]+)') do
- if half:find("!setint") then
- valmsg = half
- end
- end
- for v in string.gmatch(valmsg, "%S+") do
- if not v:find("!setint") then
- nametop = tonumber(v)
- end
- end
- end
- end
- if namerep >= nametop then
- sleep(0.25)
- namerep = 0
- changename()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement