JaMaNi133

computercraft cnc thing v.1

Apr 11th, 2021 (edited)
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.58 KB | None | 0 0
  1. drive = peripheral.wrap("drive_0") -- if you play minecraft with create and computercraft mod and
  2. axePlus = "Left"                    --want know what this does pls contact me on discord (KIRITO__KAZUTO#4360)
  3. axeMinus = "Right"
  4. ySelect = "Bottom"
  5. tool = "top"
  6. speed = 1
  7. file = fs.open("drive/test1.mcc","r")
  8.  
  9.  
  10. if true == false then
  11.     println("ERROR : no data")
  12. else
  13.     step = 1
  14.     active = true
  15.     while active do
  16.         data = file.readLine()
  17.         if data == "end" then
  18.             active = false
  19.             print("done")
  20.         else
  21.             if(data == "+") then
  22.                 redstone.setOutput(axePlus,true)
  23.                 sleep(0.1)
  24.                 redstone.setOutput(axePlus,false)
  25.             end
  26.             if(data == "-") then
  27.                 redstone.setOutput(axeMinus,true)
  28.                 sleep(0.1)
  29.                 redstone.setOutput(axeMinus,false)
  30.             end
  31.             if(data == "y") then
  32.                 redstone.setOutput(ySelect,true)
  33.             end
  34.             if(data == "x") then
  35.                 redstone.setOutput(ySelect,false)
  36.             end
  37.             if(data == "toolPulse") then
  38.                 redstone.setOutput(tool,true)
  39.                 sleep(0.1)
  40.                 redstone.setOutput(tool,false)
  41.             end
  42.             if(data == "toolOn") then
  43.                 redstone.setOutput(tool,true)
  44.             end
  45.             if(data == "toolOff") then
  46.                 redstone.setOutput(tool,false)
  47.             end
  48.             step = step + 1
  49.             sleep(speed)
  50.         end
  51.     end
  52. end
  53. redstone.setOutput(ySelect,false)
Add Comment
Please, Sign In to add comment