Parg60

miningClient

Dec 17th, 2020 (edited)
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. term.setTextColor(colors.blue)
  2.  
  3. modem = peripheral.wrap("back")
  4. modem.open(5555)
  5. modem.transmit(5555, 5555, "start-mining")
  6.  
  7. function inform() --inform user
  8.      print("Enter values:")
  9.     os.sleep(0.4)
  10. end
  11.  
  12. function putValues() --get and set Values
  13.     for i = 1, 3, 1 do
  14.         while not accepted do
  15.             message = read()
  16.            
  17.             if tonumber(message) ~= nil then
  18.                 accepted = true
  19.                 modem.transmit(5555, 5555, message)
  20.             end
  21.         end
  22.         accepted = false
  23.     end  
  24. end
  25.  
  26. function receiveConfirm()
  27.     event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
  28.     print(message)
  29. end
  30.  
  31. -- Actual program
  32. inform()
  33. putValues()
  34. receiveConfirm()
  35.  
Add Comment
Please, Sign In to add comment