Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --VARIABLES
- local event = require("event")
- local net = require("internet")
- local term = require("term")
- local os = require("os")
- local running = true
- local con = net.open("192.168.1.100", 6667)
- --FUNCTIONS
- function sendString(s)
- con:write(s)
- print('Sending ' .. string.sub(s,1,s:len()-1) .. ' to server...')
- con:flush()
- end
- function reciveString()
- local s = con:read()
- print('Recived ' .. s .. ' from server...')
- con:flush()
- end
- --MAIN
- if con then
- print('Connected to the server!')
- end
- while running do
- local s = term.read()
- sendString(s)
- reciveString()
- os.sleep(0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement