added ping

This commit is contained in:
navid.sassan 2021-04-01 00:51:20 +02:00
parent 7d5eda49b8
commit 8d48cb8fbb
2 changed files with 6 additions and 0 deletions

4
client
View File

@ -52,6 +52,10 @@ while true do
end end
end end
end end
elseif type(data) == 'string' then
if data == 'ping' then
rednet.send(master, "Pong!")
end
end end
end end
end end

View File

@ -73,6 +73,8 @@ function control()
-- print(dump(input)) -- print(dump(input))
if input[1] == 'lookup' then if input[1] == 'lookup' then
print(rednet.lookup("rmm", input[2])) print(rednet.lookup("rmm", input[2]))
elseif input[1] == 'ping' then
rednet.send(tonumber(input[2]), 'ping')
elseif input[1] == 'eval' then elseif input[1] == 'eval' then
rednet.send(tonumber(input[2]), {"eval", input[3]}) rednet.send(tonumber(input[2]), {"eval", input[3]})
elseif input[1] == 'move' then elseif input[1] == 'move' then