Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --mep périphériques
- modem = peripheral.wrap("top")
- ls_periph = modem.getNamesRemote()
- fps = 10 --("1, 2, 5, 10")
- --Ratio de conversion Gold / Draco
- --fin mep périphériques
- function dist_periph_list(ls)
- for i=1, #ls do
- _G["periph"..i] = peripheral.wrap(ls[i])
- end
- mon1 = periph1
- mon2 = periph2
- tile = periph3
- mon3 = periph4
- mon4 = periph5
- dsu1 = periph6
- dsu2 = periph7
- dsu3 = periph8
- end
- function mep_graphiques()
- mon1.clear()
- mon2.clear()
- mon3.clear()
- mon4.clear()
- end
- function create_button(xmin, xmax, ymin, ymax, bgcolor, text, tcolor, mon, output,fonction)
- temp = {}
- local aire = 0
- local xtemp, ytemp = xmin, ymin
- while aire < (((xmax-xmin)+1)*((ymax-ymin)+1)) do
- mon.setBackgroundColor(bgcolor)
- mon.setCursorPos(xtemp,ytemp)
- mon.write(" ")
- if xtemp == xmax then
- xtemp = xmin
- ytemp = ytemp + 1
- else
- xtemp = xtemp + 1
- end
- aire = aire + 1
- end
- mon.setTextColor(tcolor)
- mon.setCursorPos((xmin+xmax)/2 - (string.len(text)/2) + 1, (ymax+ymin)/2)
- mon.write(text)
- temp["xmin"] = xmin
- temp["xmax"] = xmax
- temp["ymin"] = ymin
- temp["ymax"] = ymax
- temp["bgcolor"] = bgcolor
- temp["text"] = text
- temp["tcolor"] = tcolor
- temp["side"] = side
- temp["output"] = output
- temp["fonction"] = fonction
- buttons[text] = temp
- end
- end
- create_button(4, 8, 3, 9, colors.green(), "Test", colors.red(), mon4)
- --while true do
- -- Global Commands
- dist_periph_list(ls_periph)
- os.sleep(1/fps)
- end
- -- periph1 monitor_10 en haut
- -- periph2 monitor_11 gauche
- -- periph3 tileinterface_1 ME Interface
- -- periph4 monitor_9 droite
- -- periph5 monitor_13 centre
- -- periph6 deep_storage_unit_2
- -- periph7 deep_storage_unit_1
- -- periph8 deep_storage_unit_0
- --
- --
- --
- --
- --
- --
- --
- --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement