@name cookie clicker
@inputs Click  GrandmaAdd
@outputs Cookies Grandmas Grandma
@persist GG Grandma GRPRICE HH GGG JJ FAPRICE KKK Farm  LL Grandmasave Farmsave CookieSave UU
@trigger 


if(first()){
    

    
        #~~~~~~~~~~~~~~~
    #~~~~~SAVE AREA~~
    #~~~~PUT INFO HERE~~
    #~~~~~~~~~~~~~~~~~~
    
  #  Farmsave = 0 -------- NOT WORKING
    Grandmasave = 999999999999
    Cookiesave = 0
    
    
    
    
    GG=40
#cookie :D
holoCreate(1)
holoModel(1,"hqsphere")
holoPos(1,entity():pos() + vec(0,0,30))
holoScale(1,vec(0.4,2,2))
holoMaterial(1,"models/shadertest/shield")

#choco chips
holoCreate(2)
holoModel(2,"hqsphere")
holoPos(2,holoEntity(1):toWorld(vec(1,2,5)))
holoScale(2,vec(0.4,0.4,0.4))
holoColor(2,vec(50,25,0))
holoMaterial(2,"models/ihvtest/boot")
holoCreate(3)
holoModel(3,"hqsphere")
holoPos(3,holoEntity(1):toWorld(vec(1,-4,-3)))
holoScale(3,vec(0.3,0.3,0.3))
holoColor(3,vec(50,25,0))
holoMaterial(3,"models/ihvtest/boot")
holoCreate(4)
holoModel(4,"hqsphere")
holoPos(4,holoEntity(1):toWorld(vec(1,7,-5)))
holoScale(4,vec(0.2,0.25,0.25))
holoColor(4,vec(50,25,0))
holoMaterial(4,"models/ihvtest/boot")
GRPRICE = 10
FAPRICE = 50
JJ = 0
KKK = 41
LL = 40
UU = 10
HH = 0
GGG  = 40
timer("hint",9000)
}

runOnTick(1)
if(changed(owner():keyAttack1())){
    Cookies=Cookies+1
    holoColor(1,vec(250,150,0))
    timer("color",200)
}
if(clk("color")){
    holoColor(1,vec(200,100,0))
}

#grandmas...?

if(owner():lastSaid() == "!save" ){
    
         concmd("say Save is Grandmas:  " + Grandma + " Farms :  " + Farm)
    }
       
    if(owner():lastSaid() == "!load" ){

    
 #   Cookies = Grandmasave / Grandmasave + 10 * Grandmasave

Cookies = Grandmasave * 20

concmd("say !gr")
        
        
    #    Cookies = Farmsave * 100
    #    concmd("say !farm")
        
        concmd("say Loaded!")
          
             timer("cookies",2000)
           
    }
     if(clk("cookies")){Cookies = Cookiesave}

if(owner():lastSaid() == "!gr" ){
if(Cookies>0){
    if(Cookies-GRPRICE>0){
        if(Cookies > GRPRICE){
        concmd("say Grandma(s) Bought!")
  
        Grandma=Grandma+1
        Cookies=Cookies-GRPRICE
          GRPRICE = GRPRICE + 10
        if(Grandma>0){
                hint("The price of : GRANDMA(s) Are : " + GRPRICE,30)
            timer("auto",500)
            holoCreate(GGG)
            holoPos(GGG,entity():pos() + vec(0,GG,HH))
            holoModel(GGG,"models/props_lab/frame002a.mdl")
            GG = GG + 20
            GGG = GGG + 20
            if(GG > 180){
                HH = HH + 30
            GG = 40}
        }

    }
}
}
}

if(owner():lastSaid() == "!farm" ){
if(Cookies>0){
    if(Cookies-FAPRICE>0){
        if(Cookies > FAPRICE){
        concmd("say FARM(s) Bought!")
  
        Farm=Farm+1
        Cookies=Cookies-FAPRICE
          FAPRICE = FAPRICE + 20
        if(Farm>0){
                hint("The price of : FARMS(s) Are : " + FAPRICE,30)
            timer("auto2",500)
            holoCreate(KKK)
            holoPos(KKK,entity():pos() + vec(-30,LL,JJ))
            holoModel(KKK,"models/props_junk/Wheebarrow01a.mdl")
            holoScale(KKK,vec(0.3,0.3,0.3))
            LL = LL + 20
            KKK = KKK + 21
            if(LL > 180){
                JJ = JJ + 30
            LL = 20}
        }

    }
}
}
}



#     



if(clk("auto")){Cookies = Cookies + (Grandma * 1)
    timer("auto",500)}
    
    if(clk("auto2")){Cookies = Cookies + (Farm* 5)
    timer("auto2",200)}
