Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/sensor")
- side = "top"
- key = theKey
- local s = sensor.wrap(side)
- local t = s.getTargets()
- local d = s.getTargetDetails("-2,-1,1")
- local coins = 0
- function cut()
- sleep(3)
- shell.run("clear")
- sleep(1)
- end
- function start()
- shell.run("clear")
- sleep(0.2)
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- shell.run("clear")
- sleep(0.2)
- print(" Willkommen in der Macebank Manarola")
- print(" Mit W zugriff aufs Terminal")
- TerminalStart()
- end
- function TerminalStart()
- local evt, key = os.pullEvent("char")
- key = string.lower(key)
- if key == "w" then
- cut()
- print(" Bitte waehle eine Aktion:\n [L]Lade Account\n [N]Erstelle Neuen Account")
- LoadNew()
- else
- end
- end
- function LoadNew()
- local evt, key1 = os.pullEvent("char")
- key1 = string.lower(key1)
- if key1 == "l" then
- load()
- elseif key1 == "n" then
- new()
- else
- end
- end
- function auslesen()
- for k,v in pairs(d.Slots) do
- if (v.Name == "Industrial Credit") then
- coins = coins + v.Size
- print(coins .. " Muenzen in der Kiste")
- if coins >= einz then
- while iso ~= 0 do
- shell.run("clear")
- rs.setBundledOutput("back", colors.blue)
- sleep(2)
- iso = iso - 1
- print(iso .. " Industrial Credits noch")
- rs.setBundledOutput("back", 0)
- sleep(0.2)
- end
- if c == nil then
- c = 0
- else
- print(c)
- sleep(2)
- shell.run("clear")
- end
- load = einz + c
- wfile1 = fs.open(tostring(user), "w")
- wfile1.writeLine(tostring(user))
- wfile1.writeLine(tostring(pass))
- wfile1.writeLine(tostring(load))
- wfile1.close()
- print(c2 .. "$ wurde eingezahlt = " .. einz .. " Industrial Credits")
- sleep(2)
- print("Beehren Sie uns bald wieder")
- sleep(2)
- cut()
- else
- print("Nicht genug Industrial Credits in der Kiste")
- sleep(2)
- end
- else
- print("falsche Items in der Kiste")
- sleep(2)
- end
- end
- end
- function Auszahlen()
- print("Wie viel wollen Sie Auszahlen?:")
- ausz = io.read()
- count = ausz
- if c < count then
- print("Nicht genug Industrial Coins auf deinem Konto")
- sleep(2)
- else
- shell.run("clear")
- rs.setBundledOutput("back", colors.red)
- while count ~= 0 do
- print( count .. " Industrial Coins werden noch Ausgezahlt")
- sleep(2)
- shell.run("clear")
- count = count - 1
- end
- print("Industrial Coins wurden ausgezahlt. Bitte auf den rechten Knopf drücken.!")
- print("Beehren Sie uns bald wieder")
- sleep(2)
- mon = c - ausz
- sfile1 = fs.open(user, "w")
- sfile1.writeLine(user)
- sfile1.writeLine(pass)
- sfile1.writeLine(mon)
- sfile1.close()
- shell.run("clear")
- sleep(10)
- end
- end
- function Einzahlen()
- print(" Wie viel wollen Sie einzahlen? In Industrial Credits angeben?")
- print(" 1 IC2 Industrial Muenze entspricht 50$ ")
- print(" Maximal 200 IC2 Industrial Credits anlegbar = 10.000$")
- einz = tonumber(read())
- if einz >= 200 then
- print("Zu viele Muenzen bitte weniger waehlen")
- else
- print("Muenzen jetzt in die Obsidian Pipe werfen")
- print("Wirklich Industrial Credits einzahlen ? [J]|[N]")
- local evt, key3 = os.pullEvent("char")
- key3 = string.lower(key3)
- if key3 == "j" then
- number = einz
- iso = number
- c2 = iso*50
- auslesen()
- elseif key3 == "n" then
- print("Auf Wiedersehen")
- sleep(2)
- cut()
- else
- end
- end
- end
- function Kontostand()
- print(" Ihr Kontostand beträgt ".. tostring(c) .. " Industrial Coins")
- sleep(2)
- end
- function load()
- shell.run("clear")
- print(" Bitte Usernamen eingeben: ")
- user = io.read()
- dem = fs.exists(user)
- if dem == true then
- rfile = fs.open(user, "r")
- a = rfile.readLine(1)
- b = rfile.readLine(2)
- c = rfile.readLine(3)
- rfile.close()
- if user == a then
- print(" Bitte Password eingeben")
- pass = read("*")
- if pass == b then
- print("Password Akzeptiert")
- cut()
- print(" Welche Aktion wollen Sie ausfuehren?")
- print(" [e]Einzahlen\n [a]Auszahlen\n [k]Kontostand")
- local evt, key2 = os.pullEvent("char")
- key2 = string.lower(key2)
- if key2 == "e" then
- Einzahlen()
- elseif key2 == "a" then
- Auszahlen()
- elseif key2 == "k" then
- Kontostand()
- else
- end
- else
- print(" Falsches Passwort")
- sleep(2)
- end
- else
- print(" Falscher Username")
- sleep(2)
- end
- elseif dem == false then
- print(" Der Account " .. user .. " exsistiert nicht")
- sleep(2)
- end
- end
- function new()
- print(" Namen Eingeben :")
- Name = io.read()
- if fs.exists(Name) then
- print(" Account existiert bereits")
- print(" Bitte waehlen Sie einen anderen Accountnamen")
- else
- print("Name " .. Name .. " gewaehlt")
- sleep(2)
- cut()
- print("Password Eingeben")
- Password = read("*")
- cut()
- acc = {}
- acc.Name = {}
- acc.Name.Name = Name
- acc.Name.Password = Password
- acc.Name.Muenzen = 0
- file = fs.open(Name, "w")
- file.writeLine(acc.Name.Name)
- file.writeLine(acc.Name.Password)
- file.writeLine(acc.Name.Muenzen)
- file.close()
- print(" Done!")
- print(" Name: " .. acc.Name.Name .. " Account erstellt.")
- print(" Industrial Coins : " .. acc.Name.Muenzen )
- sleep(2)
- cut()
- end
- end
- while true do
- start()
- end
Add Comment
Please, Sign In to add comment