Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. if
  2. peripheral.getType("right") == "modem" then
  3. rednet.open("right")
  4. elseif
  5. peripheral.getType("left") == "modem" then
  6. rednet.open("left")
  7. elseif
  8. peripheral.getType("top") == "modem" then
  9. rednet.open("top")
  10. elseif
  11. peripheral.getType("bottom") == "modem" then
  12. rednet.open("bottom")
  13. elseif
  14. peripheral.getType("back") == "modem" then
  15. rednet.open("back")
  16. elseif
  17. peripheral.getType("front") == "modem" then
  18. rednet.open("front")
  19. end
  20. term.clear()
  21. term.setTextColor(colors.lime)
  22. term.setCursorPos(24,4)
  23. print("HE ?")
  24. term.setTextColor(colors.blue)
  25. term.setCursorPos(20,8)
  26. while true do
  27. local words = {}
  28.  
  29. input = read()
  30. for word in input:gmatch('[^%- ]+') do
  31. table.insert(words, word)
  32. inp1 = words[1]
  33. inp2 = tonumber(words[2])
  34. end
  35.  
  36. if inp1==("topla") or inp1==("yerlestir") or inp1==("reset") then
  37. rednet.send(tonumber(40),inp1)
  38. rednet.send(tonumber(41),inp1)
  39. else
  40. if type(inp2) == "nil" then
  41. print("Sayi gir ulan")
  42. else
  43. if inp1 == "kaz" then
  44. i = 0
  45. repeat
  46. rednet.send(tonumber(40),"kaz")
  47. rednet.send(tonumber(41),"kaz")
  48. i = i + 1
  49. sleep(15)
  50. until i == inp2
  51.  
  52. elseif inp1==("ileri") or inp1==("geri") or inp1==("sag") or inp1==("sol") or inp1==("yukari") or inp1==("asagi") then
  53. rednet.send(tonumber(40),input)
  54. rednet.send(tonumber(41),input)
  55.  
  56. else
  57. print("Yanlis komut hocam")
  58. end
  59. end
  60. end
  61. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement