This is my first time messing with sockets in Lua. No matter what I try I can't get it to connect. Is there something I did wrong or did not do?
--will store room sockets
Rsock = {}
--will store pm sockets
Psock = {}
--will sore the userlist
userlist = {}
--will store our banned people list
banlist = {}
--threads table only if needed
threads = {}
sock = require "socket";
http = require "socket.http";
local iterate = 0
function getAuth(user, password)
url = "http://old.yuribot.com/server?inp=get_auth@"
.. user .. "-" .. password
return http.request(url)
end
function getServer(group)
url = "http://old.yuribot.com/server?inp=group@".. group
return http.request(url)
end
function room_connect(room)
sock = sock.tcp();
host = getServer(room);
port = 443;
sock.connect(host, 443);
Rsock[room] = sock;
sock:send("bauth:" .. room .. ":567765443" .. ":introbot:9911324" .. "\x00");
end
room_connect("shirayuri");
--print(getAuth("introbot", "9911324"));
--print(Rsock['shirayuri'])
P.S.: the website is shirayuri.chatango.com