Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- [BANKSYSREG 1.0]
- --Script Made by Muzze[Muzze77]
- --For install instrtuctions ask at skype / steam (xxmbaccxx)
- shell.run("clear")
- os.loadAPI("ocs/apis/sensor")
- sen = sensor.wrap("right")
- function getChest()
- sx = sen.getTargets()
- for h, i in pairs(sx) do
- if i.Name == "Diamond Chest" then
- x = i.Position.X
- y = i.Position.Y
- z = i.Position.Z
- df = x .. "," .. y .. "," .. z
- return df
- end
- end
- end
- target = getChest()
- sLog = fs.open("/login", "w")
- sLog.writeLine(false)
- sLog.close()
- p = peripheral.wrap("bottom")
- icoins = 30186
- bcoins = p.getItemIdentifierIDFor(icoins,0)
- function readName()
- rLog2 = fs.open("/login", "r")
- rName = rLog2.readLine(1)
- rLog2.close()
- return rName
- end
- function start()
- shell.run("clear")
- term.setBackgroundColor(colors.white)
- shell.run("clear")
- term.setTextColor(colors.blue)
- term.setCursorPos(5,6)
- print("[X] Abheben ")
- term.setCursorPos(5,8)
- print("[X] Einzahlen")
- term.setCursorPos(1,1)
- end
- start()
- function root()
- shell.run("clear")
- term.setBackgroundColor(colors.white)
- shell.run("clear")
- term.setTextColor(colors.blue)
- term.setCursorPos(5,6)
- print("[X] Abheben ")
- term.setCursorPos(5,8)
- print("[X] Einzahlen")
- reading()
- uname = readName()
- if uname == false then
- choose()
- else
- getInts()
- end
- end
- function pos(x1, y1)
- term.setCursorPos(x1,y1)
- end
- function anmelden()
- shell.run("clear")
- reading()
- pos(5,6)
- print("Bitte Namen eingeben:")
- pos(5,8)
- print("______________")
- pos(7,8)
- name2 = io.read()
- shell.run("clear")
- if fs.exists("/saves/" .. name2) == false then
- pos(2,2)
- print("Name existiert nicht")
- sleep(2)
- choose()
- else
- r2 = fs.open("/saves/" .. name2, "r")
- baName = r2.readLine(1)
- rpw2 = r2.readLine(2)
- rcoin = r2.readLine(3)
- r2.close()
- shell.run("clear")
- pos(5,6)
- print("Password eingeben")
- pos(5,8)
- print("______________")
- pos(7,8)
- pw = read("*")
- if pw == rpw2 then
- sLog = fs.open("/login", "w")
- sLog.writeLine(name2)
- sLog.close()
- getInts()
- else
- pos(2,2)
- sLog = fs.open("/login", "w")
- sLog.writeLine(false)
- sLog.close()
- print("Falsches Password")
- sleep(2)
- choose()
- end
- end
- end
- function regis()
- shell.run("clear")
- reading()
- pos(5,6)
- print("Bitte Namen waehlen:")
- pos(5,8)
- print("______________")
- pos(7,8)
- name = io.read()
- fs.makeDir("/saves")
- if fs.exists("/saves/" .. name) == true then
- pos(2,2)
- print("Username exetiert bereits")
- sleep(4)
- choose()
- else
- cIn = fs.open("/saves/" .. name, "w")
- shell.run("clear")
- pos(5,6)
- print("Waehle dein Password")
- pos(5,8)
- print("______________")
- pos(7,8)
- pw = read("*")
- cCoin = 0
- cIn.writeLine(name)
- cIn.writeLine(pw)
- cIn.writeLine(cCoin)
- cIn.close()
- sLog = fs.open("/login", "w")
- sLog.writeLine(name)
- sLog.close()
- getInts()
- end
- end
- function get()
- reading()
- shell.run("clear")
- rLog = fs.open("/login", "r")
- rName = rLog.readLine(1)
- rLog.close()
- if rName == nil or rName == false then
- choose()
- else
- r1 = fs.open("/saves/" ..rName, "r")
- bdg = r1.readLine(1)
- rpw = r1.readLine(2)
- coins = r1.readLine(3)
- r1.close()
- pre = count()
- pre = tonumber(pre)
- term.setCursorPos(5,10)
- print("Aktuelle Coins: " .. pre)
- term.setCursorPos(5,11)
- print("Wie viele abheben? ")
- term.setCursorPos(24,11)
- e = io.read()
- e = tonumber(e)
- pre = tonumber(pre)
- coins = tonumber(coins)
- if e < pre and coins < pre then
- if e > coins then
- term.setCursorPos(2,2)
- print("Nicht genug auf deinem Konto")
- sleep(4)
- term.clearLine(2)
- getInts()
- else
- p.makeRequest(bcoins,e)
- term.setCursorPos(2,2)
- term.clearLine(2)
- print(e .. " Coints abgehoben")
- s1 = fs.open("/saves/" .. rName, "w")
- s1.writeLine(name)
- s1.writeLine(rpw)
- s1.writeLine(coins - e)
- s1.close()
- end
- else
- term.setCursorPos(2,2)
- print("Nicht genug im Lager")
- sleep(4)
- term.clearLine(2)
- getInts()
- end
- sleep(4)
- root()
- end
- end
- function give()
- shell.run("clear")
- reading()
- name = readName()
- --loadInts
- r1 = fs.open("/saves/" ..name, "r")
- bdg = r1.readLine(1)
- rpw = r1.readLine(2)
- coins = r1.readLine(3)
- r1.close()
- if name == nil then
- else
- term.setCursorPos(2,2)
- print("Bitte einwerfen wird gezaehlt")
- size2 = count()
- term.setCursorPos(5,10)
- print("Aktuell Coins: " .. size2)
- evt = os.pullEvent("redstone")
- if rs.getInput("top") == true then
- term.clearLine(2)
- pos(2,2)
- print("Enter drücken zum fortfahren")
- evt, key = os.pullEvent("key")
- if key == 28 then
- shell.run("clear")
- size3 = count()
- term.setCursorPos(5,11)
- print("Gemessene Coins: " .. size3)
- gem = size3-size2
- term.setCursorPos(5,12)
- print("Differenz: " .. gem)
- s1 = fs.open("/saves/" .. name, "w")
- s1.writeLine(name)
- s1.writeLine(rpw)
- s1.writeLine(coins + gem)
- s1.close()
- sleep(4)
- root()
- else
- getInts()
- end
- end
- end
- end
- function count()
- a = 0
- s = sen.getTargetDetails(target)
- for v, k in pairs(s.Slots) do
- if k.Name == "Industrial Credit" then
- f = k.Size
- f = tonumber(f)
- if a == 0 then
- a = f
- else
- a = a + f
- end
- end
- end
- return a
- end
- function getInts()
- rLog2 = fs.open("/login", "r")
- rName = rLog2.readLine(1)
- rLog2.close()
- shell.run("clear")
- rn = fs.open("/saves/" .. rName, "r")
- abc = rn.readLine(1)
- rpw = rn.readLine(2)
- coins = rn.readLine(3)
- rn.close()
- term.setBackgroundColor(colors.white)
- shell.run("clear")
- term.setTextColor(colors.blue)
- reading()
- pos(1,1)
- pos(5,3)
- print("Angemeldet als " .. rName)
- pos(5, 5)
- print("[A] Abheben")
- pos(5,7)
- print("[E] Einzahlen")
- pos(40,19)
- print("[X] Exit")
- pos(5,9)
- print("Deine Coins: " .. coins)
- evt, key = os.pullEvent("char")
- if key == "A" or key == "a" then
- get()
- elseif key == "E" or key == "e" then
- give()
- elseif key == "X" or key == "x" then
- sLog2 = fs.open("/login", "w")
- sLog2.writeLine(false)
- sLog2.close()
- shell.run("clear")
- pos(2,2)
- print("Goodbye " .. rName .. "!")
- sleep(4)
- choose()
- end
- root()
- end
- function choose()
- shell.run("clear")
- term.setCursorPos(5,6)
- print("[A] Anmelden ")
- term.setCursorPos(5,8)
- print("[R] Registrieren")
- evt,key = os.pullEvent("char")
- if key == "a" or key == "A" then
- anmelden()
- elseif key == "r" or key == "R" then
- regis()
- elseif key == "x" or key == "X" then
- --TESTSCRIPT
- end
- end
- function reading()
- size = count()
- term.setCursorPos(5,19)
- term.clearLine(19)
- print("Coins: " .. size)
- sleep(0.1)
- end
- while true do
- pos(1,1)
- parallel.waitForAll(choose,reading)
- sleep(0.1)
- end
Add Comment
Please, Sign In to add comment