Sirshark10

Server

Mar 6th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local args = {...}
  2. local Channel = args[1]
  3. if peripheral.find("modem") then
  4.   modem = peripheral.find("modem")
  5.   if type(tonumber(Channel)) == "number" then
  6.     modem.open(tonumber(Channel))
  7.   else
  8.     return printError("Please Supply a Number (args[1])")
  9.   end
  10. else
  11.   return printError("Modem Required")
  12. end
  13.  
  14. local dir = args[2]
  15. if not fs.isDir(dir) then
  16.   term.clear()
  17.   term.setCursorPos(1,1)
  18.   print("Create Directory? Y/N")
  19.   if string.lower(read()) == "y" then
  20.     fs.makeDir(dir)
  21.   else
  22.     return printError("Please Supply a Valid Directory")
  23.   end
  24. end
  25.  
  26. local function readCon(file)
  27.   local file = fs.open(file,"r")
  28.   cont = file.readAll()
  29.   file.close()
  30.   return cont
  31. end
  32.  
  33. local function waitForMessage()
  34.   local evnt, side, chan, rChan, Data, dist = os.pullEvent("modem_message")
  35.   local M = textutils.unserialise(Data)
  36.   local Action = M.action
  37.   if Action == "PULL" then
  38.    
  39.   end
  40. end
Add Comment
Please, Sign In to add comment