SHARE
TWEET

qclient.lua

a guest Dec 6th, 2019 100 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local Qt = {}
  2. --arednet.close("right")
  3. rednet.open("left")
  4.  
  5. local id = rednet.receive()
  6. --print("Alright")
  7. rednet.send(id, "verify")
  8. local id, message = rednet.receive()
  9. if message == "accepted" then
  10.     if fs.exists("QData/Settings") then
  11.         f = fs.open("QData/Settings", "r")
  12.         Qi = textutils.unserialise(f.readAll())
  13.         f.close()
  14.         f = fs.open("QData/Settings", "w")
  15.         --table.insert(Qi, {[id] = id)
  16.         Qi[id] = id
  17.         f.write(textutils.serialize(Qi))
  18.         f.close()
  19.         else
  20.         f = fs.open("QData/Settings", "w")
  21.         f.write(textutils.serialize({[id] = id}))
  22.         f.close()
  23.     end
  24. end
  25. while true do
  26.     local input = read()
  27.     if input == "start" then
  28.         rednet.send(id, "rtrue")
  29.     elseif input == "stop" then
  30.         rednet.send(id, "rfalse")
  31.     elseif input == "exit" then
  32.         rednet.close("right")
  33.         term.clear()
  34.         term.setCursorPos(1,1)
  35.         break
  36.     end
  37. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top