Laine_prikol

RedBoardControl2

Apr 29th, 2016
483
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- REDBoardControl ver 1.2
  2. forms=require("forms")
  3. local term = require("term")
  4. local sides = require("sides")
  5. local computer = require("computer")
  6. local component = require("component")
  7. local rs = component.redstone
  8. rs.setOutput(sides.south, 0)
  9.  
  10. Form1=forms.addForm()
  11. Form1.border=2
  12. term.setCursor(2,2)
  13. -- Авторы и название программы
  14. Label1=Form1:addLabel(30,25,"Автор прогаммы: Laine_prikol Автор API: Zer0Galaxy")
  15. Label1=Form1:addLabel(2,1,"REDBOARD Control ver 1.2")
  16. -- Панель 1
  17. Label1=Form1:addLabel(2,2,"Управление передней стороной:")
  18. Btn1=Form1:addButton(2,3,"РЫЧАГ ВКЛ ",function() rs.setOutput(sides.south, 15) computer.beep(600,0.5)  end)
  19. Btn1.color=0xfffff                      
  20. Btn2=Form1:addButton(2,4,"РЫЧАГ ВЫКЛ",function() rs.setOutput(sides.south, 0) computer.beep(100,0.8) end)
  21. Btn2.color=0xff0000
  22. Btn3=Form1:addButton(2,5,"ЦИКЛ",function() while true do rs.setOutput(sides.south, 0) rs.setOutput(sides.south, 15) os.sleep(0.5) end   end)
  23. Btn3.color=0x505050
  24. -- Панель 2
  25. Label1=Form1:addLabel(2,6,"Управление левой стороной:")
  26. Btn4=Form1:addButton(2,7,"РЫЧАГ ВКЛ ",function() rs.setOutput(sides.west, 15) computer.beep(600,0.5)  end)
  27. Btn4.color=0xfffff
  28. Btn5=Form1:addButton(2,8,"РЫЧАГ ВЫКЛ",function() rs.setOutput(sides.west, 0) computer.beep(100,0.8) end)
  29. Btn5.color=0xff0000
  30. Btn6=Form1:addButton(2,9,"ЦИКЛ",function() while true do rs.setOutput(sides.west, 0) rs.setOutput(sides.west, 15) end os.sleep(0.5)  end)
  31. Btn6.color=0x505050
  32. -- Панель 3
  33. Label1=Form1:addLabel(2,10,"Управление тыльной стороной:")
  34. Btn7=Form1:addButton(2,11,"РЫЧАГ ВКЛ ",function() rs.setOutput(sides.north, 15) computer.beep(600,0.5)  end)
  35. Btn7.color=0xfffff
  36. Btn8=Form1:addButton(2,12,"РЫЧАГ ВЫКЛ",function() rs.setOutput(sides.north, 0) computer.beep(100,0.8) end)
  37. Btn8.color=0xff0000
  38. Btn9=Form1:addButton(2,13,"ЦИКЛ",function() while true do rs.setOutput(sides.north, 0) rs.setOutput(sides.north, 15) os.sleep(0.5) end   end)
  39. Btn9.color=0x505050
  40. -- Панель 4
  41. Label1=Form1:addLabel(40,2,"Управление правой стороной:")
  42. Btn10=Form1:addButton(40,3,"РЫЧАГ ВКЛ ",function() rs.setOutput(sides.east, 15) computer.beep(600,0.5)  end)
  43. Btn10.color=0xfffff
  44. Btn11=Form1:addButton(40,4,"РЫЧАГ ВЫКЛ",function() rs.setOutput(sides.east, 0) computer.beep(100,0.8) end)
  45. Btn11.color=0xff0000
  46. Btn12=Form1:addButton(40,5,"ЦИКЛ",function() while true do rs.setOutput(sides.east, 0) rs.setOutput(sides.east, 15) end os.sleep(0.5)  end)
  47. Btn12.color=0x505050
  48. -- Разное
  49. Label1=Form1:addLabel(40,9,"Разное:")
  50. Btn1=Form1:addButton(40,10,"СИГНАЛИЗАЦИЯ",function() while true do computer.beep(775,0.5) end os.sleep(0.5)  end)
  51. Btn1.color=0xfffff
  52. Btn1=Form1:addButton(40,11,"Выход",function() forms.stop() term.clear() end)
  53. Btn1.color=0x505050
  54. forms.run(Form1) -- Запуск
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×