Advertisement
onix331

Stripmining V.2.6 For all CC-Versions Computer-side

Aug 2nd, 2014
1,138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.70 KB | None | 0 0
  1. --This code is developed by me (onix331) and is availiable under the GNU General Public License (Version 3)
  2. --For all CC-Versions COMPUTER-Side!
  3. --See http://opensource.org/licenses/GPL-3.0
  4. --Have fun
  5. rednet.open("right")
  6. ver = "2.6"--For updates
  7. status = "---"--Because i can
  8.  
  9. function clear()--To clear the screen and set the cursor to 1,1
  10.     term.clear()
  11.     term.setCursorPos(1,1)
  12. end
  13.  
  14. function receive()
  15.     senderId, length, protocol = rednet.receive()
  16.     storedlength = length
  17.     senderId, count, protocol = rednet.receive()
  18.     storedcount = count
  19.     senderId, direction, protocol = rednet.receive()
  20.     storeddirection = direction
  21.    
  22.     while true do
  23.         clear()
  24.         print("Length of the shaft(s): ", storedlength)
  25.         print("Count of the shaft(s): ", storedcount)
  26.         print("Direction of the shaft(s): ", storeddirection, "ight")
  27.         print("Length of the shaft left: ", length)
  28.         print("Shafts left: ", count)
  29.         print("Fuel: ", fuel)
  30.         print("Status: ", status)  
  31.         if status=="Done!" then
  32.             break
  33.         else
  34.             senderId, length, protocol = rednet.receive()
  35.             senderId, count, protocol = rednet.receive()
  36.             senderId, fuel, protocol = rednet.receive()
  37.             senderId, status, protocol = rednet.receive()
  38.         end
  39.     end
  40. end
  41.  
  42. function pair()
  43.     senderId, message, protocol = rednet.receive()
  44.     if message=="pair" then--To pair to the turtle
  45.         for i = 1, 10 do
  46.             rednet.send(senderId, "succesfull")
  47.             os.sleep(0.1)
  48.         end
  49.         print("Succesfull paired, continuing...")
  50.     end
  51.     clear()
  52.     receive()
  53. end
  54.  
  55.  
  56. clear()
  57. print ("Strip-mining-program by onix331")
  58. print ("Version ", ver)
  59. print ("Place of the modem can be modified in the program, right is recommended")
  60. print ("Trying to receive pair request")
  61.  
  62. pair()
  63.  
  64. print ("Done!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement