t0x1c_adr1an

Basics.lua

Apr 20th, 2021 (edited)
769
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. --- CC
  2. local Monitor = peripheral.wrap('left')
  3. local modem = peripheral.wrap('right')
  4.  
  5. function clear_mon()
  6.     Monitor.clear()
  7.     Monitor.setCursorPos(1,1)
  8. end
  9.  
  10. function com()
  11.     modem.open(3)
  12.     local event, modemSide, senderChannel,
  13.         replyChannel, message, senderDistance = os.pullEvent("modem_message")
  14.     Monitor.write(message)
  15. end
  16.  
  17. function pick_up()
  18.     chest = peripheral.wrap('front')
  19.     for i in pairs(chest.list()) do
  20.         turtle.suck()
  21.     end
  22.     return True
  23. end
  24.  
  25. local this = 'jemoedervriend'
  26.  
  27. function drop()
  28.     for x=2,16 do
  29.         print(x)
  30.         turtle.select(x)
  31.         turtle.drop()
  32.     end
  33.     turtle.select(1)
  34.     if turtle.getItemDetail()['name'] == 'minecraft:coal' then
  35.         turtle.refuel()
  36.     end
  37. end
  38. -- Main loop
  39. while this ~= nil do
  40.     pick_up()
  41.     drop()
  42.     this = False
  43. end
Add Comment
Please, Sign In to add comment