Advertisement
appollon41

Spawners Manager

Mar 17th, 2019
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. --mep périphériques
  2. modem = peripheral.wrap("top")
  3. ls_periph = modem.getNamesRemote()
  4.  
  5. fps = 10 --("1, 2, 5, 10")
  6.  
  7. --Ratio de conversion Gold / Draco
  8.  
  9. --fin mep périphériques
  10.  
  11. function dist_periph_list(ls)
  12. for i=1, #ls do
  13. _G["periph"..i] = peripheral.wrap(ls[i])
  14. end
  15. mon1 = periph1
  16. mon2 = periph2
  17. tile = periph3
  18. mon3 = periph4
  19. mon4 = periph5
  20. dsu1 = periph6
  21. dsu2 = periph7
  22. dsu3 = periph8
  23. end
  24.  
  25. function mep_graphiques()
  26. mon1.clear()
  27. mon2.clear()
  28. mon3.clear()
  29. mon4.clear()
  30.  
  31.  
  32. end
  33.  
  34. function create_button(xmin, xmax, ymin, ymax, bgcolor, text, tcolor, mon, output,fonction)
  35. temp = {}
  36.  
  37. local aire = 0
  38. local xtemp, ytemp = xmin, ymin
  39.  
  40. while aire < (((xmax-xmin)+1)*((ymax-ymin)+1)) do
  41. mon.setBackgroundColor(bgcolor)
  42. mon.setCursorPos(xtemp,ytemp)
  43. mon.write(" ")
  44. if xtemp == xmax then
  45. xtemp = xmin
  46. ytemp = ytemp + 1
  47. else
  48. xtemp = xtemp + 1
  49. end
  50. aire = aire + 1
  51. end
  52.  
  53. mon.setTextColor(tcolor)
  54. mon.setCursorPos((xmin+xmax)/2 - (string.len(text)/2) + 1, (ymax+ymin)/2)
  55. mon.write(text)
  56. temp["xmin"] = xmin
  57. temp["xmax"] = xmax
  58. temp["ymin"] = ymin
  59. temp["ymax"] = ymax
  60. temp["bgcolor"] = bgcolor
  61. temp["text"] = text
  62. temp["tcolor"] = tcolor
  63. temp["side"] = side
  64. temp["output"] = output
  65. temp["fonction"] = fonction
  66.  
  67. buttons[text] = temp
  68. end
  69. end
  70.  
  71. create_button(4, 8, 3, 9, colors.green(), "Test", colors.red(), mon4)
  72. --while true do
  73.  
  74. -- Global Commands
  75.  
  76. dist_periph_list(ls_periph)
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85. os.sleep(1/fps)
  86. end
  87. -- periph1 monitor_10 en haut
  88. -- periph2 monitor_11 gauche
  89. -- periph3 tileinterface_1 ME Interface
  90. -- periph4 monitor_9 droite
  91. -- periph5 monitor_13 centre
  92. -- periph6 deep_storage_unit_2
  93. -- periph7 deep_storage_unit_1
  94. -- periph8 deep_storage_unit_0
  95. --
  96. --
  97. --
  98. --
  99. --
  100. --
  101. --
  102. --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement