这是我第一次在 Lua 中搞乱套接字。无论我尝试什么,我都无法连接。有什么我做错或没有做的吗?
--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'])
PS:网站是shirayuri.chatango.com