Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.setBackgroundColor(32768)
- term.clear()
- rs.setOutput("top", true)
- sleep(0.5)
- function calc_color(color)
- return math.pow(2, color - 1)
- end
- function msg(gap, line, color, groundb, text)
- term.setBackgroundColor(calc_color(groundb))
- term.setCursorPos(gap,line)
- term.setTextColor(calc_color(color))
- text = term.write(text)
- end
- function neueracc()
- term.setBackgroundColor(32768)
- term.clear()
- msg(14,02,04,16,"Neuen Account erstellen")
- msg(02,05,04,16,"Wie soll dein Name sein?")
- msg(01,06,04,16,"---------------------------------------------------")
- msg(02,07,06,16,"")
- local name = read()
- if fs.exists("benutzer/" ..name) == true then
- msg(02,07,15,16,"Dieser Name ist schon vergeben")
- sleep(1)
- neueracc()
- end
- msg(02,10,04,16,"Wie soll dein Passwort sein?")
- msg(01,11,04,16,"---------------------------------------------------")
- msg(02,12,06,16,"")
- local passwort1 = read("*")
- msg(02,15,04,16,"Bitte Passwort wiederholen!")
- msg(01,16,04,16,"---------------------------------------------------")
- msg(02,17,06,16,"")
- local passwort2 = read("*")
- if passwort1 ~= passwort2 then
- msg(02,17,15,16,"Das Passwort ist nicht gleich!")
- sleep(1)
- neueracc()
- else
- local file = fs.open("benutzer/" ..name.. "/", "w")
- file.write(passwort1)
- file.close()
- local file = fs.open("geld/" ..name.. "/", "w")
- file.write(0.0)
- file.close()
- end
- msg(02,17,06,16,"Account wird erstellt.")
- sleep(1)
- start()
- end
- function anmelden()
- term.setBackgroundColor(32768)
- term.clear()
- msg(14,02,04,16,"Mit Account anmelden")
- msg(02,05,04,16,"Wie lautet dein Name?")
- msg(01,06,04,16,"---------------------------------------------------")
- msg(02,07,06,16,"")
- name = read()
- if fs.exists("benutzer/" ..name) == false then
- msg(02,07,06,16,"Benutzername existiern nicht")
- sleep(1)
- start()
- end
- msg(02,10,04,16,"Wie lautet dein Passwort?")
- msg(01,11,04,16,"---------------------------------------------------")
- msg(02,12,06,16,"")
- local passwort = read("*")
- file = fs.open("benutzer/" ..name, "r")
- local inhalt = file.readLine()
- file.close()
- if passwort ~= inhalt then
- msg(02,12,06,16,"Passwort falsch")
- sleep(1)
- start()
- else
- hauptbildschirm()
- end
- end
- function hauptbildschirm()
- term.setBackgroundColor(32768)
- term.setCursorPos(1,1)
- term.clear()
- file = fs.open("geld/" ..name, "r")
- local dollar = file.readLine()
- file.close()
- msg(01,01,06,16,"< Account von "..name.." >") msg(36,01,06,16," > "..dollar.."$ ")
- msg(01,02,04,16,"---------------------------------------------------")
- msg(06,07,15,15," ") msg(29,07,15,15," ")
- msg(06,08,15,15," ") msg(29,08,15,15," ")
- msg(06,09,15,15," ") msg(29,09,15,15," ")
- msg(16,14,15,15," ")
- msg(16,15,15,15," ")
- msg(16,16,15,15," ")
- msg(08,08,01,15,"Geld einzahlen")
- msg(31,08,01,15,"Geld auszahlen")
- msg(20,15,01,15,"Items kaufen")
- local event, button, X, Y = os.pullEvent("mouse_click")
- if X >= 06 and X <= 23 and Y >= 07 and Y <= 09 then
- einzahlen()
- elseif X >= 29 and X <= 46 and Y >= 07 and Y <= 09 then
- setnull()
- elseif X >= 16 and X <= 36 and Y >= 14 and Y <= 16 then
- kaufen1()
- else
- hauptbildschirm()
- end
- end
- function einzahlen()
- term.setBackgroundColor(32768)
- term.clear()
- file = fs.open("geld/" ..name, "r")
- local dollar = file.readLine()
- file.close()
- msg(01,01,06,16,"< Account von "..name.." >") msg(36,01,06,16," > "..dollar.."$ ")
- msg(01,02,04,16,"---------------------------------------------------")
- msg(01,05,04,16,"Bitte jetzt Tungston Ore links einwerfen.")
- msg(01,06,04,16,"1x Tungston Ore = 42$")
- msg(01,08,04,16,"Danach hier bestätigen:")
- msg(01,09,04,16,"Bitte erst bestätigen, wenn das Tungston Ore auf")
- msg(01,10,04,16,"dem Monitor angezeigt wird, Sonst evlt Itemverlust.")
- msg(01,11,04,16,"---------------------------------------------------")
- msg(06,13,15,15," ") msg(29,13,15,15," ")
- msg(06,14,01,15," Einzahlen ") msg(29,14,01,15," Abbrechen ")
- msg(06,15,15,15," ") msg(29,15,15,15," ")
- rs.setOutput("top", false)
- sleep(0.5)
- local event, button, X, Y = os.pullEvent("mouse_click")
- if X >= 29 and X <= 46 and Y >= 13 and Y <= 15 then
- rs.setOutput("top", true)
- hauptbildschirm()
- elseif X >= 06 and X <= 23 and Y >= 13 and Y <= 15 then
- msg(01,17,06,16,"Einzahlung läuft, bitte warten.")
- y = 1
- rednet.open("bottom")
- rednet.send(7955,y)
- x, dollar2, z = rednet.receive()
- dollar = dollar + dollar2
- local file = fs.open("geld/" ..name.. "/", "w")
- file.write(dollar)
- file.close()
- rs.setOutput("top", true)
- hauptbildschirm()
- else
- einzahlen()
- end
- end
- function setnull()
- auszahlmenge = 0.0
- auszahlbetrag = 0.0
- auszahlen()
- end
- function auszahlen()
- term.setBackgroundColor(32768)
- term.clear()
- file = fs.open("geld/" ..name, "r")
- local dollar = file.readLine()
- file.close()
- dollar = tonumber(dollar)
- msg(01,01,06,16,"< Account von "..name.." >") msg(36,01,06,16," > "..dollar.."$ ")
- msg(01,02,04,16,"---------------------------------------------------")
- msg(01,03,04,16,"Die Auszahlung findet in Tungston Ore statt.")
- msg(01,04,04,16,"50$ = 1 Tungston Ore")
- msg(01,05,04,16,"---------------------------------------------------")
- msg(09,06,15,15," ") msg(23,06,15,15," ") msg(38,06,15,15," ")
- msg(09,07,01,15," + 1 ") msg(23,07,01,15," +10 ") msg(38,07,01,15," +64 ")
- msg(09,08,15,15," ") msg(23,08,15,15," ") msg(38,08,15,15," ")
- msg(09,10,15,15," ") msg(23,10,15,15," ") msg(38,10,15,15," ")
- msg(09,11,01,15," - 1 ") msg(23,11,01,15," -10 ") msg(38,11,01,15," -64 ")
- msg(09,12,15,15," ") msg(23,12,15,15," ") msg(38,12,15,15," ")
- msg(01,14,04,16,"Tungston Ore:") msg(14,14,06,16," "..auszahlmenge.." ")
- msg(23,14,04,16,"Abzug in Dollar:") msg(39,14,06,16," "..auszahlbetrag.." ")
- msg(06,16,15,15," ") msg(23,16,15,15," ")
- msg(06,17,01,15," Auszahlen ") msg(23,17,01,15," Abbrechen ")
- msg(06,18,15,15," ") msg(23,18,15,15," ")
- local event, button, X, Y = os.pullEvent("mouse_click")
- if X >= 09 and X <= 15 and Y >= 06 and Y <= 08 then
- auszahlmenge = auszahlmenge + 1
- auszahlbetrag = auszahlbetrag + 50
- auszahlen()
- elseif X >= 23 and X <= 29 and Y >= 06 and Y <= 08 then
- auszahlmenge = auszahlmenge + 10
- auszahlbetrag = auszahlbetrag + 500
- auszahlen()
- elseif X >= 38 and X <= 44 and Y >= 06 and Y <= 08 then
- auszahlmenge = auszahlmenge + 64
- auszahlbetrag = auszahlbetrag + 3200
- auszahlen()
- elseif X >= 09 and X <= 15 and Y >= 10 and Y <= 12 and auszahlmenge > 0 then
- auszahlmenge = auszahlmenge - 1
- auszahlbetrag = auszahlbetrag - 50
- auszahlen()
- elseif X >= 23 and X <= 29 and Y >= 10 and Y <= 12 and auszahlmenge >= 10 then
- auszahlmenge = auszahlmenge - 10
- auszahlbetrag = auszahlbetrag - 500
- auszahlen()
- elseif X >= 38 and X <= 44 and Y >= 10 and Y <= 12 and auszahlmenge >= 64 then
- auszahlmenge = auszahlmenge - 64
- auszahlbetrag = auszahlbetrag - 3200
- auszahlen()
- elseif X >= 06 and X <= 18 and Y >= 16 and Y <= 18 then
- if auszahlbetrag <= dollar then
- dollar = dollar - auszahlbetrag
- local file = fs.open("geld/" ..name.. "/", "w")
- file.write(dollar)
- file.close()
- rednet.open("bottom")
- rednet.send(7957,auszahlmenge)
- rs.setOutput("top", true)
- hauptbildschirm()
- else
- msg(01,19,06,16,"Du hast zu wenig Geld")
- sleep(1)
- auszahlen()
- end
- elseif X >= 23 and X <= 36 and Y >= 16 and Y <= 18 then
- rs.setOutput("top", true)
- hauptbildschirm()
- else
- auszahlen()
- end
- end
- local m3 = 0
- local m4 = 0
- local m5 = 0
- local m6 = 0
- local m7 = 0
- local m8 = 0
- local m9 = 0
- local m10 = 0
- local m11 = 0
- local m12 = 0
- local m13 = 0
- local m14 = 0
- local m15 = 0
- local m16 = 0
- local m17 = 0
- function kaufen1()
- term.setBackgroundColor(32768)
- term.clear()
- file = fs.open("geld/" ..name, "r")
- local dollar = file.readLine()
- file.close()
- msg(01,01,06,16,"< Account von "..name.." >") msg(36,01,06,16," > "..dollar.."$ ")
- msg(01,02,04,16,"---------------------------------------------------")
- msg(01,03,04,16,"| HV Solar Panel") msg(51,03,04,16,"|")
- msg(01,04,04,16,"| MV Solar Panel") msg(51,04,04,16,"|")
- msg(01,05,04,16,"| LV Solar Panel") msg(51,05,04,16,"|")
- msg(01,06,04,16,"- ME Controller") msg(51,06,04,16,"-")
- msg(01,07,04,16,"| ME Drive") msg(51,07,04,16,"|")
- msg(01,08,04,16,"| ME Access Terminal") msg(51,08,04,16,"|")
- msg(01,09,04,16,"| ME Crafting Terminal") msg(51,09,04,16,"|")
- msg(01,10,04,16,"- ME Cable") msg(51,10,04,16,"-")
- msg(01,11,04,16,"| ME Export Bus") msg(51,11,04,16,"|")
- msg(01,12,04,16,"| ME Import Bus") msg(51,12,04,16,"|")
- msg(01,13,04,16,"| ME Storage Bus") msg(51,13,04,16,"|")
- msg(01,14,04,16,"- Energy Tesseract") msg(51,14,04,16,"-")
- msg(01,15,04,16,"| Quarry") msg(51,15,04,16,"|")
- msg(01,16,04,16,"| Overclocker Upgrade") msg(51,16,04,16,"|")
- msg(01,17,04,16,"| Glass Fibre Cable") msg(51,17,04,16,"|")
- msg(01,18,04,16,"---------------------------------------------------")
- msg(01,19,01,15," Kaufen ") msg(11,19,01,15," Abbrechen ") msg(24,19,04,16,"Betrag:")
- msg(44,19,01,15," Logout ")
- for i = 3,17 do
- msg(40,i,01,15," + ")
- end
- for i = 3,17 do
- msg(44,i,04,16," ")
- end
- for i = 3,17 do
- msg(47,i,01,15," - ")
- end
- kaufen2()
- end
- function kaufen2()
- local event, button, X, Y = os.pullEvent("mouse_click")
- for i = 3,17 do
- if X >= 40 and X <= 42 and Y == i then
- m3 = m3 + 1
- msg(44,i,04,16,""..m1.."")
- break
- end
- if X >= 47 and X <= 49 and Y == i then
- m1 = m1 - 1
- msg(44,i,04,16,""..m1.."")
- break
- end
- end
- kaufen2()
- end
- function start()
- term.setBackgroundColor(32768)
- term.clear()
- msg(14,03,04,16,"Neuen Account erstellen")
- msg(01,04,04,16,"---------------------------------------------------")
- msg(15,05,15,15," ")
- msg(15,06,15,15," ") msg(20,06,01,15,"klick hier")
- msg(15,07,15,15," ")
- msg(01,08,04,16,"---------------------------------------------------")
- msg(15,12,04,16,"Mit Account anmelden")
- msg(01,13,04,16,"---------------------------------------------------")
- msg(15,14,15,15," ")
- msg(15,15,15,15," ") msg(20,15,01,15,"klick hier")
- msg(15,16,15,15," ")
- msg(01,17,04,16,"---------------------------------------------------")
- msg(01,20,04,16," ")
- local event, button, X, Y = os.pullEvent("mouse_click")
- if X >= 15 and X <= 34 and Y >= 05 and Y <= 07 then
- neueracc()
- elseif X >= 15 and X <= 34 and Y >= 14 and Y <= 16 then
- anmelden()
- else
- start()
- end
- end
- start()
Add Comment
Please, Sign In to add comment