Advertisement
NekoTiki

dm (Set Radius - With Detect)

Nov 8th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. local detect = peripheral.getNames()
  2. local radius
  3. local dm
  4.  
  5. function dmFn()
  6. term.clear()
  7. term.setCursorPos(1,2)
  8. term.setTextColor(colors.yellow)
  9. write("Radius voulu pour le Digital Miner")
  10.  
  11. term.setTextColor(colors.red)
  12. print(" (Entre 1 et 64)")
  13.  
  14. term.setTextColor(colors.white)
  15. write(">> ")
  16.  
  17. term.setTextColor(colors.blue)
  18. radius = read()
  19.  
  20. radius = tonumber(radius)
  21. if radius then
  22. dm.radius(radius)
  23. else
  24. term.setTextColor(colors.red)
  25. print("La saisie n'est pas un nombre")
  26. dmFn()
  27. end
  28. -- Function End
  29. end
  30.  
  31. for i=1 , #detect do
  32. if peripheral.getType(detect[i]) == "Digital Miner" then
  33. dm = peripheral.wrap(detect[i])
  34. dmFn()
  35. else
  36. term.setTextColor(colors.red)
  37. print("Pas de Digital miner Detecter")
  38. end
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement