Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function datenersteller()
- local cookie = 0
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (cookie))
- fileHandle.close()
- local autocooker = 0
- local filePath = "auto"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (autocooker))
- fileHandle.close()
- local stop2 = 0
- local filePath = "stop"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (stop2))
- fileHandle.close()
- local price = 30
- local filePath = "preis"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (price))
- fileHandle.close()
- shell.run()
- end
- if not fs.exists("stop") then
- datenersteller()
- end
- if not fs.exists("save") then
- datenersteller()
- end
- if not fs.exists("auto") then
- datenersteller()
- end
- term.clear()
- local stop2 = 0
- local filePath = "stop"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (stop2))
- fileHandle.close()
- term.setCursorPos(1, 1)
- print("Restart or Confirm pls click on one: ")
- print("RESTART")
- term.setCursorPos(1, 4)
- print("Confirm")
- local event2, button, x, y = os.pullEvent("mouse_click")
- if event2 == "mouse_click" and x >= 1 and x <= 8 and y >= 2 and y <= 2 then
- shell.run("delete save")
- shell.run("delete auto")
- shell.run("delete preis")
- if not fs.exists("stop") then
- datenersteller()
- end
- if not fs.exists("save") then
- datenersteller()
- end
- if not fs.exists("auto") then
- datenersteller()
- end
- term.clear()
- term.setCursorPos(1, 1)
- local cookie = 0
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'r')
- cookie = textutils.unserialize (fileHandle.readAll())
- print("Cookies: ",cookie)
- fileHandle.close()
- term.setCursorPos(1, 2)
- local autocooker = 0
- local filePath = "auto"
- local fileHandle = fs.open (filePath, 'r')
- autocooker = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- print("AutoCookies pro Sec: ",autocooker)
- term.setCursorPos(25, 9)
- print("O")
- term.setCursorPos(51, 1)
- print("X")
- term.setCursorPos(2, 3)
- local price = 0
- local filePath = "preis"
- local fileHandle = fs.open (filePath, 'r')
- price = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- print("AutoClicker","[",price,"]")
- local function click()
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- if event == "mouse_click" and x >= 25 and x <= 25 and y >= 9 and y <= 9 then
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'r')
- cookie = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- cookie = cookie + 1
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (cookie))
- fileHandle.close()
- local autocooker = nil
- local filePath = "auto"
- local fileHandle = fs.open (filePath, 'r')
- autocooker = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- term.clear()
- term.setCursorPos(1,1)
- print("Cookies: ",cookie)
- term.setCursorPos(1, 2)
- print("AutoCookies pro Sec: ",autocooker)
- term.setCursorPos(25, 9)
- print("O")
- term.setCursorPos(51, 1)
- print("X")
- term.setCursorPos(2, 3)
- local price = 0
- local filePath = "preis"
- local fileHandle = fs.open (filePath, 'r')
- price = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- print("AutoClicker","[",price,"]")
- elseif event == "mouse_click" and x >= 51 and x <= 51 and y >= 1 and y <= 1 then
- term.clear()
- local stop2 = 1
- local filePath = "stop"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (stop2))
- fileHandle.close()
- term.setCursorPos(1, 1)
- print("Saving your cookies")
- term.setCursorPos(1, 1)
- sleep(0.5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Saving your cookies .")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Saving your cookies . .")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Saving your cookies . . .")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Saving your cookies . .")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Saving your cookies .")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Saving your cookies . .")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Saving your cookies . . .")
- local cookie = 0
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'r')
- cookie = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (cookie))
- fileHandle.close()
- sleep(0.3)
- term.clear()
- stp = shell.getRunningProgram()
- shell.run(stp)
- elseif event == "mouse_click" and x >= 2 and x <= 12 and y >= 3 and y <= 3 then
- local cookie = 0
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'r')
- cookie = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- local price = 0
- local filePath = "preis"
- local fileHandle = fs.open (filePath, 'r')
- price = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- if cookie >= price then
- local cookie = cookie - price
- price = price + 3
- local filePath = "preis"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (price))
- fileHandle.close()
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (cookie))
- fileHandle.close()
- term.clear()
- local autocooker = nil
- local filePath = "auto"
- local fileHandle = fs.open (filePath, 'r')
- autocooker = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- autocooker = autocooker + 0.1
- local filePath = "auto"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (autocooker))
- fileHandle.close()
- term.setCursorPos(1, 1)
- print("Cookies: ",cookie)
- print("AutoCookies pro Sec: ",autocooker)
- term.setCursorPos(25, 9)
- print("O")
- term.setCursorPos(51, 1)
- print("X")
- term.setCursorPos(2, 3)
- local price = 0
- local filePath = "preis"
- local fileHandle = fs.open (filePath, 'r')
- price = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- print("AutoClicker","[",price,"]")
- term.setCursorPos(1, 1)
- print("Cookies: ",cookie)
- elseif event == "mouse_click" and x >= 45 and x <= 51 and y >= 19 and y <= 19 then
- shell.run()
- end
- end
- end
- end
- local function autoclick()
- while true do
- local stop2 = 0
- local filePath = "stop"
- local fileHandle = fs.open (filePath, 'r')
- stop2 = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- local autocooker = nil
- local filePath = "auto"
- local fileHandle = fs.open (filePath, 'r')
- autocooker = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'r')
- cookie = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- if autocooker > 0 and stop2 == 0 then
- cookie = cookie + autocooker
- term.setCursorPos(1,1)
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (cookie))
- fileHandle.close()
- print("Cookies: ",cookie)
- print("AutoCookies pro Sec: ",autocooker)
- term.setCursorPos(25, 9)
- print("O")
- term.setCursorPos(51, 1)
- print("X")
- term.setCursorPos(2, 3)
- local price = 0
- local filePath = "preis"
- local fileHandle = fs.open (filePath, 'r')
- price = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- print("AutoClicker","[",price,"]")
- term.setCursorPos(1, 1)
- print("Cookies: ",cookie)
- sleep(1)
- else
- sleep(1)
- end
- end
- end
- parallel.waitForAny(click,autoclick)
- elseif event2 == "mouse_click" and x >= 1 and x <= 8 and y >= 4 and y <= 4 then
- term.clear()
- term.setCursorPos(1, 1)
- local cookie = 0
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'r')
- cookie = textutils.unserialize (fileHandle.readAll())
- print("Cookies: ",cookie)
- fileHandle.close()
- term.setCursorPos(1, 2)
- local autocooker = 0
- local filePath = "auto"
- local fileHandle = fs.open (filePath, 'r')
- autocooker = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- print("AutoCookies pro Sec: ",autocooker)
- term.setCursorPos(25, 9)
- print("O")
- term.setCursorPos(51, 1)
- print("X")
- term.setCursorPos(2, 3)
- local price = 0
- local filePath = "preis"
- local fileHandle = fs.open (filePath, 'r')
- price = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- print("AutoClicker","[",price,"]")
- local function click()
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- if event == "mouse_click" and x >= 25 and x <= 25 and y >= 9 and y <= 9 then
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'r')
- cookie = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- cookie = cookie + 1
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (cookie))
- fileHandle.close()
- local autocooker = nil
- local filePath = "auto"
- local fileHandle = fs.open (filePath, 'r')
- autocooker = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- term.clear()
- term.setCursorPos(1,1)
- print("Cookies: ",cookie)
- term.setCursorPos(1, 2)
- print("AutoCookies pro Sec: ",autocooker)
- term.setCursorPos(25, 9)
- print("O")
- term.setCursorPos(51, 1)
- print("X")
- term.setCursorPos(2, 3)
- local price = 0
- local filePath = "preis"
- local fileHandle = fs.open (filePath, 'r')
- price = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- print("AutoClicker","[",price,"]")
- elseif event == "mouse_click" and x >= 51 and x <= 51 and y >= 1 and y <= 1 then
- term.clear()
- local stop2 = 1
- local filePath = "stop"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (stop2))
- fileHandle.close()
- term.setCursorPos(1, 1)
- print("Saving your cookies")
- term.setCursorPos(1, 1)
- sleep(0.5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Saving your cookies .")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Saving your cookies . .")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Saving your cookies . . .")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Saving your cookies . .")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Saving your cookies .")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Saving your cookies . .")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Saving your cookies . . .")
- local cookie = 0
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'r')
- cookie = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (cookie))
- fileHandle.close()
- sleep(0.3)
- term.clear()
- error()
- elseif event == "mouse_click" and x >= 2 and x <= 12 and y >= 3 and y <= 3 then
- local cookie = 0
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'r')
- cookie = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- local price = 0
- local filePath = "preis"
- local fileHandle = fs.open (filePath, 'r')
- price = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- if cookie >= price then
- local cookie = cookie - price
- price = price + 3
- local filePath = "preis"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (price))
- fileHandle.close()
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (cookie))
- fileHandle.close()
- term.clear()
- local autocooker = nil
- local filePath = "auto"
- local fileHandle = fs.open (filePath, 'r')
- autocooker = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- autocooker = autocooker + 0.1
- local filePath = "auto"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (autocooker))
- fileHandle.close()
- term.setCursorPos(1, 1)
- print("Cookies: ",cookie)
- print("AutoCookies pro Sec: ",autocooker)
- term.setCursorPos(25, 9)
- print("O")
- term.setCursorPos(51, 1)
- print("X")
- term.setCursorPos(2, 3)
- local price = 0
- local filePath = "preis"
- local fileHandle = fs.open (filePath, 'r')
- price = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- print("AutoClicker","[",price,"]")
- term.setCursorPos(1, 1)
- print("Cookies: ",cookie)
- elseif event == "mouse_click" and x >= 45 and x <= 51 and y >= 19 and y <= 19 then
- shell.run()
- end
- end
- end
- end
- local function autoclick()
- while true do
- local stop2 = 0
- local filePath = "stop"
- local fileHandle = fs.open (filePath, 'r')
- stop2 = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- local autocooker = nil
- local filePath = "auto"
- local fileHandle = fs.open (filePath, 'r')
- autocooker = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'r')
- cookie = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- if autocooker > 0 and stop2 == 0 then
- cookie = cookie + autocooker
- term.setCursorPos(1,1)
- local filePath = "save"
- local fileHandle = fs.open (filePath, 'w')
- fileHandle.write (textutils.serialize (cookie))
- fileHandle.close()
- print("Cookies: ",cookie)
- print("AutoCookies pro Sec: ",autocooker)
- term.setCursorPos(25, 9)
- print("O")
- term.setCursorPos(51, 1)
- print("X")
- term.setCursorPos(2, 3)
- local price = 0
- local filePath = "preis"
- local fileHandle = fs.open (filePath, 'r')
- price = textutils.unserialize (fileHandle.readAll())
- fileHandle.close()
- print("AutoClicker","[",price,"]")
- term.setCursorPos(1, 1)
- print("Cookies: ",cookie)
- sleep(1)
- else
- sleep(1)
- end
- end
- end
- parallel.waitForAny(click,autoclick)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement