Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(fs.exists("/.CookieCSave"))then
- f = fs.open("/.CookieCSave", "r")
- cookies = f.readLine()
- cpc = f.readLine()
- superclick = f.readLine()
- SuperCPrice = f.readLine()
- megaclick = f.readLine()
- MegaCPrice = f.readLine()
- f.close()
- else
- print "Createing Cookie Save..."
- sleep(2)
- f = fs.open("/.CookieCSave", "w")
- f.writeLine("0") --Cookies
- f.writeLine("1") --Cpc
- f.writeLine("0") --Lvl of item 1
- f.writeLine("200") -- Price Of Item 1
- f.writeLine("0") -- Lvl of item 2
- f.writeLine("10000") -- Price Of Item 2
- f.close()
- cookies = 0
- pc = 1
- superclick = 0
- SuperCPrice = 200
- magaclick = 0
- MegaCPrice = 10000
- print "Reboot Required"
- sleep(1)
- os.reboot()
- end
- main = true
- inShop = false
- SuperC = false
- function cp(x,y)
- term.setCursorPos(x,y)
- end
- function bg(color)
- term.setBackgroundColor(color)
- end
- function tc(color)
- term.setTextColor(color)
- end
- function cl()
- term.clearLine()
- end
- function clear()
- bg(colors.black)
- cp(1,1)
- term.clear()
- end
- function clearCol(col)
- bg(col)
- cp(1,1)
- term.clear()
- end
- function draw()
- bg(colors.lightBlue)
- term.clear()
- cookie = paintutils.loadImage("ccpics/cookie")
- paintutils.drawImage(cookie, 15, 3)
- bg(colors.gray)
- cp(21,2)
- print "::Cookies::"
- cp(25,3)
- print(cookies)
- bg(colors.green)
- cp(1,1)
- print "Shop"
- bg(colors.brown)
- cp(13, 18)
- print("Cookies Per Click(cpc): "..cpc)
- bg(colors.green)
- cp(48, 1)
- print "Save"
- bg(colors.lightBlue)
- cp(40, 17)
- print "By Lewisk3"
- end
- function menu()
- bg(colors.gray)
- term.clear()
- cp(1,2)
- print "--------------------Cookie-Shop--------------------" -- 17Long
- print("SuperClick: x2 mc LVL:"..superclick.." Price: "..SuperCPrice)
- --print("AutoClicker +1 cps LVL:"..autoclick.." Price: "..aClickPrice)
- print("MegaClick: x4 mc LVL: "..megaclick.." Price: "..MegaCPrice)
- cp(51, 1)
- bg(colors.red)
- print "X"
- bg(colors.gray)
- end
- function clicker()
- while main == true do
- local event, button, x, y = os.pullEvent("mouse_click")
- if(x >= 18 and x <= 33 and y >= 4 and y <= 17 and button == 1)then
- cookies = cookies + cpc
- bg(colors.gray)
- draw()
- elseif(x >= 1 and x <=4 and y == 1 and button == 1)then
- menu()
- inShop = true
- main = false
- CShop()
- elseif(x >= 48 and x <= 51 and y == 1 and button == 1)then
- f = fs.open("/.CookieCSave", "w")
- f.writeLine(cookies)
- f.writeLine(cpc)
- f.writeLine(superclick)
- f.writeLine(SuperCPrice)
- f.writeLine(megaclick)
- f.writeLine(MegaCPrice)
- f.close()
- end
- end
- end
- function CShop()
- while inShop == true do
- local event2, button2, x2, y2 = os.pullEvent("mouse_click")
- if(y2 == 3 and button2 == 1 and tonumber(cookies) >= tonumber(SuperCPrice))then
- superclick = superclick + 1
- cookies = cookies - SuperCPrice
- SuperCPrice = SuperCPrice * 4
- cpc = cpc * 2
- inShop = false
- main = true
- draw()
- return clicker()
- end
- if(y2 == 4 and button2 == 1 and tonumber(cookies) >= tonumber(MegaCPrice))then
- megaclick = megaclick + 1
- cookies = cookies - MegaCPrice
- MegaCPrice = MegaCPrice * 6
- cpc = cpc * 4
- inShop = false
- main = true
- draw()
- return clicker()
- end
- if(x2 == 51 and y2 == 1 and button2 == 1)then
- inShop = false
- main = true
- draw()
- return clicker()
- end
- end
- end
- draw()
- clicker()
Advertisement
Add Comment
Please, Sign In to add comment