Advertisement
DabDaddy6223

quarryserver

Mar 10th, 2023 (edited)
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.83 KB | None | 0 0
  1. function main(...)
  2.     local modem = peripheral.find("modem", rednet.open)
  3.     local args = {...}
  4.  
  5.     print("Width: ")
  6.     local width = tonumber(read())
  7.     print("Height: ")
  8.     local height = tonumber(read())
  9.     print("Depth: ")
  10.     local depth = tonumber(read())
  11.  
  12.     local expectedTurtles
  13.     if #args > 0 then
  14.         expectedTurtles = tonumber(args[1])
  15.     end
  16.    
  17.     local turtleCount = 1
  18.     local turtles = {}
  19.  
  20.     while turtleCount <= expectedTurtles do
  21.         local id, message = rednet.receive("turtnettoserver")
  22.  
  23.         turtles[turtleCount] = id
  24.         turtleCount = turtleCount + 1
  25.     end
  26.  
  27.     print("Launch? (y/n)")
  28.     if read() == 'y' then
  29.         for i = 1, #turtles do
  30.             rednet.send(turtles[i], "4x" .. tostring(height) .. "x4", "turtnettoclient")
  31.         end
  32.     end
  33. end
  34.  
  35. main(...)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement