Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local computer = require("computer")
- local component = require("component")
- local term = require("term")
- local math = require("math")
- local event = require("event")
- string = require("string")
- unicode = require("unicode")
- local colors = require("colors")
- local sides = require("sides")
- --Récupération des écrans
- local screen1 = component.get("60a8","screen")
- local screen2 = component.get("08d2","screen")
- local screen3 = component.get("3686","screen")
- --récupérations des GPU et résolution
- local gpu1 = component.get("20a8","gpu")
- local gpu2 = component.get("0ede","gpu")
- local gpu3 = component.get("8132","gpu")
- local pgpu1 = component.proxy(gpu1)
- local pgpu2 = component.proxy(gpu2)
- local pgpu3 = component.proxy(gpu3)
- pgpus={}
- pgpus[1] = component.proxy(gpu1)
- pgpus[2] = component.proxy(gpu2)
- pgpus[3] = component.proxy(gpu3)
- pgpus[3].bind(screen3)
- pgpus[3].setResolution(45,25)
- pgpus[3].set(1,1,"Ecran 3 prêt!")
- pgpus[2].bind(screen2)
- pgpus[2].setResolution(45,25)
- pgpus[2].set(1,1,"Ecran 2 prêt!")
- pgpus[1].bind(screen1)
- pgpus[1].setResolution(63,35)
- pgpus[1].set(1,1,"Ecran 1 prêt!")
- --Récupération de la redstone
- local grs1 = component.get("16a3","redstone")
- local grs2 = component.get("201f","redstone")
- local grs3 = component.get("3188","redstone")
- local grs4 = component.get("b0b8","redstone")
- local rs1 = component.proxy(grs1)
- local rs2 = component.proxy(grs2)
- local rs3 = component.proxy(grs3)
- local rs4 = component.proxy(grs4)
- local commande = sides.top
- local r_color = {colors.white,colors.orange,colors.magenta,colors.lightblue,colors.yellow,colors.lime,colors.pink,colors.gray}
- --Récupération des tanks
- local gtank1 = component.get("6c90","thermalexpansion_tank_resonant_name")
- local gtank2 = component.get("1ade","thermalexpansion_tank_resonant_name")
- local gtank3 = component.get("7609","thermalexpansion_tank_resonant_name")
- local gtank4 = component.get("64c6","thermalexpansion_tank_resonant_name")
- local tank1 = component.proxy(gtank1)
- local tank2 = component.proxy(gtank2)
- local tank3 = component.proxy(gtank3)
- local tank4 = component.proxy(gtank4)
- local fusions = {
- {redstone=rs1,tank=tank1},
- {redstone=rs2,tank=tank2},
- {redstone=rs3,tank=tank3},
- {redstone=rs4,tank=tank4}
- }
- --récupération de l'IDSU
- idsu = component.getPrimary("gt_idsu")
- --Définition des paliers de déclenchement
- local palier = 990000000
- local delta = 5000000
- local function setColor(bg,fg,gpu)
- pgpus[gpu].setBackground(bg)
- pgpus[gpu].setForeground(fg)
- end
- local function unit(qty)
- if qty >= 1000000000 then
- return string.format("%.02fMB",qty/10000000)
- elseif qty >=1000000 then
- return string.format("%.02fKB",qty/1000000)
- elseif qty >=1000 then
- return string.format("%.02fB",qty/1000)
- else
- return string.format("%dmB",qty)
- end
- end
- function loadbar(x,y,width,cur,text,bg,gpu)
- local raw = " " .. text ..string.rep(" ", width - unicode.len(text) - 2) .. " "
- local oldbg = gpu.setBackground(bg)
- local oldfg = gpu.setForeground(0xFFFFFF - bg)
- gpu.set(x,y,unicode.sub(raw,1,cur))
- gpu.setBackground(oldbg)
- gpu.setForeground(oldfg)
- gpu.set(x+cur,y,unicode.sub(raw,cur+1,width))
- end
- local function affidsu(x,y,length,gpu)
- local amount = idsu.getStored()
- local capacity = idsu.getCapacity()
- local output = idsu.getOutput()
- local pct = amount / capacity
- local cur = math.floor(pct * length)
- local color = 0x00FFFF
- local textfrac = string.format("%s / %s", amount, capacity)
- local textpct = string.format("%.02f%%", pct*100)
- local text = textfrac .. string.rep(" ", length - string.len(textfrac) - string.len(textpct) - 2) .. textpct
- local dir = ""
- loadbar(x,y,length,cur,dir,color,pgpus[gpu])
- loadbar(x,y+1,length,cur,dir,color,pgpus[gpu])
- loadbar(x,y+2,length,cur,text,color,pgpus[gpu])
- end
- local function affplasma(x,y,length,fusion,gpu)
- local amount = fusions[fusion].tank.getTankInfo().amount
- local capacity = fusions[fusion].tank.getTankInfo().capacity
- local pct = amount / capacity
- local cur = math.floor(pct * length)
- local dir = ""
- local label = "Plasma d'hélium"
- local color = 0xffff66
- local textfrac = string.format("%s / %s", unit(amount), unit(capacity))
- local textpct = string.format("%.02f%%", pct*100)
- local text = textfrac ..string.rep(" ", length - string.len(textfrac) - string.len(textpct) - 2) .. textpct
- loadbar(x,y,length,cur,text,color,pgpus[gpu])
- end
- --Fonctions texte variable
- local function marche_on(x, y, gpu)
- setColor(0x00FF00, 0x0, gpu)
- pgpus[gpu].set(x,y,"MARCHE")
- setColor(0x0, 0xFFFFFF, gpu)
- end
- local function marche_off(x, y, gpu)
- setColor(0x0, 0x00FF00, gpu)
- pgpus[gpu].set(x,y,"MARCHE")
- setColor(0x0, 0xFFFFFF, gpu)
- end
- local function auto_on(x, y, gpu)
- setColor(0xFFFA000, 0x0, gpu)
- pgpus[gpu].set(x,y,"AUTO")
- setColor(0x0, 0xFFFFFF, gpu)
- end
- local function auto_off(x, y, gpu)
- setColor(0x0, 0xFFFA000, gpu)
- pgpus[gpu].set(x,y,"AUTO")
- setColor(0x0, 0xFFFFFF, gpu)
- end
- local function arret_on(x, y, gpu)
- setColor(0xFF0000, 0xFFFFFF, gpu)
- pgpus[gpu].set(x,y,"ARRET")
- setColor(0x0, 0xFF0000, gpu)
- end
- local function arret_off(x, y, gpu)
- setColor(0x0, 0xFF0000, gpu)
- pgpus[gpu].set(x,y,"ARRET")
- setColor(0x0, 0xFFFFFF, gpu)
- end
- local function on(x, y, gpu)
- setColor(0x00FF00, 0x0000FF, gpu)
- pgpus[gpu].set(x,y,"ON ")
- setColor(0x0, 0xFFFFFF, gpu)
- end
- local function off(x, y, gpu)
- setColor(0xFF8E8E, 0x0, gpu)
- pgpus[gpu].set(x,y,"OFF")
- setColor(0x0, 0xFFFFFF, gpu)
- end
- local function mb1(x, y, gpu)
- setColor(0xFFFFFF, 0x0, gpu)
- pgpus[gpu].set(x,y," 0mb/s")
- setColor(0x0, 0xFFFFFF, gpu)
- end
- local function mb2(x, y, gpu)
- setColor(0x4169e1, 0xFFFFFF, gpu)
- pgpus[gpu].set(x,y," 40mb/s")
- setColor(0x0, 0xFFFFFF, gpu)
- end
- local function mb3(x, y, gpu)
- setColor(0x008080, 0xFFFFFF, gpu)
- pgpus[gpu].set(x,y," 80mb/s")
- setColor(0x0, 0xFFFFFF, gpu)
- end
- local function mb4(x, y, gpu)
- setColor(0x00ffff, 0x0, gpu)
- pgpus[gpu].set(x,y,"120mb/s")
- setColor(0x0, 0xFFFFFF, gpu)
- end
- local function mb5(x, y, gpu)
- setColor(0x2e8b57, 0x0, gpu)
- pgpus[gpu].set(x,y,"160mb/s")
- setColor(0x0, 0xFFFFFF, gpu)
- end
- local function mb6(x, y, gpu)
- setColor(0xadff2f, 0x0, gpu)
- pgpus[gpu].set(x,y,"200mb/s")
- setColor(0x0, 0xFFFFFF, gpu)
- end
- local function mb7(x, y, gpu)
- setColor(0xffff00, 0x0, gpu)
- pgpus[gpu].set(x,y,"240mb/s")
- setColor(0x0, 0xFFFFFF, gpu)
- end
- local function mb8(x, y, gpu)
- setColor(0xd2691e, 0xFFFFFF, gpu)
- pgpus[gpu].set(x,y,"280mb/s")
- setColor(0x0, 0xFFFFFF, gpu)
- end
- local function mb9(x, y, gpu)
- setColor(0xff0000, 0xFFFFFF, gpu)
- pgpus[gpu].set(x,y,"320mb/s")
- setColor(0x0, 0xFFFFFF, gpu)
- end
- local function conso(val, x, y, gpu)
- if val==0 then
- mb1(x, y, gpu)
- elseif val==1 then
- mb2(x, y, gpu)
- elseif val==2 then
- mb3(x, y, gpu)
- elseif val==3 then
- mb4(x, y, gpu)
- elseif val==4 then
- mb5(x, y, gpu)
- elseif val==5 then
- mb6(x, y, gpu)
- elseif val==6 then
- mb7(x, y, gpu)
- elseif val==7 then
- mb8(x, y, gpu)
- elseif val==8 then
- mb9(x, y, gpu)
- end
- end
- local function comgene(x,y,gpu)
- marche_off(x,y,gpu)
- auto_off(x+7,y,gpu)
- arret_off(x+12,y,gpu)
- end
- local function dessin(x,y,gpu)
- off(x,y,gpu)
- marche_off(x+6,y,gpu)
- auto_on(x+13,y,gpu)
- arret_off(x+18,y,gpu)
- end
- local function gdessin(x,y,gpu)
- comgene(x+12,y+1,gpu)
- dessin(x+6,y+3,gpu)
- dessin(x+6,y+4,gpu)
- dessin(x+6,y+5,gpu)
- dessin(x+6,y+6,gpu)
- dessin(x+6,y+7,gpu)
- dessin(x+6,y+8,gpu)
- dessin(x+6,y+9,gpu)
- dessin(x+6,y+10,gpu)
- end
- local plasma_on = {
- {0,0,0,0,0,0,0,0},
- {0,0,0,0,0,0,0,0},
- {0,0,0,0,0,0,0,0},
- {0,0,0,0,0,0,0,0}
- }
- local buttontest = {
- {2,2,2,2,2,2,2,2},
- {2,2,2,2,2,2,2,2},
- {2,2,2,2,2,2,2,2},
- {2,2,2,2,2,2,2,2}
- }
- local palierg = {pg1,pg2,pg3,pg4}
- local function palierp(fusion,n)
- local amount = idsu.getStored()
- local pg = palier - (delta * (fusion-1))
- local dpp = delta / 8
- local pp = palier - ( dpp * (n-1))
- if buttontest[fusion][n] == 1 then
- plasma_on[fusion][n] = 1
- elseif buttontest[fusion][n] == 2 then
- if amount<pp then
- plasma_on[fusion][n] = 1
- else
- plasma_on[fusion][n] = 0
- end
- elseif buttontest[fusion][n] == 3 then
- plasma_on[fusion][n] = 0
- end
- end
- local function test_marche(x,y,gpu,fusion,n)
- if plasma_on[fusion][n] == 0 then
- fusions[fusion].redstone.setBundledOutput(commande,r_color[n],0)
- off(x,y,gpu)
- elseif plasma_on[fusion][n] == 1 then
- fusions[fusion].redstone.setBundledOutput(commande, r_color[n],255)
- on(x,y,gpu)
- end
- end
- local function test_marche8(x,y,gpu,fusion)
- test_marche(x,y,gpu,fusion,1)
- test_marche(x,y+1,gpu,fusion,2)
- test_marche(x,y+2,gpu,fusion,3)
- test_marche(x,y+3,gpu,fusion,4)
- test_marche(x,y+4,gpu,fusion,5)
- test_marche(x,y+5,gpu,fusion,6)
- test_marche(x,y+6,gpu,fusion,7)
- test_marche(x,y+7,gpu,fusion,8)
- end
- local function control(x,y,fusion, gpu)
- local d1 = plasma_on[fusion][1]
- local d2 = plasma_on[fusion][2]
- local d3 = plasma_on[fusion][3]
- local d4 = plasma_on[fusion][4]
- local d5 = plasma_on[fusion][5]
- local d6 = plasma_on[fusion][6]
- local d7 = plasma_on[fusion][7]
- local d8 = plasma_on[fusion][8]
- local d = d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8
- affplasma(x,y+12,30,fusion, gpu)
- conso(d, x+22, y+14, gpu)
- palierp(fusion,1)
- palierp(fusion,2)
- palierp(fusion,3)
- palierp(fusion,4)
- palierp(fusion,5)
- palierp(fusion,6)
- palierp(fusion,7)
- palierp(fusion,8)
- end
- local function button1(x,y,w,z,gpu,address,n,fusion) -- x = gpu x / y = gpu y / w = touch x / z = touch y / n = n° du boutton
- if w>x and w<x+7 and z==y then
- marche_on(x+1,y,gpu)
- auto_off(x+8,y,gpu)
- arret_off(x+13,y,gpu)
- buttontest[fusion][n] = 1
- elseif w>x+7 and w<x+12 and z==y then
- marche_off(x+1,y,gpu)
- auto_on(x+8,y,gpu)
- arret_off(x+13,y,gpu)
- buttontest[fusion][n] = 2
- elseif w>x+12 and w<x+18 and z==y then
- marche_off(x+1,y,gpu)
- auto_off(x+8,y,gpu)
- arret_on(x+13,y,gpu)
- buttontest[fusion][n] = 3
- end
- end
- local function button8(x,y,w,z,gpu,address,fusion) -- x = gpu x / y = gpu y / w = touch x / z = touch y
- button1(x,y,w,z,gpu,address,1,fusion)
- button1(x,y+1,w,z,gpu,address,2,fusion)
- button1(x,y+2,w,z,gpu,address,3,fusion)
- button1(x,y+3,w,z,gpu,address,4,fusion)
- button1(x,y+4,w,z,gpu,address,5,fusion)
- button1(x,y+5,w,z,gpu,address,6,fusion)
- button1(x,y+6,w,z,gpu,address,7,fusion)
- button1(x,y+7,w,z,gpu,address,8,fusion)
- end
- local function buttongene(x,y,w,z,gpu,address,fusion) -- x = gpu x / y = gpu y / w = touch x / z = touch y
- if w>x and w<x+7 and z==y then
- marche_on(x+1,y+2,gpu)
- marche_on(x+1,y+3,gpu)
- marche_on(x+1,y+4,gpu)
- marche_on(x+1,y+5,gpu)
- marche_on(x+1,y+6,gpu)
- marche_on(x+1,y+7,gpu)
- marche_on(x+1,y+8,gpu)
- marche_on(x+1,y+9,gpu)
- auto_off(x+8,y+2,gpu)
- auto_off(x+8,y+3,gpu)
- auto_off(x+8,y+4,gpu)
- auto_off(x+8,y+5,gpu)
- auto_off(x+8,y+6,gpu)
- auto_off(x+8,y+7,gpu)
- auto_off(x+8,y+8,gpu)
- auto_off(x+8,y+9,gpu)
- arret_off(x+13,y+2,gpu)
- arret_off(x+13,y+3,gpu)
- arret_off(x+13,y+4,gpu)
- arret_off(x+13,y+5,gpu)
- arret_off(x+13,y+6,gpu)
- arret_off(x+13,y+7,gpu)
- arret_off(x+13,y+8,gpu)
- arret_off(x+13,y+9,gpu)
- buttontest[fusion] = {1,1,1,1,1,1,1,1}
- elseif w>x+7 and w<x+12 and z==y then
- marche_off(x+1,y+2,gpu)
- marche_off(x+1,y+3,gpu)
- marche_off(x+1,y+4,gpu)
- marche_off(x+1,y+5,gpu)
- marche_off(x+1,y+6,gpu)
- marche_off(x+1,y+7,gpu)
- marche_off(x+1,y+8,gpu)
- marche_off(x+1,y+9,gpu)
- auto_on(x+8,y+2,gpu)
- auto_on(x+8,y+3,gpu)
- auto_on(x+8,y+4,gpu)
- auto_on(x+8,y+5,gpu)
- auto_on(x+8,y+6,gpu)
- auto_on(x+8,y+7,gpu)
- auto_on(x+8,y+8,gpu)
- auto_on(x+8,y+9,gpu)
- arret_off(x+13,y+2,gpu)
- arret_off(x+13,y+3,gpu)
- arret_off(x+13,y+4,gpu)
- arret_off(x+13,y+5,gpu)
- arret_off(x+13,y+6,gpu)
- arret_off(x+13,y+7,gpu)
- arret_off(x+13,y+8,gpu)
- arret_off(x+13,y+9,gpu)
- buttontest[fusion] = {2,2,2,2,2,2,2,2}
- elseif w>x+12 and w<x+18 and z==y then
- marche_off(x+1,y+2,gpu)
- marche_off(x+1,y+3,gpu)
- marche_off(x+1,y+4,gpu)
- marche_off(x+1,y+5,gpu)
- marche_off(x+1,y+6,gpu)
- marche_off(x+1,y+7,gpu)
- marche_off(x+1,y+8,gpu)
- marche_off(x+1,y+9,gpu)
- auto_off(x+8,y+2,gpu)
- auto_off(x+8,y+3,gpu)
- auto_off(x+8,y+4,gpu)
- auto_off(x+8,y+5,gpu)
- auto_off(x+8,y+6,gpu)
- auto_off(x+8,y+7,gpu)
- auto_off(x+8,y+8,gpu)
- auto_off(x+8,y+9,gpu)
- arret_on(x+13,y+2,gpu)
- arret_on(x+13,y+3,gpu)
- arret_on(x+13,y+4,gpu)
- arret_on(x+13,y+5,gpu)
- arret_on(x+13,y+6,gpu)
- arret_on(x+13,y+7,gpu)
- arret_on(x+13,y+8,gpu)
- arret_on(x+13,y+9,gpu)
- buttontest[fusion] = {3,3,3,3,3,3,3,3}
- end
- end
- --
- --cadre screen 1 ║ ║ ║ ║ ║ ║ ║ ║ ║
- pgpus[1].set(1,1,"╔══════════════════════════════╦══════════════════════════════╗")
- pgpus[1].set(1,2,"║ Groupe plasma 1 ║ Groupe plasma 2 ║")
- pgpus[1].set(1,3,"║ Mode MARCHE AUTO ARRET ║ Mode MARCHE AUTO ARRET ║")
- pgpus[1].set(1,4,"╟───┬──────┬───────────────────╫───┬──────┬───────────────────╢")
- pgpus[1].set(1,5,"║ 1 │ ON │ MARCHE AUTO ARRET ║ 1 │ ON │ MARCHE AUTO ARRET ║")
- pgpus[1].set(1,6,"║ 2 │ ON │ MARCHE AUTO ARRET ║ 2 │ ON │ MARCHE AUTO ARRET ║")
- pgpus[1].set(1,7,"║ 3 │ ON │ MARCHE AUTO ARRET ║ 3 │ ON │ MARCHE AUTO ARRET ║")
- pgpus[1].set(1,8,"║ 4 │ ON │ MARCHE AUTO ARRET ║ 4 │ ON │ MARCHE AUTO ARRET ║")
- pgpus[1].set(1,9,"║ 5 │ ON │ MARCHE AUTO ARRET ║ 5 │ ON │ MARCHE AUTO ARRET ║")
- pgpus[1].set(1,10,"║ 6 │ ON │ MARCHE AUTO ARRET ║ 6 │ ON │ MARCHE AUTO ARRET ║")
- pgpus[1].set(1,11,"║ 7 │ ON │ MARCHE AUTO ARRET ║ 7 │ ON │ MARCHE AUTO ARRET ║")
- pgpus[1].set(1,12,"║ 8 │ ON │ MARCHE AUTO ARRET ║ 8 │ ON │ MARCHE AUTO ARRET ║")
- pgpus[1].set(1,13,"╟───┴──────┴───────────────────╫───┴──────┴───────────────────╢")
- pgpus[1].set(1,14,"║ val Plasma 100.00% ║ val Plasma 100.00% ║")
- pgpus[1].set(1,15,"╟──────────────────────────────╫──────────────────────────────╢")
- pgpus[1].set(1,16,"║ Consommation 0mB/s ║ Consommation 0mB/s ║")
- pgpus[1].set(1,17,"╠══════════════════════════════╩══════════════════════════════╣")
- pgpus[1].set(1,18,"║ CONTROLE GENERAL DES GENERATEURS A PLASMA ║")
- pgpus[1].set(1,19,"╠══════════════════════════════╦══════════════════════════════╣")
- pgpus[1].set(1,20,"║ Groupe plasma 3 ║ Groupe plasma 4 ║")
- pgpus[1].set(1,21,"║ Mode MARCHE AUTO ARRET ║ Mode MARCHE AUTO ARRET ║")
- pgpus[1].set(1,22,"╟───┬──────┬───────────────────╫───┬──────┬───────────────────╢")
- pgpus[1].set(1,23,"║ 1 │ ON │ MARCHE AUTO ARRET ║ 1 │ ON │ MARCHE AUTO ARRET ║")
- pgpus[1].set(1,24,"║ 2 │ ON │ MARCHE AUTO ARRET ║ 2 │ ON │ MARCHE AUTO ARRET ║")
- pgpus[1].set(1,25,"║ 3 │ ON │ MARCHE AUTO ARRET ║ 3 │ ON │ MARCHE AUTO ARRET ║")
- pgpus[1].set(1,26,"║ 4 │ ON │ MARCHE AUTO ARRET ║ 4 │ ON │ MARCHE AUTO ARRET ║")
- pgpus[1].set(1,27,"║ 5 │ ON │ MARCHE AUTO ARRET ║ 5 │ ON │ MARCHE AUTO ARRET ║")
- pgpus[1].set(1,28,"║ 6 │ ON │ MARCHE AUTO ARRET ║ 6 │ ON │ MARCHE AUTO ARRET ║")
- pgpus[1].set(1,29,"║ 7 │ ON │ MARCHE AUTO ARRET ║ 7 │ ON │ MARCHE AUTO ARRET ║")
- pgpus[1].set(1,30,"║ 8 │ ON │ MARCHE AUTO ARRET ║ 8 │ ON │ MARCHE AUTO ARRET ║")
- pgpus[1].set(1,31,"╟───┴──────┴───────────────────╫───┴──────┴───────────────────╢")
- pgpus[1].set(1,32,"║ val Plasma 100.00% ║ val Plasma 100.00% ║")
- pgpus[1].set(1,33,"╟──────────────────────────────╫──────────────────────────────╢")
- pgpus[1].set(1,34,"║ Consommation 0mB/s ║ Consommation 0mB/s ║")
- pgpus[1].set(1,35,"╚══════════════════════════════╩══════════════════════════════╝")
- gdessin(2,2,1)
- gdessin(33,2,1)
- gdessin(2,20,1)
- gdessin(33,20,1)
- --cadre screen 2
- pgpus[2].set(1,1,"╔═══════════════════════════════════════════╗")
- pgpus[2].set(1,2,"║ ETAT DU RESEAU ELECTRIQUE ║")
- pgpus[2].set(1,3,"╠═══════════════════════════════════════════╣")
- pgpus[2].set(1,4,"║ ║")
- pgpus[2].set(1,5,"║ ║")
- pgpus[2].set(1,6,"║ ║")
- pgpus[2].set(1,7,"╟───────────────────────────────────────────╢")
- pgpus[2].set(1,8,"║ Charge de l'IDSU ║")
- pgpus[2].set(1,9,"╠═══════════════════════════════════════════╣")
- pgpus[2].set(1,10,"║ ║")
- pgpus[2].set(1,11,"║ ║")
- pgpus[2].set(1,12,"║ ║")
- pgpus[2].set(1,13,"║ ║")
- pgpus[2].set(1,14,"║ ║")
- pgpus[2].set(1,15,"║ ║")
- pgpus[2].set(1,16,"║ ║")
- pgpus[2].set(1,17,"║ ║")
- pgpus[2].set(1,18,"║ ║")
- pgpus[2].set(1,19,"║ ║")
- pgpus[2].set(1,20,"╟───────────────────────────────────────────╢")
- pgpus[2].set(1,21,"║ Charge des AESU ║")
- pgpus[2].set(1,22,"╟───────────────────────────────────────────╢")
- pgpus[2].set(1,23,"║ Charge Batteries CONNEXION DECONNEXION ║")
- pgpus[2].set(1,24,"║ Décharge Batteries CONNEXION DECONNEXION ║")
- pgpus[2].set(1,25,"╚═══════════════════════════════════════════╝")
- --cadre screen 3
- pgpus[3].set(1,1,"╔═══════════════════════════════════════════╗")
- pgpus[3].set(1,2,"║ ║")
- pgpus[3].set(1,3,"║ ║")
- pgpus[3].set(1,4,"║ ║")
- pgpus[3].set(1,5,"║ ║")
- pgpus[3].set(1,6,"║ ║")
- pgpus[3].set(1,7,"║ ║")
- pgpus[3].set(1,8,"║ ║")
- pgpus[3].set(1,9,"║ ║")
- pgpus[3].set(1,10,"║ ║")
- pgpus[3].set(1,11,"║ ║")
- pgpus[3].set(1,12,"║ ║")
- pgpus[3].set(1,13,"║ ║")
- pgpus[3].set(1,14,"║ ║")
- pgpus[3].set(1,15,"║ ║")
- pgpus[3].set(1,16,"║ ║")
- pgpus[3].set(1,17,"║ ║")
- pgpus[3].set(1,18,"║ ║")
- pgpus[3].set(1,19,"║ ║")
- pgpus[3].set(1,20,"║ ║")
- pgpus[3].set(1,21,"║ ║")
- pgpus[3].set(1,22,"║ ║")
- pgpus[3].set(1,23,"║ ║")
- pgpus[3].set(1,24,"║ ║")
- pgpus[3].set(1,25,"╚═══════════════════════════════════════════╝")
- local function controlg()
- control(2,2,1,1)
- control(33,2,2,1)
- control(2,20,3,1)
- control(33,20,4,1)
- test_marche8(8,5,1,1)
- test_marche8(39,5,1,2)
- test_marche8(8,23,1,3)
- test_marche8(39,23,1,4)
- end
- local function drawbars()
- controlg()
- affidsu(2,4,43,2)
- end
- local function onTouch(_,address,x,y)
- if address==screen1 then
- if x~=1 and y~=1 then
- if x>13 and x<31 and y>4 and y<13 then
- button8(13,5,x,y,1,address,1)
- elseif x>44 and x<62 and y>22 and y<31 then
- button8(44,5,x,y,1,address,1)
- elseif x>13 and x<31 and y>4 and y<13 then
- button8(13,23,x,y,1,address,1)
- elseif x>44 and x<62 and y>22 and y<31 then
- button8(44,23,x,y,1,address,1)
- elseif x>13 and x<31 and y==3 then
- buttongene(13,3,x,y,1,address,1)
- elseif x>44 and x<62 and y==3 then
- buttongene(44,3,x,y,1,address,2)
- elseif x>13 and x<31 and y==21 then
- buttongene(13,21,x,y,1,address,3)
- elseif x>44 and x<62 and y==21 then
- buttongene(44,21,x,y,1,address,4)
- end
- elseif x==1 and y==1 then
- computer.pushSignal("quit")
- pgpus[3].fill(1,1,45,25," ")
- pgpus[2].fill(1,1,45,25," ")
- pgpus[1].fill(1,1,63,35," ")
- term.setCursor(1,1)
- return false
- end
- end
- end
- local function onTimer(_,timer)
- drawbars()
- return true
- end
- event.listen("touch",onTouch)
- local timer = event.timer(1,onTimer,math.huge)
- event.pull("quit")
- event.cancel(timer)
- event.ignore("touch",onTouch)
- pgpus[3].fill(1,1,45,25," ")
- pgpus[2].fill(1,1,45,25," ")
- pgpus[1].fill(1,1,63,35," ")
- pgpus[1].bind(screen1)
- pgpus[1].setResolution(120,50)
- --crée par sshikamaru // Citez moi ainsi que le serveur Sphère-ville si vous utilisez ou modifiez ce code.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement