Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------------------------
- -- --
- -- Programme de Shiranuit --
- -- --
- ---------------------------------------------------------------------
- -- APIS
- os.pullEvent = os.pullEventRaw
- os.loadAPI("InterfaceApi")
- os.loadAPI("NetSphere")
- local h = http.get("http://pastebin.com/raw/9mQiK4PX")
- local DerniereVersion = textutils.unserialise(h.readAll())
- h.close()
- local MaVersion = {["ATM"]=0}
- if fs.exists("Version") then
- local h = fs.open("Version","r")
- MaVersion = textutils.unserialise(h.readAll())
- h.close()
- end
- if MaVersion["ATM"] ~= DerniereVersion["ATM"] then
- fs.delete("install")
- shell.run("pastebin get SygpH4ub install")
- shell.run("install")
- end
- --OUVERTURE MODEM
- while true do
- local modem = peripheral.find("modem",function(name,object) return object.isWireless() end)
- if modem then
- modem.open(os.getComputerID())
- modem.open(65535)
- break
- else
- shell.run("clear")
- print("Veuillez placer un modem quelque part !")
- os.pullEvent("peripheral")
- end
- end
- function Isnull(info)
- if info == nil then
- return true
- else
- return false
- end
- end
- local IDTerminal = 50
- while true do
- local r = rednet.lookup("Serveur_Banque","Serveur_Banque")
- if r == nil then
- shell.run("clear")
- print("Appuyer sur une touche un fois le serveur allumer !")
- os.pullEvent()
- else
- IDTerminal = r
- break
- end
- end
- function send(id, texte)
- NetSphere.send(id, texte)
- end
- --DECLARATION DE VARIABLES
- local width, height = term.getSize()
- local psd = ""
- local motdepasse = ""
- local CompteValider=false
- local historique = {}
- local solde = 0
- local Action="Connection"
- local nomTransfer = ""
- local sommeTransfer = 0
- local nEntreprise = ""
- local entreprises = {}
- local psdPlayer = ""
- local membres = {}
- local esolde = 0
- local ehistorique = {}
- local sommeTransferE = 0
- local statut = "PLAYER"
- local nCompteMO = ""
- local nSommeMO = 0
- local nPercentTransfersMO = 0
- local nATMIdMO = 0
- local nATMIDTransfersMO = 0
- local nMdpMO = ""
- local mAMdp = ""
- local mNMdp = ""
- local ComponmentList = {}
- local ListeComptes = {}
- --COMPOSANTS
- -- Menu Connection
- ComponmentList["PseudoTxtBoxMC"] = InterfaceApi.AddTextBox("PseudoTxtBoxMC",11,8,29,1,colors.yellow,colors.gray," Pseudo : ","",nil,{},nil)
- ComponmentList["MdpTxtBoxMC"] = InterfaceApi.AddTextBox("MdpTxtBoxMC",11,11,29,1,colors.yellow,colors.gray," Code : ","","*",{},ComponmentList["PseudoTxtBoxMC"])
- ComponmentList["PseudoTxtBoxMC"].TabComponment(ComponmentList["MdpTxtBoxMC"])
- ComponmentList["EffacerMC"] = InterfaceApi.AddBoutton("AnnulerMC",11,13,12,1,colors.yellow,colors.red,"Effacer")
- ComponmentList["ValiderMC"] = InterfaceApi.AddBoutton("ValiderMC",28,13,12,1,colors.yellow,colors.green,"Valider")
- ComponmentList["MenuConnection"] = InterfaceApi.AddFormSkin("MenuConnection",1,1,width,height,colors.yellow,colors.black,colors.gray,"[HelixProject] vous souhaite la bienvenue",false,{ComponmentList["PseudoTxtBoxMC"],ComponmentList["MdpTxtBoxMC"],ComponmentList["EffacerMC"],ComponmentList["ValiderMC"]})
- -- Menu Principal
- ComponmentList["TransfertMP"] = InterfaceApi.AddBoutton("TransfertMP",2,4,12,1,colors.yellow,colors.gray,"Transférer")
- ComponmentList["EntreprisesMP"] = InterfaceApi.AddBoutton("EntreprisesMP",2,6,12,1,colors.yellow,colors.gray,"Entreprises")
- ComponmentList["CleMP"] = InterfaceApi.AddBoutton("CleMP",2,8,12,1,colors.yellow,colors.gray,"Menu Clé")
- ComponmentList["OpMP"] = InterfaceApi.AddBoutton("OpMP",2,10,12,1,colors.yellow,colors.gray,"Menu OP")
- ComponmentList["LabelHistoriqueMP"] = InterfaceApi.AddLabel("LabelHistoriqueMP",15,4,colors.yellow,colors.lightGray," Historique de transactions : ")
- ComponmentList["HistoriqueListBoxMP"] = InterfaceApi.AddListBox("HistoriqueListBoxMP",15,5,33,11,colors.yellow,colors.gray,colors.gray,colors.green,{},true,1,1)
- ComponmentList["ModifmdpMP"] = InterfaceApi.AddBoutton("ModifmdpMP",2,17,11,1,colors.yellow,colors.gray,"Modif Mdp")
- ComponmentList["EffHistoriqueMP"] = InterfaceApi.AddBoutton("EffHistoriqueMP",14,17,10,1,colors.yellow,colors.gray,"Effacer")
- ComponmentList["RecupHistoriqueMP"] = InterfaceApi.AddBoutton("RecupHistoriqueMP",25,17,11,1,colors.yellow,colors.gray,"Recuperer")
- ComponmentList["DeconnectionMP"] = InterfaceApi.AddBoutton("DeconnectionMP",37,17,11,1,colors.yellow,colors.red,"Quitter")
- ComponmentList["MenuPrincipal"] = InterfaceApi.AddFormSkin("MenuPrincipal",1,1,width,height,colors.yellow,colors.black,colors.gray,"",false,{ComponmentList["CleMP"],ComponmentList["TransfertMP"],ComponmentList["EntreprisesMP"],ComponmentList["OpMP"],ComponmentList["LabelHistoriqueMP"],ComponmentList["HistoriqueListBoxMP"],ComponmentList["ModifmdpMP"],ComponmentList["EffHistoriqueMP"],ComponmentList["RecupHistoriqueMP"],ComponmentList["DeconnectionMP"]})
- ComponmentList["OpMP"].Visible(false)
- --Menu Transfert
- ComponmentList["CompteTxtBoxMT"] = InterfaceApi.AddTextBox("CompteTxtBoxMT",4,3,35,1,colors.yellow,colors.gray,"Compte : ","",nil,{},nil)
- ComponmentList["SommeNumericUpDownMT"] = InterfaceApi.AddNumericUpDown("SommeNumericUpDownMT",40,3,9,1,colors.yellow,colors.gray,0,100,0,1,ComponmentList["CompteTxtBoxMT"])
- ComponmentList["CompteTxtBoxMT"].TabComponment(ComponmentList["SommeNumericUpDownMT"])
- ComponmentList["LabelHistoriqueMT"] = InterfaceApi.AddLabel("LabelHistoriqueMT",4,5,colors.yellow,colors.lightGray," Historique de transactions : ")
- ComponmentList["HistoriqueListBoxMT"] = InterfaceApi.AddListBox("HistoriqueListBoxMT",4,6,35,12,colors.yellow,colors.gray,colors.gray,colors.green,{},true,1,1)
- ComponmentList["ValiderMT"] = InterfaceApi.AddBoutton("ValiderMT",40,5,9,1,colors.yellow,colors.green,"Valider")
- ComponmentList["EffacerMT"] = InterfaceApi.AddBoutton("EffacerMT",40,15,9,1,colors.yellow,colors.blue,"Effacer")
- ComponmentList["RetourMT"] = InterfaceApi.AddBoutton("RetourMT",40,17,9,1,colors.yellow,colors.red,"Retour")
- ComponmentList["MenuTransfert"] = InterfaceApi.AddFormSkin("MenuTransfert",1,1,width,height,colors.yellow,colors.black,colors.gray,"",false,{ComponmentList["CompteTxtBoxMT"],ComponmentList["SommeNumericUpDownMT"],ComponmentList["LabelHistoriqueMT"],ComponmentList["HistoriqueListBoxMT"],ComponmentList["ValiderMT"],ComponmentList["EffacerMT"],ComponmentList["RetourMT"]})
- -- Menu Entreprises :
- -- Menu Entreprise Principal
- ComponmentList["CreeEntrepriseME"] = InterfaceApi.AddBoutton("CreeEntrepriseME",2,4,20,1,colors.yellow,colors.gray,"Créer Entreprise")
- ComponmentList["SupprEntrepriseME"] = InterfaceApi.AddBoutton("SupprEntrepriseME",2,6,20,1,colors.yellow,colors.gray,"Retirer Entreprise")
- ComponmentList["GererMembresME"] = InterfaceApi.AddBoutton("GererMembresME",2,8,20,1,colors.yellow,colors.gray,"Gerer Membres")
- ComponmentList["GererTransfertME"] = InterfaceApi.AddBoutton("GererTransfertME",2,10,20,1,colors.yellow,colors.gray,"Gerer Transferts")
- ComponmentList["RetourME"] = InterfaceApi.AddBoutton("RetourME",40,17,9,1,colors.yellow,colors.red,"Retour")
- ComponmentList["EntrepriseTxtBoxME"] = InterfaceApi.AddTextBox("EntrepriseTxtBoxME",2,12,20,1,colors.yellow,colors.gray," Nom : ","",nil,{},nil)
- ComponmentList["EntrepriseListBoxME"] = InterfaceApi.AddListBox("EntrepriseListBoxME",24,4,25,12,colors.yellow,colors.gray,colors.gray,colors.red,{},true,1,1)
- ComponmentList["MenuEntreprise"] = InterfaceApi.AddFormSkin("MenuEntreprise",1,1,width,height,colors.yellow,colors.black,colors.gray,"Panneau de gestion des entreprises",false,{ComponmentList["CreeEntrepriseME"],ComponmentList["SupprEntrepriseME"],ComponmentList["GererMembresME"],ComponmentList["GererTransfertME"],ComponmentList["RetourME"],ComponmentList["EntrepriseTxtBoxME"],ComponmentList["EntrepriseListBoxME"]})
- -- Menu Entreprise Gestion Membres
- ComponmentList["EntrepriseAddMembreMEGM"] = InterfaceApi.AddBoutton("CreeEntrepriseMEGM",2,4,20,1,colors.yellow,colors.gray,"Ajouter Membre")
- ComponmentList["EntrepriseSupprMembreMEGM"] = InterfaceApi.AddBoutton("CreeEntrepriseMEGM",2,6,20,1,colors.yellow,colors.gray,"Retirer Membre")
- ComponmentList["EntreprisePermMembreMEGM"] = InterfaceApi.AddBoutton("CreeEntrepriseMEGM",2,8,20,1,colors.yellow,colors.gray,"Permissions Membre")
- ComponmentList["EntrepriseTxtBoxMEGM"] = InterfaceApi.AddTextBox("EntrepriseTxtBoxMEGM",2,10,20,1,colors.yellow,colors.gray," Nom : ","",nil,{},nil)
- ComponmentList["EntrepriseMembreListBoxMEGM"] = InterfaceApi.AddListBox("EntrepriseMembreListBoxMEGM",24,4,25,12,colors.yellow,colors.gray,colors.gray,colors.green,{},true,1,1)
- ComponmentList["RetourMEGM"] = InterfaceApi.AddBoutton("RetourMEGM",40,17,9,1,colors.yellow,colors.red,"Retour")
- ComponmentList["MenuEntrepriseGestionMembre"] = InterfaceApi.AddFormSkin("MenuEntrepriseGestionMembre",1,1,width,height,colors.yellow,colors.black,colors.gray,"",false,{ComponmentList["EntrepriseAddMembreMEGM"],ComponmentList["EntrepriseSupprMembreMEGM"],ComponmentList["EntreprisePermMembreMEGM"],ComponmentList["EntrepriseTxtBoxMEGM"],ComponmentList["EntrepriseMembreListBoxMEGM"],ComponmentList["RetourMEGM"]})
- -- Menu Entreprise Gestion Transferts
- ComponmentList["EntrepriseCreditMEGT"] = InterfaceApi.AddBoutton("EntrepriseCreditMEGT",4,3,14,1,colors.yellow,colors.gray,"Créditer")
- ComponmentList["EntrepriseDebitMEGT"] = InterfaceApi.AddBoutton("EntrepriseDebitMEGT",24,3,15,1,colors.yellow,colors.gray,"Débiter")
- ComponmentList["RetourMEGT"] = InterfaceApi.AddBoutton("RetourMEGT",40,17,9,1,colors.yellow,colors.red,"Retour")
- ComponmentList["SommeNumericUpDownMEGT"] = InterfaceApi.AddNumericUpDown("SommeNumericUpDownMEGT",40,3,9,1,colors.yellow,colors.gray,0,100,0,1,nil)
- ComponmentList["LabelHistoriqueMT"] = InterfaceApi.AddLabel("LabelHistoriqueMT",4,5,colors.yellow,colors.lightGray," Historique de transactions : ")
- ComponmentList["HistoriqueListBoxMEGT"] = InterfaceApi.AddListBox("HistoriqueListBoxMEGT",4,6,35,12,colors.yellow,colors.gray,colors.gray,colors.green,{},true,1,1)
- ComponmentList["MenuEntrepriseGestionTranfert"] = InterfaceApi.AddFormSkin("MenuEntrepriseGestionTranfert",1,1,width,height,colors.yellow,colors.black,colors.gray,"",false,{ComponmentList["EntrepriseCreditMEGT"],ComponmentList["EntrepriseDebitMEGT"],ComponmentList["RetourMEGT"],ComponmentList["SommeNumericUpDownMEGT"],ComponmentList["LabelHistoriqueMT"],ComponmentList["HistoriqueListBoxMEGT"]})
- -- Menu Entreprise Gestion Permissions Membres
- ComponmentList["PermDelEntreprise"] = InterfaceApi.AddCheckBox("PermDelEntreprise",3,2,50,1,colors.yellow,colors.black,colors.green,colors.red,"Permission de supprimer l'entreprise : ",false)
- ComponmentList["PermDepos"] = InterfaceApi.AddCheckBox("PermDepos",3,4,50,1,colors.yellow,colors.black,colors.green,colors.red,"Permission de déposer de l'argent : ",false)
- ComponmentList["PermRetrait"] = InterfaceApi.AddCheckBox("PermRetrait",3,6,50,1,colors.yellow,colors.black,colors.green,colors.red,"Permission de retirer de l'argent : ",false)
- ComponmentList["PermDelMembre"] = InterfaceApi.AddCheckBox("PermDelMembre",3,8,50,1,colors.yellow,colors.black,colors.green,colors.red,"Permission de supprimer un membre : ",false)
- ComponmentList["PermModif"] = InterfaceApi.AddCheckBox("PermModif",3,10,50,1,colors.yellow,colors.black,colors.green,colors.red,"Permission de modifier les permissions : ",false)
- ComponmentList["PermAddMembre"] = InterfaceApi.AddCheckBox("PermAddMembre",3,12,50,1,colors.yellow,colors.black,colors.green,colors.red,"Permission d'ajouter un membre : ",false)
- ComponmentList["ValiderMEGPM"] = InterfaceApi.AddBoutton("ValiderMEGPM",28,17,9,1,colors.yellow,colors.green,"Valider")
- ComponmentList["RetourMEGPM"] = InterfaceApi.AddBoutton("RetourMEGPM",40,17,9,1,colors.yellow,colors.red,"Retour")
- ComponmentList["MenuEntrepriseGestionPermissionMembre"] = InterfaceApi.AddFormSkin("MenuEntrepriseGestionPermissionMembre",1,1,width,height,colors.yellow,colors.black,colors.gray,"",false,{ComponmentList["PermAddMembre"],ComponmentList["PermModif"],ComponmentList["PermDelMembre"],ComponmentList["PermRetrait"],ComponmentList["PermDelEntreprise"],ComponmentList["PermDepos"],ComponmentList["RetourMEGPM"],ComponmentList["ValiderMEGPM"]})
- -- Menu OP
- ComponmentList["AddCompteMO"] = InterfaceApi.AddBoutton("AddCompteMO",2,4,20,1,colors.yellow,colors.gray,"Ajouter Compte")
- ComponmentList["SupprCompteMO"] = InterfaceApi.AddBoutton("SupprCompteMO",2,6,20,1,colors.yellow,colors.gray,"Supprimer Compte")
- ComponmentList["GiveMonneyMO"] = InterfaceApi.AddBoutton("GiveMonneyMO",2,8,20,1,colors.yellow,colors.gray,"Donner Argent")
- ComponmentList["StealMonneyMO"] = InterfaceApi.AddBoutton("StealMonneyMO",2,10,20,1,colors.yellow,colors.gray,"Retirer Argent")
- ComponmentList["AddPercentMO"] = InterfaceApi.AddBoutton("AddPercentMO",2,12,20,1,colors.yellow,colors.gray,"Donner a * un %")
- ComponmentList["StealPercentMO"] = InterfaceApi.AddBoutton("StealPercentMO",2,14,20,1,colors.yellow,colors.gray,"Retirer a * un %")
- ComponmentList["ListeComptesMO"] = InterfaceApi.AddBoutton("ListeComptesMO",2,16,20,1,colors.yellow,colors.gray,"Liste des Comptes")
- ComponmentList["AddATMMO"] = InterfaceApi.AddBoutton("AddATMMO",2,18,9,1,colors.yellow,colors.gray,"Add ATM")
- ComponmentList["DelATMMO"] = InterfaceApi.AddBoutton("DelATMMO",12,18,10,1,colors.yellow,colors.gray,"Del ATM")
- ComponmentList["CompteTxtBoxMO"] = InterfaceApi.AddTextBox("CompteTxtBoxMO",23,4,25,1,colors.yellow,colors.gray," Compte : ","",nil,{},nil)
- ComponmentList["LabelSommeMO"] = InterfaceApi.AddLabel("LabelSommeMO",23,6,colors.yellow,colors.gray," Somme : ")
- ComponmentList["SommeNumericUpDownMO"] = InterfaceApi.AddNumericUpDown("SommeNumericUpDownMO",32,6,16,1,colors.yellow,colors.gray,0,9999999999,0,1,nil)
- ComponmentList["LabelPercentMO"] = InterfaceApi.AddLabel("LabelPercentMO",23,8,colors.yellow,colors.gray," % : ")
- ComponmentList["PercentNumericUpDownMO"] = InterfaceApi.AddNumericUpDown("PercentNumericUpDownMO",28,8,20,1,colors.yellow,colors.gray,0,9999999999,0,1,nil)
- ComponmentList["MdpTxtBoxMO"] = InterfaceApi.AddTextBox("MdpTxtBoxMO",23,10,25,1,colors.yellow,colors.gray," Mdp : ","",nil,{},nil)
- ComponmentList["ModifMdpMO"] = InterfaceApi.AddBoutton("ModifMdpMO",23,12,25,1,colors.yellow,colors.gray,"Changer le Mot de passe")
- ComponmentList["MakeOPMO"] = InterfaceApi.AddBoutton("MakeOPMO",23,14,12,1,colors.yellow,colors.gray,"Set OP")
- ComponmentList["MakePlayerMO"] = InterfaceApi.AddBoutton("MakePlayerMO",37,14,11,1,colors.yellow,colors.gray,"Set PLAYER")
- ComponmentList["HistoriqueMO"] = InterfaceApi.AddBoutton("HistoriqueMO",23,16,12,1,colors.yellow,colors.gray,"Historique")
- ComponmentList["RetourMO"] = InterfaceApi.AddBoutton("RetourMO",37,16,11,1,colors.yellow,colors.red,"Retour")
- ComponmentList["TerminateMO"] = InterfaceApi.AddBoutton("TerminateMO",48,16,1,1,colors.yellow,colors.blue,"S")
- ComponmentList["IDATMMO"] = InterfaceApi.AddNumericUpDown("IDATMMO",23,18,25,1,colors.yellow,colors.gray,0,9999999999,0,1,nil)
- ComponmentList["MenuOperateur"] = InterfaceApi.AddFormSkin("MenuOperateur",1,1,width,height,colors.yellow,colors.black,colors.gray,"[HelixProject] Bienvenue dans le Menu OP",false,{ComponmentList["AddCompteMO"],ComponmentList["SupprCompteMO"],ComponmentList["GiveMonneyMO"],ComponmentList["StealMonneyMO"],ComponmentList["AddPercentMO"],ComponmentList["StealPercentMO"],ComponmentList["ListeComptesMO"],ComponmentList["AddATMMO"],ComponmentList["DelATMMO"],ComponmentList["CompteTxtBoxMO"],ComponmentList["LabelSommeMO"],ComponmentList["SommeNumericUpDownMO"],ComponmentList["LabelPercentMO"],ComponmentList["PercentNumericUpDownMO"],ComponmentList["MdpTxtBoxMO"],ComponmentList["ModifMdpMO"],ComponmentList["MakeOPMO"],ComponmentList["MakePlayerMO"],ComponmentList["HistoriqueMO"],ComponmentList["RetourMO"],ComponmentList["TerminateMO"],ComponmentList["IDATMMO"]})
- -- Menu Modif Mdp
- ComponmentList["AMdpTxtBoxMM"] = InterfaceApi.AddTextBox("AMdpTxtBoxMM",6,6,40,1,colors.yellow,colors.gray," Ancien Mdp : ","","*",{},nil)
- ComponmentList["NMdpTxtBoxMM"] = InterfaceApi.AddTextBox("NMdpTxtBoxMM",6,8,40,1,colors.yellow,colors.gray," Nouveau Mdp : ","","*",{},nil)
- ComponmentList["ChangerMdpMM"] = InterfaceApi.AddBoutton("ChangerMdpMM",6,10,18,1,colors.yellow,colors.green,"Changer le Mdp")
- ComponmentList["RetourMM"] = InterfaceApi.AddBoutton("RetourMM",29,10,17,1,colors.yellow,colors.red,"Retour")
- ComponmentList["MenuModifMDP"] = InterfaceApi.AddFormSkin("MenuModifMDP",1,1,width,height,colors.yellow,colors.black,colors.gray,"[HelixProject] Modifier votre Mot de passe :",false,{ComponmentList["AMdpTxtBoxMM"],ComponmentList["NMdpTxtBoxMM"],ComponmentList["ChangerMdpMM"],ComponmentList["RetourMM"]})
- -- Menu Clé
- ComponmentList["RetourMC"] = InterfaceApi.AddBoutton("RetourMC",40,17,9,1,colors.yellow,colors.red,"Retour")
- ComponmentList["CleMC"] = InterfaceApi.AddTextBox("CleMC",4,3,35,1,colors.yellow,colors.gray,"Cle : ","",nil,{},nil)
- ComponmentList["SommeNumericUpDownMC"] = InterfaceApi.AddNumericUpDown("SommeNumericUpDownMC",40,3,9,1,colors.yellow,colors.gray,0,100,0,1,nil)
- ComponmentList["GenererMC"] = InterfaceApi.AddBoutton("GenererMC",4,5,17,1,colors.yellow,colors.green,"Generer une Clé")
- ComponmentList["UtiliserMC"] = InterfaceApi.AddBoutton("UtiliserMC",22,5,17,1,colors.yellow,colors.green,"Utiliser une Clé")
- ComponmentList["MenuMC"] = InterfaceApi.AddFormSkin("MenuMC",1,1,width,height,colors.yellow,colors.black,colors.gray,"Géneration de clés de transactions",false,{ComponmentList["RetourMC"],ComponmentList["CleMC"],ComponmentList["SommeNumericUpDownMC"],ComponmentList["GenererMC"],ComponmentList["UtiliserMC"]})
- function HaveAModem()
- while true do
- local event, side = os.pullEvent("peripheral_detach")
- local f = peripheral.find("modem",function(name, object) return object.isWireless() end)
- if not f or #f == 0 then
- os.reboot()
- end
- end
- end
- function Deconnection()
- ComponmentList["CleMC"].Texte("")
- ComponmentList["SommeNumericUpDownMC"].Valeur(0)
- info = {Act="Deconnection"}
- infos = textutils.serialise(info)
- send(IDTerminal,infos)
- end
- function updateInfo()
- info = {Act="ActualiserC",Proprio=psd}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- shell.run("clear")
- while true do
- event = os.pullEvent()
- if event == "updateInfoReceive" then
- break
- end
- end
- end
- function updateInfoE()
- info = {Act="ActualiserE",Entreprise=nEntreprise}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- end
- function replace(texte,mot,apres)
- if string.find(texte,mot) then
- return string.gsub(texte, mot, apres)
- else
- return texte
- end
- end
- function MenuAff()
- ComponmentList["MenuConnection"].Hide()
- ComponmentList["MenuPrincipal"].Hide()
- ComponmentList["MenuTransfert"].Hide()
- ComponmentList["MenuEntreprise"].Hide()
- ComponmentList["MenuEntrepriseGestionMembre"].Hide()
- ComponmentList["MenuEntrepriseGestionTranfert"].Hide()
- ComponmentList["MenuOperateur"].Hide()
- ComponmentList["MenuModifMDP"].Hide()
- ComponmentList["MenuEntrepriseGestionPermissionMembre"].Hide()
- ComponmentList["MenuMC"].Hide()
- if Action == "Connection" then
- InterfaceApi.set(ComponmentList["PseudoTxtBoxMC"].Nom(),"Texte",psd)
- InterfaceApi.set(ComponmentList["MdpTxtBoxMC"].Nom(),"Texte",motdepasse)
- ComponmentList["MenuConnection"].Show()
- elseif Action == "MenuPrincipal" then
- InterfaceApi.set(ComponmentList["HistoriqueListBoxMP"].Nom(),"Liste",historique)
- ComponmentList["MenuPrincipal"].Texte("Bienvenue "..psd..", Votre Solde : "..solde)
- ComponmentList["MenuPrincipal"].Show()
- if statut == "OP" then
- ComponmentList["OpMP"].Visible(true)
- else
- ComponmentList["OpMP"].Visible(false)
- end
- ComponmentList["MenuPrincipal"].Refresh()
- elseif Action == "MenuTransfers" then
- InterfaceApi.set(ComponmentList["CompteTxtBoxMT"].Nom(),"Texte",nomTransfer)
- InterfaceApi.set(ComponmentList["SommeNumericUpDownMT"].Nom(),"Maximum",solde)
- InterfaceApi.set(ComponmentList["SommeNumericUpDownMT"].Nom(),"Valeur",sommeTransfer)
- InterfaceApi.set(ComponmentList["HistoriqueListBoxMT"].Nom(),"Liste",historique)
- ComponmentList["MenuTransfert"].Texte("Votre Solde : "..solde)
- ComponmentList["MenuTransfert"].Show()
- elseif Action == "MenuEntreprise" then
- InterfaceApi.set(ComponmentList["EntrepriseTxtBoxME"].Nom(),"Texte",nEntreprise)
- InterfaceApi.set(ComponmentList["EntrepriseListBoxME"].Nom(),"Liste",entreprises)
- ComponmentList["MenuEntreprise"].Texte("Panneau de gestion des entreprises")
- ComponmentList["MenuEntreprise"].Show()
- elseif Action == "MenuGestionMember" then
- InterfaceApi.set(ComponmentList["EntrepriseTxtBoxMEGM"].Nom(),"Texte",psdPlayer)
- InterfaceApi.set(ComponmentList["EntrepriseMembreListBoxMEGM"].Nom(),"Liste",membres)
- ComponmentList["MenuEntrepriseGestionMembre"].Texte("Membres de l'entreprise '"..nEntreprise.."'")
- ComponmentList["MenuEntrepriseGestionMembre"].Show()
- elseif Action == "MenuEntrepriseTransfers" then
- InterfaceApi.set(ComponmentList["HistoriqueListBoxMEGT"].Nom(),"Liste",ehistorique)
- InterfaceApi.set(ComponmentList["SommeNumericUpDownMEGT"].Nom(),"Maximum",math.max(solde,esolde))
- InterfaceApi.set(ComponmentList["SommeNumericUpDownMEGT"].Nom(),"Valeur",sommeTransferE)
- ComponmentList["MenuEntrepriseGestionTranfert"].Texte("Transfert d'Entreprise, solde : "..esolde)
- ComponmentList["MenuEntrepriseGestionTranfert"].Show()
- elseif Action == "MenuEntrepriseGestionPermissionMembre" then
- ComponmentList["MenuEntrepriseGestionPermissionMembre"].Texte("Permissions de "..psdPlayer)
- ComponmentList["MenuEntrepriseGestionPermissionMembre"].Show()
- elseif Action == "MenuOP" then
- InterfaceApi.set(ComponmentList["MdpTxtBoxMO"].Nom(),"Texte",nMdpMO)
- InterfaceApi.set(ComponmentList["CompteTxtBoxMO"].Nom(),"Texte",nCompteMO)
- InterfaceApi.set(ComponmentList["SommeNumericUpDownMO"].Nom(),"Valeur",nSommeMO)
- InterfaceApi.set(ComponmentList["PercentNumericUpDownMO"].Nom(),"Valeur",nPercentTransfersMO)
- InterfaceApi.set(ComponmentList["IDATMMO"].Nom(),"Valeur",nATMIDTransfersMO)
- ComponmentList["MenuOperateur"].Show()
- elseif Action == "MenuModifMdp" then
- InterfaceApi.set(ComponmentList["AMdpTxtBoxMM"].Nom(),"Texte",mAMdp)
- InterfaceApi.set(ComponmentList["NMdpTxtBoxMM"].Nom(),"Texte",mNMdp)
- ComponmentList["MenuModifMDP"].Show()
- elseif Action == "MenuCle" then
- ComponmentList["SommeNumericUpDownMC"].Maximum(tonumber(solde))
- ComponmentList["MenuMC"].Show()
- end
- end
- function startup()
- Deconnection()
- MenuAff()
- info = {Act="ListeComptes"}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- while true do
- event, p1, p2, p3, p4 = os.pullEvent()
- if event == "componment_click" then
- if p1 == ComponmentList["EffacerMC"].Nom() then
- psd=""
- motdepasse=""
- CompteValider=false
- historique={}
- solde=0
- sommeTransfer = 0
- nomTransfer = ""
- MenuAff()
- elseif p1 == ComponmentList["ValiderMC"].Nom() then
- info = {Act="Connection",Pseudo=psd,Mdp=motdepasse}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["ChangerMdpMM"].Nom() then
- info = {Act="ModifMdpPlayer",Pseudo=psd,AncienMdp=mAMdp,NouveauMdp=mNMdp}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["RetourMM"].Nom() then
- Action = "MenuPrincipal"
- MenuAff()
- mAMdp = ""
- mNMdp = ""
- elseif p1 == ComponmentList["HistoriqueMO"].Nom() then
- info = {Act="RecupHisto",Pseudo=nCompteMO}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["AddCompteMO"].Nom() then
- info = {Act="CreeCompte",Pseudo=nCompteMO}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["SupprCompteMO"].Nom() then
- info = {Act="DelCompte",Pseudo=nCompteMO}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["ModifMdpMO"].Nom() then
- info = {Act="ChangerMdp",Pseudo=nCompteMO,Mdp=nMdpMO}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["MakeOPMO"].Nom() then
- info = {Act="setOP",Pseudo=nCompteMO}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["MakePlayerMO"].Nom() then
- info = {Act="setPLAYER",Pseudo=nCompteMO}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["AddATMMO"].Nom() then
- info = {Act="AddATM",ATMID=nATMIDTransfersMO}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["DelATMMO"].Nom() then
- info = {Act="DelATM",ATMID=nATMIDTransfersMO}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["GiveMonneyMO"].Nom() then
- info = {Act="AddMonney",Pseudo=nCompteMO,Somme=nSommeMO}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["StealMonneyMO"].Nom() then
- info = {Act="StealMonney",Pseudo=nCompteMO,Somme=nSommeMO}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["AddPercentMO"].Nom() then
- info = {Act="AddPercent",Pourcent=nPercentTransfersMO}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["StealPercentMO"].Nom() then
- info = {Act="StealPercent",Pourcent=nPercentTransfersMO}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["ListeComptesMO"].Nom() then
- info = {Act="ListeComptesD"}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["RetourMO"].Nom() then
- Action = "MenuPrincipal"
- updateInfo()
- elseif p1 == ComponmentList["TerminateMO"].Nom() then
- Action="STOP"
- InterfaceApi.EventsStop()
- term.setBackgroundColor(colors.black)
- shell.run("clear")
- shell.run("shell")
- elseif p1 == ComponmentList["TransfertMP"].Nom() then
- Action = "MenuTransfers"
- updateInfo()
- elseif p1 == ComponmentList["ModifmdpMP"].Nom() then
- Action = "MenuModifMdp"
- MenuAff()
- elseif p1 == ComponmentList["EntreprisesMP"].Nom() then
- Action = "MenuEntreprise"
- updateInfo()
- elseif p1 == ComponmentList["RecupHistoriqueMP"].Nom() then
- info = {Act="RecupHistorique",Pseudo=psd}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["EffHistoriqueMP"].Nom() then
- info = {Act="EffHistorique",Pseudo=psd}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["OpMP"].Nom() then
- Action = "MenuOP"
- MenuAff()
- elseif p1 == ComponmentList["DeconnectionMP"].Nom() then
- Deconnection()
- psd = ""
- motdepasse = ""
- CompteValider=false
- historique = {}
- solde = 0
- Action="Connection"
- nomTransfer = ""
- sommeTransfer = 0
- nEntreprise = ""
- entreprises = {}
- psdPlayer = ""
- membres = {}
- esolde = 0
- ehistorique = {}
- sommeTransferE = 0
- statut = "PLAYER"
- nCompteMO = ""
- nSommeMO = 0
- nPercentTransfersMO = 0
- nATMIdMO = 0
- nATMIDTransfersMO = 0
- nMdpMO = ""
- mAMdp = ""
- mNMdp = ""
- MenuAff()
- elseif p1 == ComponmentList["ValiderMT"].Nom() then
- info = {Act="Transfer",Proprio=psd,Destinataire=nomTransfer,Somme=sommeTransfer}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["RetourMT"].Nom() then
- Action = "MenuPrincipal"
- updateInfo()
- elseif p1 == ComponmentList["EffacerMT"].Nom() then
- sommeTransfer= 0
- nomTransfer = ""
- updateInfo()
- elseif p1 == ComponmentList["CreeEntrepriseME"].Nom() then
- info = {Act="CreeEntreprise",Nom=nEntreprise,Proprio=psd}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["GererTransfertME"].Nom() then
- if nEntreprise == "" then
- term.setCursorPos(2,17)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- print("Entrer le nom d'une entreprise !")
- else
- info = {Act="EntrepriseTransfers",Entreprise=nEntreprise,Demandeur=psd}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- end
- elseif p1 == ComponmentList["SupprEntrepriseME"].Nom() then
- info = {Act="SupprEntreprise",Entreprise=nEntreprise,Demandeur=psd}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- elseif p1 == ComponmentList["GererMembresME"].Nom() then
- if nEntreprise == "" then
- term.setCursorPos(2,17)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- print("Entrer le nom d'une entreprise !")
- else
- info = {Act="AddMemberConnection",Entreprise=nEntreprise,Demandeur=psd}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- end
- elseif p1 == ComponmentList["RetourME"].Nom() then
- Action = "MenuPrincipal"
- updateInfo()
- elseif p1 == ComponmentList["EntrepriseAddMembreMEGM"].Nom() then
- if psdPlayer == "" then
- term.setCursorPos(2,17)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- print("Entrer le nom d'un compte !")
- else
- info = {Act="AddMember",Entreprise=nEntreprise,Demandeur=psd, pseudo=psdPlayer}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- end
- elseif p1 == ComponmentList["RetourMEGM"].Nom() then
- Action = "MenuEntreprise"
- MenuAff()
- elseif p1 == ComponmentList["EntreprisePermMembreMEGM"].Nom() then
- if psdPlayer == "" then
- term.setCursorPos(2,17)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- print("Entrer le nom d'un compte !")
- else
- info = {Act="PermMember",Entreprise=nEntreprise,Demandeur=psd, pseudo=psdPlayer}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- end
- elseif p1 == ComponmentList["EntrepriseSupprMembreMEGM"].Nom() then
- if psdPlayer == "" then
- term.setCursorPos(2,17)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- print("Entrer le nom d'un compte !")
- else
- info = {Act="DelMember",Entreprise=nEntreprise,Demandeur=psd, pseudo=psdPlayer}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- end
- elseif p1 == ComponmentList["EntrepriseCreditMEGT"].Nom() then
- if sommeTransferE+0 > solde+0 then
- sommeTransferE = solde+0
- end
- if sommeTransferE+0 < 0 then
- sommeTransferE = 0
- end
- ComponmentList["SommeNumericUpDownMEGT"].Valeur(sommeTransferE)
- info = {Act="TransferToEntreprise",Proprio=psd,Somme=sommeTransferE+0,Entreprise=nEntreprise}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- updateInfoE()
- elseif p1 == ComponmentList["EntrepriseDebitMEGT"].Nom() then
- if sommeTransferE+0 > esolde+0 then
- sommeTransferE = esolde+0
- end
- if sommeTransferE+0 < 0 then
- sommeTransferE = 0
- end
- ComponmentList["SommeNumericUpDownMEGT"].Valeur(sommeTransferE)
- info = {Act="RetraitToEntreprise",Proprio=psd,Somme=sommeTransferE+0,Entreprise=nEntreprise}
- infos = textutils.serialise(info)
- send(IDTerminal, infos)
- updateInfoE()
- elseif p1 == ComponmentList["RetourMEGT"].Nom() then
- Action = "MenuEntreprise"
- MenuAff()
- elseif p1 == ComponmentList["RetourMEGPM"].Nom() then
- Action = "MenuGestionMember"
- MenuAff()
- elseif p1 == ComponmentList["ValiderMEGPM"].Nom() then
- local nPerm = {DeleteEntrep=ComponmentList["PermDelEntreprise"].Checked(),Depos=ComponmentList["PermDepos"].Checked(),Retrait=ComponmentList["PermRetrait"].Checked(),DeleteMembre=ComponmentList["PermDelMembre"].Checked(),ModifPerm=ComponmentList["PermModif"].Checked(),AddMembre=ComponmentList["PermAddMembre"].Checked()}
- ninfo = {Act="ReplyPerm",permissions=nPerm,pseudo=psdPlayer,Demandeur=psd,Entreprise=nEntreprise}
- send(IDTerminal,textutils.serialise(ninfo))
- Action = "MenuGestionMember"
- MenuAff()
- elseif p1 == ComponmentList["CleMP"].Nom() then
- Action = "MenuCle"
- MenuAff()
- elseif p1 == ComponmentList["RetourMC"].Nom() then
- Action = "MenuPrincipal"
- updateInfo()
- MenuAff()
- elseif p1 == ComponmentList["GenererMC"].Nom() then
- if ComponmentList["SommeNumericUpDownMC"].Valeur() > 0 then
- if ComponmentList["SommeNumericUpDownMC"].Valeur() > tonumber(solde) then
- ComponmentList["SommeNumericUpDownMC"].Valeur(tonumber(solde))
- end
- send(IDTerminal,textutils.serialise({Act="GenKey",Somme=ComponmentList["SommeNumericUpDownMC"].Valeur(),psd=psd,mdp=motdepasse}))
- end
- elseif p1 == ComponmentList["UtiliserMC"].Nom() then
- if ComponmentList["SommeNumericUpDownMC"].Valeur() > 0 then
- send(IDTerminal,textutils.serialise({Act="UseKey",Somme=ComponmentList["SommeNumericUpDownMC"].Valeur(),psd=psd,Cle=ComponmentList["CleMC"].Texte()}))
- end
- end
- elseif event == "textbox_textchange" then
- if p1 == ComponmentList["PseudoTxtBoxMC"].Nom() then
- psd = p2
- elseif p1 == ComponmentList["MdpTxtBoxMC"].Nom() then
- motdepasse = p2
- elseif p1 == ComponmentList["AMdpTxtBoxMM"].Nom() then
- mAMdp = p2
- elseif p1 == ComponmentList["NMdpTxtBoxMM"].Nom() then
- mNMdp = p2
- elseif p1 == ComponmentList["CompteTxtBoxMO"].Nom() then
- nCompteMO = p2
- elseif p1 == ComponmentList["MdpTxtBoxMO"].Nom() then
- nMdpMO = p2
- elseif p1 == ComponmentList["CompteTxtBoxMT"].Nom() then
- nomTransfer = p2
- elseif p1 == ComponmentList["EntrepriseTxtBoxME"].Nom() then
- nEntreprise = p2
- elseif p1 == ComponmentList["EntrepriseTxtBoxMEGM"].Nom() then
- psdPlayer = p2
- end
- elseif event == "numericupdown_valuechange" then
- if p1 == ComponmentList["IDATMMO"].Nom() then
- nATMIDTransfersMO = p2
- elseif p1 == ComponmentList["SommeNumericUpDownMO"].Nom() then
- nSommeMO = p2
- elseif p1 == ComponmentList["PercentNumericUpDownMO"].Nom() then
- nPercentTransfersMO = p2
- elseif p1 == ComponmentList["SommeNumericUpDownMT"].Nom() then
- sommeTransfer = p2
- elseif p1 == ComponmentList["SommeNumericUpDownMEGT"].Nom() then
- sommeTransferE = p2
- end
- elseif event == "listbox_selecteditemchange" then
- if p1 == ComponmentList["EntrepriseListBoxME"].Nom() then
- if p3 ~= nil then
- ComponmentList["EntrepriseTxtBoxME"].Texte(p3)
- else
- ComponmentList["EntrepriseTxtBoxME"].Texte("")
- end
- os.queueEvent("textbox_textchange","EntrepriseTxtBoxME",ComponmentList["EntrepriseTxtBoxME"].Texte())
- elseif p1 == ComponmentList["EntrepriseMembreListBoxMEGM"].Nom() then
- if p3 ~= nil then
- ComponmentList["EntrepriseTxtBoxMEGM"].Texte(p3)
- else
- ComponmentList["EntrepriseTxtBoxMEGM"].Texte("")
- end
- os.queueEvent("textbox_textchange","EntrepriseTxtBoxMEGM",ComponmentList["EntrepriseTxtBoxMEGM"].Texte())
- end
- end
- end
- end
- function Reception()
- while true do
- id, message = NetSphere.receive()
- ID = id
- local haveNil = false
- if message == nil then
- haveNil = true
- else
- info = message
- end
- if haveNil == false then
- if ID == IDTerminal then
- infos = textutils.unserialise(info)
- if type(infos) == "nil" then
- else
- infos = textutils.unserialise(info)
- MenuAff()
- if infos.Act == "CompteValide" then
- CompteValider=true
- Action="MenuPrincipal"
- solde = infos.Solde
- statut = infos.Statut
- entreprises = textutils.unserialise(infos.Entreprises)
- historique = textutils.unserialise(infos.Historique)
- MenuAff()
- elseif infos.Act == "KeyGen" then
- ComponmentList["CleMC"].Texte(infos.Cle)
- elseif infos.Act == "ReplyHisto" then
- h = fs.open("HistoriqueJoueur","w")
- h.write(infos.Historique)
- h.close()
- ComponmentList["MenuOperateur"].Hide()
- shell.run("edit HistoriqueJoueur")
- fs.delete("HistoriqueJoueur")
- Action = "MenuOP"
- MenuAff()
- elseif infos.Act == "ListesDComptes" then
- Action = "ListeCompteRead"
- h = fs.open("ListeComptes","w")
- h.write(infos.Liste)
- h.close()
- ComponmentList["MenuOperateur"].Hide()
- shell.run("edit ListeComptes")
- fs.delete("ListeComptes")
- Action = "MenuOP"
- MenuAff()
- elseif infos.Act == "Erreur" then
- if infos.Menu == "MenuOP" then
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.red)
- term.setCursorPos(2,2)
- print(infos.Message)
- elseif infos.Menu == "Connection" then
- Action="Connection"
- MenuAff()
- term.setCursorPos(11,15)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- print(infos.Message)
- elseif infos.Menu == "MenuEntreprise" then
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.red)
- term.setCursorPos(2,17)
- print(infos.Message)
- elseif infos.Menu == "MenuCle" then
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.red)
- term.setCursorPos(11,15)
- print(infos.Message)
- end
- elseif infos.Act == "Succes" then
- if infos.Menu == "MenuOP" then
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.green)
- term.setCursorPos(2,2)
- print(infos.Message)
- elseif infos.Menu == "MenuCle" then
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.green)
- term.setCursorPos(11,15)
- print(infos.Message)
- end
- elseif infos.Act == "AncMdpInco" then
- term.setCursorPos(6,13)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- print("Ancien Mot de passe Incorrect !")
- elseif infos.Act == "TransferConnecAut" then
- Action = "MenuEntrepriseTransfers"
- ehistorique = infos.Historique
- esolde = infos.Solde
- MenuAff()
- elseif infos.Act == "RetraitEntrepRef" then
- term.setCursorPos(2,17)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- print("Retrait d'argent Interdit !")
- elseif infos.Act == "DeposEntrepRef" then
- term.setCursorPos(2,17)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- print("Depos d'argent Interdit !")
- elseif infos.Act == "CompteNValide" then
- CompteValider=false
- Action="Connection"
- term.setCursorPos(11,15)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- print("Mauvais Pseudo/Mot de passe !")
- elseif infos.Act == "ActualiserE" then
- esolde = infos.Solde
- ehistorique = textutils.unserialise(infos.Historique)
- os.queueEvent("updateInfoEReceive")
- MenuAff()
- elseif infos.Act == "NvmdpOk" then
- Action="MenuPrincipal"
- MenuAff()
- mAMdp = ""
- mNMdp = ""
- elseif infos.Act == "Actualiser" then
- solde = infos.Solde
- statut = infos.Statut
- entreprises = textutils.unserialise(infos.Entreprises)
- historique = textutils.unserialise(infos.Historique)
- os.queueEvent("updateInfoReceive")
- MenuAff()
- elseif infos.Act == "CompteNExist" then
- term.setCursorPos(2,17)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- print("Compte Inexistant !")
- elseif infos.Act == "AddMemberConnecAut" then
- Action="MenuGestionMember"
- membres = textutils.unserialise(infos.membres)
- MenuAff()
- elseif infos.Act == "DeleteEntrepRef" then
- term.setCursorPos(2,17)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- print("Supression Interdite !")
- elseif infos.Act == "EntrepriseNExist" then
- term.setCursorPos(2,17)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- print("L'entreprise n'existe pas !")
- elseif infos.Act == "ListeComptesTab" then
- ListeComptes = infos.Liste
- ListeEnt = infos.ListeEnt
- local LstA = {}
- for k,v in pairs(ListeComptes) do
- LstA[#LstA+1]=v
- end
- for k,v in pairs(ListeEnt) do
- LstA[#LstA+1]=v
- end
- ComponmentList["PseudoTxtBoxMC"].ListeMots(ListeComptes)
- ComponmentList["CompteTxtBoxMT"].ListeMots(LstA)
- ComponmentList["CompteTxtBoxMO"].ListeMots(ListeComptes)
- ComponmentList["EntrepriseTxtBoxMEGM"].ListeMots(ListeComptes)
- MenuAff()
- elseif infos.Act == "DelMemberConnecRef" then
- term.setCursorPos(2,17)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- print("Supression de membres Interdit !")
- elseif infos.Act == "PermMemberConnecRef" then
- term.setCursorPos(2,17)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- print("Modif Permissions Interdit !")
- elseif infos.Act == "DelMemberImpossible" then
- term.setCursorPos(2,17)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- print("Impossible de vous supprimer ! !")
- elseif infos.Act == "PermEdit" then
- local perm = textutils.unserialise(infos.permissions)
- ComponmentList["PermAddMembre"].Checked(perm.AddMembre)
- ComponmentList["PermDelMembre"].Checked(perm.DeleteMembre)
- ComponmentList["PermDelEntreprise"].Checked(perm.DeleteEntrep)
- ComponmentList["PermDepos"].Checked(perm.Depos)
- ComponmentList["PermRetrait"].Checked(perm.Retrait)
- ComponmentList["PermModif"].Checked(perm.ModifPerm)
- Action = "MenuEntrepriseGestionPermissionMembre"
- MenuAff()
- elseif infos.Act == "AddMemberConnecRef" then
- term.setCursorPos(2,17)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- print("Ajout de membres Interdit !")
- elseif infos.Act == "ErreurCreeEntreprise" then
- term.setCursorPos(2,17)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- print("Nom d'Entreprise déjà pris !")
- end
- end
- end
- end
- end
- end
- function diskEject()
- while true do
- event, side = os.pullEvent("disk")
- if event == "disk" then
- disk.eject(side)
- end
- end
- end
- function Veille()
- local timerId = os.startTimer(30)
- while true do
- event, p1 = os.pullEvent()
- if event == "key" or event == "char" or event == "mouse_click" or event == "mouse_drag" then
- os.cancelTimer(timerId)
- timerId = os.startTimer(30)
- else
- if event == "timer" then
- if p1 == timerId then
- os.shutdown()
- end
- end
- end
- end
- end
- parallel.waitForAll(startup,Reception,HaveAModem,diskEject,InterfaceApi.Events,Veille)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement