Posted 09 November 2015 - 07:04 PM
None seemed to be interested, closed and servers offline, sorry D:
PM me if u realy need/want this, then i might put the servers online again, special for you ;)/>
Hi there! Because none seemed to be intrested in my webbrowser, i've made something new! =)
It's a bridge in cc, which allows anyone to create a tcpclient :)/>
Picture: (getting a mc server status)
Example of use: (getting a mc server status)
Source of the api (v1.0):
Feedback? :)/>
PM me if u realy need/want this, then i might put the servers online again, special for you ;)/>
It's a bridge in cc, which allows anyone to create a tcpclient :)/>
Picture: (getting a mc server status)
Spoiler
Example of use: (getting a mc server status)
Spoiler
os.loadAPI("RabbitTcp");
function toString(bytes)
result = "";
for i, obj in ipairs(bytes) do
if true then
result = result .. string.char(tonumber(obj));
end
end
return result;
end
client = RabbitTcp.RabbitTcp("server.hobbelcraft.nl", "25565");
client:send({ 31, 0, 47, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 });
client:send({ 1, 0 });
print(toString(client:read()))
client:close();
Source of the api (v1.0):
Spoiler
RabbitTcp = {};
RabbitTcp.__index = RabbitTcp;
setmetatable(RabbitTcp, {
__call = function (class, host, port)
local self = setmetatable({}, class);
self.id = http.get("http://direct.erwinolie.nl:8080/new/" .. host .. "/" .. port).readLine();
return self;
end,
})
function RabbitTcp:send(bytes)
http.get("http://direct.erwinolie.nl:8080/" .. self.id .. "/send/" .. table.concat(bytes, ","));
end
function RabbitTcp:close()
http.get("http://direct.erwinolie.nl:8080/" .. self.id .. "/close");
end
function RabbitTcp:read()
result = {};
data = http.get("http://direct.erwinolie.nl:8080/" .. self.id .. "/read");
while true do
line = data.readLine()
if (line == nil or line == "") then
break;
else
table.insert(result, line);
end
end
return result;
end
Feedback? :)/>
Edited on 05 December 2015 - 10:37 PM