Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Cookie Clicker// Created by Magus / Lodkagan
- // Cookie Clicker v2.4.0
- // ===== CONFIG =====
- int MaxBuyCount = 50
- bool HideChip = true
- bool DebugMode = false
- // ===== CREATE INPUT/OUTPUTS =====
- input wirelink EGP
- // ===== VARIABLES =====
- int Cookie = 0
- int CpS = 0
- int CookieMul = 1.0
- int Cursor = 0
- int Grandma = 0
- int Farm = 0
- int Factory = 0
- int Mine = 0
- int Shipment = 0
- int AlchemyLab = 0
- int Portal = 0
- int TimeMachine = 0
- int Antimatter = 0
- int Prism = 0
- int CursorUpg = 0
- int GrandmaUpg = 0
- int FarmUpg = 0
- int FactoryUpg = 0
- int MineUpg = 0
- int ShipmentUpg = 0
- int AlchemyLabUpg = 0
- int PortalUpg = 0
- int TimeMachineUpg = 0
- int AntimatterUpg = 0
- int PrismUpg = 0
- int CursorMul = 1
- int GrandmaMul = 1
- int FarmMul = 1
- int FactoryMul = 1
- int MineMul = 1
- int ShipmentMul = 1
- int AlchemyLabMul = 1
- int PortalMul = 1
- int TimeMachineMul = 1
- int AntimatterMul = 1
- int PrismMul = 1
- // ===== EGP =====
- EGP:egpClear()
- // Cookies Counter
- EGP:egpText(1,"Cookie: " + Cookie, vec2(50,150))
- EGP:egpColor(1, color(255,255,255) )
- // Cookies Multiply
- EGP:egpText(2,"Mul: " + CookieMul, vec2(50,170))
- EGP:egpColor(2, color(255,255,255) )
- // Cookies!!!!!!!!!!!!!!!!!!!!!!
- EGP:egpCircle(3,vec2(80,120), vec2(30,30))
- EGP:egpColor(3, color(139,69,19) )
- // Cookies (CpS)
- EGP:egpText(4,"CpS: " + CpS*10, vec2(50,70))
- EGP:egpColor(4, color(255,255,255) )
- // TitleBar
- EGP:egpText(5,"Cookie Clicker by [Lodkagan/Magus]", vec2(120,0))
- EGP:egpColor(5, color(255,0,0) )
- // ===== Help =====
- // Help gain Cookies
- EGP:egpTextLayout(6,"- Press E on the cookie to bake a cookie!!!\n"+
- "- type 'buy name' to buy something ", vec2(10,370), vec2(502,512))
- EGP:egpColor(6, color(255,255,255) )
- // ===== Buildings =====
- // Cursor
- EGP:egpText(20,"Cursor: " + Cursor + " (" + ceil(15*1.15^Cursor) + ")", vec2(250,120))
- EGP:egpColor(20, color(255,255,255) )
- // Grandma
- EGP:egpText(21,"Grandma: " + Grandma + " (" + ceil(100*1.15^Grandma) + ")", vec2(250,140))
- EGP:egpColor(21, color(255,255,255) )
- // Farm
- EGP:egpText(22,"Farm: " + Farm + " (" + ceil(500*1.15^Farm) + ")", vec2(250,160))
- EGP:egpColor(22, color(255,255,255) )
- // Factory
- EGP:egpText(23,"Factory: " + Factory + " (" + ceil(3000*1.15^Factory) + ")", vec2(250,180))
- EGP:egpColor(23, color(255,255,255) )
- // Mine
- EGP:egpText(24,"Mine: " + Mine + " (" + ceil(10000*1.15^Mine) + ")", vec2(250,200))
- EGP:egpColor(24, color(255,255,255) )
- // Shipment
- EGP:egpText(25,"Shipment: " + Shipment + " (" + ceil(40000*1.15^Shipment) + ")", vec2(250,220))
- EGP:egpColor(25, color(255,255,255) )
- // AlchemyLab
- EGP:egpText(26,"AlchemyLab: " + AlchemyLab + " (" + ceil(200000*1.15^AlchemyLab) + ")", vec2(250,240))
- EGP:egpColor(26, color(255,255,255) )
- // Portal
- EGP:egpText(27,"Portal: " + Portal + " (" + ceil(1666666*1.15^Portal) + ")", vec2(250,260))
- EGP:egpColor(27, color(255,255,255) )
- // TimeMachine
- EGP:egpText(28,"TimeMachine: " + TimeMachine + " (" + ceil(123456789*1.15^TimeMachine) + ")", vec2(250,280))
- EGP:egpColor(28, color(255,255,255) )
- // Antimatter
- EGP:egpText(29,"Antimatter: " + Antimatter + " (" + ceil(3999999999*1.15^Antimatter) + ")", vec2(250,300))
- EGP:egpColor(29, color(255,255,255) )
- // Prism
- EGP:egpText(30,"Prism: " + Prism + " (" + ceil(75000000000*1.15^Prism) + ")", vec2(250,320))
- EGP:egpColor(30, color(255,255,255) )
- EGP:egpBox(40,vec2(240,130),vec2(10,10))
- EGP:egpColor(40, color(255,0,0) )
- EGP:egpBox(41,vec2(240,150),vec2(10,10))
- EGP:egpColor(41, color(255,0,0) )
- EGP:egpBox(42,vec2(240,170),vec2(10,10))
- EGP:egpColor(42, color(255,0,0) )
- EGP:egpBox(43,vec2(240,190),vec2(10,10))
- EGP:egpColor(43, color(255,0,0) )
- EGP:egpBox(44,vec2(240,210),vec2(10,10))
- EGP:egpColor(44, color(255,0,0) )
- EGP:egpBox(45,vec2(240,230),vec2(10,10))
- EGP:egpColor(45, color(255,0,0) )
- EGP:egpBox(46,vec2(240,250),vec2(10,10))
- EGP:egpColor(46, color(255,0,0) )
- EGP:egpBox(47,vec2(240,270),vec2(10,10))
- EGP:egpColor(47, color(255,0,0) )
- EGP:egpBox(48,vec2(240,290),vec2(10,10))
- EGP:egpColor(48, color(255,0,0) )
- EGP:egpBox(49,vec2(240,310),vec2(10,10))
- EGP:egpColor(49, color(255,0,0) )
- EGP:egpBox(50,vec2(240,330),vec2(10,10))
- EGP:egpColor(50, color(255,0,0) )
- // ===== CODE =====
- if(HideChip) {
- self():setColor( color(0,0,0,0) )
- }
- // ===== FUNCTIONS =====
- function gameTime() {
- CpS = ((Cursor*0.1)*CursorMul+
- (Grandma*0.5)*GrandmaMul+
- (Farm*4.0)*FarmMul+
- (Factory*10.0)*FactoryMul+
- (Mine*40.0)*MineMul+
- (Shipment*100.0)*ShipmentMul+
- (AlchemyLab*400.0)*AlchemyLabMul+
- (Portal*6666.0)*PortalMul+
- (TimeMachine*98765.0)*TimeMachineMul+
- (Antimatter*999999.0)*AntimatterMul+
- (Prism*10000000.0)*PrismMul)/10
- Cookie += CpS * CookieMul
- if(Cookie >= 15 *1.15^Cursor) {EGP:egpColor(40, color(0,255,0) )} else {EGP:egpColor(40, color(255,0,0) )}
- if(Cookie >= 100 *1.15^Grandma) {EGP:egpColor(41, color(0,255,0) )} else {EGP:egpColor(41, color(255,0,0) )}
- if(Cookie >= 500 *1.15^Farm) {EGP:egpColor(42, color(0,255,0) )} else {EGP:egpColor(42, color(255,0,0) )}
- if(Cookie >= 3000 *1.15^Factory) {EGP:egpColor(43, color(0,255,0) )} else {EGP:egpColor(43, color(255,0,0) )}
- if(Cookie >= 10000 *1.15^Mine) {EGP:egpColor(44, color(0,255,0) )} else {EGP:egpColor(44, color(255,0,0) )}
- if(Cookie >= 40000 *1.15^Shipment) {EGP:egpColor(45, color(0,255,0) )} else {EGP:egpColor(45, color(255,0,0) )}
- if(Cookie >= 200000 *1.15^AlchemyLab) {EGP:egpColor(46, color(0,255,0) )} else {EGP:egpColor(46, color(255,0,0) )}
- if(Cookie >= 1666666 *1.15^Portal) {EGP:egpColor(47, color(0,255,0) )} else {EGP:egpColor(47, color(255,0,0) )}
- if(Cookie >= 123456789 *1.15^TimeMachine) {EGP:egpColor(48, color(0,255,0) )} else {EGP:egpColor(48, color(255,0,0) )}
- if(Cookie >= 3999999999 *1.15^Antimatter) {EGP:egpColor(49, color(0,255,0) )} else {EGP:egpColor(49, color(255,0,0) )}
- if(Cookie >= 75000000000*1.15^Prism) {EGP:egpColor(50, color(0,255,0) )} else {EGP:egpColor(50, color(255,0,0) )}
- timerCreate("gameTime",0.1,0,function() {gameTime()})
- }
- function resetGame() {
- Cursor = 0
- Grandma = 0
- Farm = 0
- Factory = 0
- Mine = 0
- Shipment = 0
- AlchemyLab = 0
- Portal = 0
- TimeMachine = 0
- Antimatter = 0
- Prism = 0
- CursorUpg = 0
- GrandmaUpg = 0
- FarmUpg = 0
- FactoryUpg = 0
- MineUpg = 0
- ShipmentUpg = 0
- AlchemyLabUpg = 0
- PortalUpg = 0
- TimeMachineUpg = 0
- AntimatterUpg = 0
- PrismUpg = 0
- Cookie = 0
- CpS = 0
- CookieMul = 1.0
- EGP:egpSetText(20,"Cursor: " + Cursor + " (" + ceil(15 *1.15^Cursor ) + ")")
- EGP:egpSetText(21,"Grandma: " + Grandma + " (" + ceil(100 *1.15^Grandma ) + ")")
- EGP:egpSetText(22,"Farm: " + Farm + " (" + ceil(500 *1.15^Farm ) + ")")
- EGP:egpSetText(23,"Factory: " + Factory + " (" + ceil(3000 *1.15^Factory ) + ")")
- EGP:egpSetText(24,"Mine: " + Mine + " (" + ceil(10000 *1.15^Mine ) + ")")
- EGP:egpSetText(25,"Shipment: " + Shipment + " (" + ceil(40000 *1.15^Shipment ) + ")")
- EGP:egpSetText(26,"AlchemyLab: " + AlchemyLab + " (" + ceil(200000 *1.15^AlchemyLab ) + ")")
- EGP:egpSetText(27,"Portal: " + Portal + " (" + ceil(1666666 *1.15^Portal ) + ")")
- EGP:egpSetText(28,"TimeMachine: " + TimeMachine + " (" + ceil(123456789 *1.15^TimeMachine ) + ")")
- EGP:egpSetText(29,"Antimatter: " + Antimatter + " (" + ceil(3999999999 *1.15^Antimatter ) + ")")
- EGP:egpSetText(30,"Prism: " + Prism + " (" + ceil(75000000000*1.15^Prism ) + ")")
- }
- function setGame(string Text) {
- table LoadedContent = Text:explode(",")
- Cookie = LoadedContent[1,string]
- CookieMul = LoadedContent[2,string]
- Cursor = LoadedContent[3,string]
- Grandma = LoadedContent[4,string]
- Farm = LoadedContent[5,string]
- Factory = LoadedContent[6,string]
- Mine = LoadedContent[7,string]
- Shipment = LoadedContent[8,string]
- AlchemyLab = LoadedContent[9,string]
- Portal = LoadedContent[10,string]
- TimeMachine = LoadedContent[11,string]
- Antimatter = LoadedContent[12,string]
- Prism = LoadedContent[13,string]
- CursorUpg = LoadedContent[14,string]
- GrandmaUpg = LoadedContent[15,string]
- FarmUpg = LoadedContent[16,string]
- FactoryUpg = LoadedContent[17,string]
- MineUpg = LoadedContent[18,string]
- ShipmentUpg = LoadedContent[19,string]
- AlchemyLabUpg = LoadedContent[20,string]
- PortalUpg = LoadedContent[21,string]
- TimeMachineUpg = LoadedContent[22,string]
- AntimatterUpg = LoadedContent[23,string]
- PrismUpg = LoadedContent[24,string]
- EGP:egpSetText(20,"Cursor: " + Cursor + " (" + ceil(15 *1.15^Cursor ) + ")")
- EGP:egpSetText(21,"Grandma: " + Grandma + " (" + ceil(100 *1.15^Grandma ) + ")")
- EGP:egpSetText(22,"Farm: " + Farm + " (" + ceil(500 *1.15^Farm ) + ")")
- EGP:egpSetText(23,"Factory: " + Factory + " (" + ceil(3000 *1.15^Factory ) + ")")
- EGP:egpSetText(24,"Mine: " + Mine + " (" + ceil(10000 *1.15^Mine ) + ")")
- EGP:egpSetText(25,"Shipment: " + Shipment + " (" + ceil(40000 *1.15^Shipment ) + ")")
- EGP:egpSetText(26,"AlchemyLab: " + AlchemyLab + " (" + ceil(200000 *1.15^AlchemyLab ) + ")")
- EGP:egpSetText(27,"Portal: " + Portal + " (" + ceil(1666666 *1.15^Portal ) + ")")
- EGP:egpSetText(28,"TimeMachine: " + TimeMachine + " (" + ceil(123456789 *1.15^TimeMachine ) + ")")
- EGP:egpSetText(29,"Antimatter: " + Antimatter + " (" + ceil(3999999999 *1.15^Antimatter ) + ")")
- EGP:egpSetText(30,"Prism: " + Prism + " (" + ceil(75000000000*1.15^Prism ) + ")")
- print("Game Loaded!")
- }
- function loadGame(string FileName) {
- print("Loading File: (" +FileName+"). Use 'game save <name>' to save the game.")
- fileLoad("CookieClicker/"+FileName+".txt",setGame )
- }
- function saveGame(string FileName) {
- print("Saving File: (" +FileName+"). Use 'game load <name>' to load the game.")
- fileWrite("CookieClicker/"+FileName+".txt",
- Cookie +","+
- CookieMul +","+
- Cursor +","+
- Grandma +","+
- Farm +","+
- Factory +","+
- Mine +","+
- Shipment +","+
- AlchemyLab +","+
- Portal +","+
- TimeMachine +","+
- Antimatter +","+
- Prism +","+
- CursorUpg +","+
- GrandmaUpg +","+
- FarmUpg +","+
- FactoryUpg +","+
- MineUpg +","+
- ShipmentUpg +","+
- AlchemyLabUpg +","+
- PortalUpg +","+
- TimeMachineUpg +","+
- AntimatterUpg +","+
- PrismUpg)
- }
- function buyCursor() {
- if(Cookie >= 15*1.15^Cursor) {
- Cookie -= 15*1.15^Cursor
- Cursor++
- EGP:egpSetText(20,"Cursor: " + Cursor + " (" + ceil(15*1.15^Cursor) + ")")
- }
- }
- function buyGrandma() {
- if(Cookie >= 100*1.15^Grandma) {
- Cookie -= 100*1.15^Grandma
- Grandma++
- EGP:egpSetText(21,"Grandma: " + Grandma + " (" + ceil(100*1.15^Grandma) + ")")
- }
- }
- function buyFarm() {
- if(Cookie >= 500*1.15^Farm) {
- Cookie -= 500*1.15^Farm
- Farm++
- EGP:egpSetText(22,"Farm: " + Farm + " (" + ceil(500*1.15^Farm) + ")")
- }
- }
- function buyFactory() {
- if(Cookie >= 3000*1.15^Factory) {
- Cookie -= 3000*1.15^Factory
- Factory++
- EGP:egpSetText(23,"Factory: " + Factory + " (" + ceil(3000*1.15^Factory) + ")")
- }
- }
- function buyMine() {
- if(Cookie >= 10000*1.15^Mine) {
- Cookie -= 10000*1.15^Mine
- Mine++
- EGP:egpSetText(24,"Mine: " + Mine + " (" + ceil(10000*1.15^Mine) + ")")
- }
- }
- function buyShipment() {
- if(Cookie >= 40000*1.15^Shipment) {
- Cookie -= 40000*1.15^Shipment
- Shipment++
- EGP:egpSetText(25,"Shipment: " + Shipment + " (" + ceil(40000*1.15^Shipment) + ")")
- }
- }
- function buyAlchemyLab() {
- if(Cookie >= 200000*1.15^AlchemyLab) {
- Cookie -= 200000*1.15^AlchemyLab
- AlchemyLab++
- EGP:egpSetText(26,"AlchemyLab: " + AlchemyLab + " (" + ceil(200000*1.15^AlchemyLab) + ")")
- }
- }
- function buyPortal() {
- if(Cookie >= 1666666*1.15^Portal) {
- Cookie -= 1666666*1.15^Portal
- Portal++
- EGP:egpSetText(27,"Portal: " + Portal + " (" + ceil(1666666*1.15^Portal) + ")")
- }
- }
- function buyTimeMachine() {
- if(Cookie >= 123456789*1.15^TimeMachine) {
- Cookie -= 123456789*1.15^TimeMachine
- TimeMachine++
- EGP:egpSetText(28,"TimeMachine: " + TimeMachine + " (" + ceil(123456789*1.15^TimeMachine) + ")")
- }
- }
- function buyAntimatter() {
- if(Cookie >= 3999999999*1.15^Antimatter) {
- Cookie -= 3999999999*1.15^Antimatter
- Antimatter++
- EGP:egpSetText(29,"Antimatter: " + Antimatter + " (" + ceil(3999999999*1.15^Antimatter) + ")")
- }
- }
- function buyPrism() {
- if(Cookie >= 75000000000*1.15^Prism) {
- Cookie -= 75000000000*1.15^Prism
- Prism++
- EGP:egpSetText(30,"Prism: " + Prism + " (" + ceil(75000000000*1.15^Prism) + ")")
- }
- }
- // ===== EVENTS =====
- event tick() {
- EGP:egpSetText(1,"Cookie: " + floor(Cookie))
- EGP:egpSetText(4,"CpS: " + CpS*10)
- }
- event think() {
- }
- event keypress(int Key) {
- if( Key == 128) { // Numpad: 0 - (15)Cursor
- buyCursor()
- }elseif( Key == 129) { // Numpad: 1 - (100)Grandma
- buyGrandma()
- }elseif( Key == 130) { // Numpad: 2 - (500)Farm
- buyFarm()
- }elseif( Key == 131) { // Numpad: 3 - (3.000)Factory
- buyFactory()
- }elseif( Key == 132) { // Numpad: 4 - (10.000)Mine
- buyMine()
- }elseif( Key == 133) { // Numpad: 5 - (40.000)Shipment
- buyShipment()
- }elseif( Key == 134) { // Numpad: 6 - (200.000)AlchemyLab
- buyAlchemyLab()
- }elseif( Key == 135) { // Numpad: 7 - (1.666.666)Portal
- buyPortal()
- }elseif( Key == 136) { // Numpad: 8 - (123.456.789)TimeMachine
- buyTimeMachine()
- }elseif( Key == 137) { // Numpad: 9 - (3.999.999.999)Antimatter
- buyAntimatter()
- }elseif( Key == 143) { // Numpad: , - (75.000.000.000)Prism
- buyPrism()
- }
- }
- event keyrelease(int Key) {
- }
- event playerChat(entity Player, string Text) {
- table Say = Text:lower():explode(" ")
- if(Say[1,string] == "buy") {
- Say[3,number] = (int) Say[3,string]
- if( Say[2,string] == "cursor") { // Numpad: 0 - (15)Cursor
- if(Say[3,number] >= 1 && Say[3,int] <= MaxBuyCount) {
- for(int I=0;I<Say[3,number];I++) {
- buyCursor()
- }
- } else {
- buyCursor()
- }
- }elseif( Say[2,string] == "grandma") { // Numpad: 1 - (100)Grandma
- if(Say[3,number] >= 1 && Say[3,int] <= MaxBuyCount) {
- for(int I=0;I<Say[3,number];I++) {
- buyGrandma()
- }
- } else {
- buyGrandma()
- }
- }elseif( Say[2,string] == "farm") { // Numpad: 2 - (500)Farm
- if(Say[3,number] >= 1 && Say[3,int] <= MaxBuyCount) {
- for(int I=0;I<Say[3,number];I++) {
- buyFarm()
- }
- } else {
- buyFarm()
- }
- }elseif( Say[2,string] == "factory") { // Numpad: 3 - (3.000)Factory
- if(Say[3,number] >= 1 && Say[3,int] <= MaxBuyCount) {
- for(int I=0;I<Say[3,number];I++) {
- buyFactory()
- }
- } else {
- buyFactory()
- }
- }elseif( Say[2,string] == "mine") { // Numpad: 4 - (10.000)Mine
- if(Say[3,number] >= 1 && Say[3,int] <= MaxBuyCount) {
- for(int I=0;I<Say[3,number];I++) {
- buyMine()
- }
- } else {
- buyMine()
- }
- }elseif( Say[2,string] == "shipment") { // Numpad: 5 - (40.000)Shipment
- if(Say[3,number] >= 1 && Say[3,int] <= MaxBuyCount) {
- for(int I=0;I<Say[3,number];I++) {
- buyShipment()
- }
- } else {
- buyShipment()
- }
- }elseif( Say[2,string] == "alchemylab") { // Numpad: 6 - (200.000)AlchemyLab
- if(Say[3,number] >= 1 && Say[3,int] <= MaxBuyCount) {
- for(int I=0;I<Say[3,number];I++) {
- buyAlchemyLab()
- }
- } else {
- buyAlchemyLab()
- }
- }elseif( Say[2,string] == "portal") { // Numpad: 7 - (1.666.666)Portal
- if(Say[3,number] >= 1 && Say[3,int] <= MaxBuyCount) {
- for(int I=0;I<Say[3,number];I++) {
- buyPortal()
- }
- } else {
- buyPortal()
- }
- }elseif( Say[2,string] == "timemachine") { // Numpad: 8 - (123.456.789)TimeMachine
- if(Say[3,number] >= 1 && Say[3,int] <= MaxBuyCount) {
- for(int I=0;I<Say[3,number];I++) {
- buyTimeMachine()
- }
- } else {
- buyTimeMachine()
- }
- }elseif( Say[2,string] == "antimatter") { // Numpad: 9 - (3.999.999.999)Antimatter
- if(Say[3,number]>= 1 && Say[3,int] <= MaxBuyCount) {
- for(int I=0;I<Say[3,number];I++) {
- buyAntimatter()
- }
- } else {
- buyAntimatter()
- }
- }elseif( Say[2,string] == "prism") { // Numpad: , - (75.000.000.000)Prism
- if(Say[3,number] >= 1 && Say[3,int] <= MaxBuyCount) {
- for(int I=0;I<Say[3,number];I++) {
- buyPrism()
- }
- } else {
- buyPrism()
- }
- }
- }elseif(Say[1,string] == "upgrade") {
- }elseif(Say[1,string] == "game") {
- if(Say[2,string] == "reset") {
- resetGame()
- }elseif(Say[2,string] == "save") {
- saveGame(Say[3,string])
- }elseif(Say[2,string] == "load") {
- loadGame(Say[3,string])
- }
- }
- }
- event use(entity Player) {
- Cookie++
- }
- event shutdown() {
- saveGame("autosave")
- }
- timerCreate("gameTime",1,0,function() {gameTime()})
Advertisement
Add Comment
Please, Sign In to add comment