satanttin Posted July 9, 2014 Share Posted July 9, 2014 (edited) Hey folks, Started again with autoit and what's better to learn some autoit with something fun? anyways the things i have so far is: 1. Click for a cookie. 2. Cookie per sec. 3. 4 buyable upgrades 3 for CPS and 1 for additional cookies per mouse click. next things i am planning to make is: 1. more upgrades. 2. better looking gui. 3. save/autoload and reset. 4. setting the decimal on 0,5. (idea from Blckpythn) 5. better upgrade costs and the code sofar for anyone that want it is expandcollapse popup#include <GUIConstantsEx.au3> Global $Value, $ValuePS, $LVal, $LValPS, $Click, $ValPS, $Buy01, $02buy, $03buy, $Upgradebuy, $buy01, $buy02, $buy03, $UpgradeClick Opt("GUIOnEventMode", 1) $Value = 0 $Click = 1 $BuyIncrease = 1.1 $01buy = 10 $02buy = 50 $03buy = 100 $Upgradebuy = 10000 Main() Func Main() GUICreate("Main", 600, 450) $LVal = GUICtrlCreateLabel( $Value& " cookies", 5, 5, 255) $LValPS = GUICtrlCreateLabel( $ValPS& " cookies Per second", 5, 25, 255) $Image = GUICtrlCreatePic(@ScriptDir & "\test.jpg", 5, 100, 75, 75) $UpgradeClick = GUICtrlCreateButton ("Upgrade Clicker - Cost "&$Upgradebuy, 5, 175,150) $Buy01 = GUICtrlCreateButton ("Cookie dealer - cost "&$01buy, 450, 150,150) $Buy02 = GUICtrlCreateButton ("Cookie market - cost "&$02buy, 450, 175,150) $Buy03 = GUICtrlCreateButton ("Cookie science - cost "&$03buy, 450, 195,150) GUICtrlSetOnEvent ($Image, "click") GUICtrlSetOnEvent ($UpgradeClick, "UpClick") GUICtrlSetOnEvent ($Buy01, "Buy01") GUICtrlSetOnEvent ($Buy02, "Buy02") GUICtrlSetOnEvent ($Buy03, "Buy03") GUISetState(@SW_SHOW) GUISetOnEvent($GUI_EVENT_CLOSE, "stop") EndFunc Func Buy01() If $Value>= $01buy Then $Value-=$01buy $ValPS+=0.1 $01buy*=$BuyIncrease GUICtrlSetData($Buy01, "Cookie dealer - cost "&$01buy) GUICtrlSetData($LValPS, $ValPS&" cookies Per second") GUICtrlSetData($LVal, $Value&" cookies") else MsgBox (1, "Error", "Not enough cookies") EndIf EndFunc Func Buy02() If $Value>= $02buy Then $Value-=$02buy $ValPS+=0.7 $02buy*=$BuyIncrease GUICtrlSetData($buy02, "Cookie market - cost "&$02buy) GUICtrlSetData($LValPS, $ValPS&" cookies Per second") GUICtrlSetData($LVal, $Value&" cookies") else MsgBox (1, "Error", "Not enough cookies") EndIf EndFunc Func Buy03() If $Value>= $03buy Then $Value-=$03buy $ValPS+=1.2 $03buy*=$BuyIncrease GUICtrlSetData($buy03, "Cookie science - cost "&$03buy) GUICtrlSetData($LValPS, $ValPS&" cookies Per second") GUICtrlSetData($LVal, $Value&" cookies") else MsgBox (1, "Error", "Not enough cookies") EndIf EndFunc Func click() $Value+=$Click GUICtrlSetData($LVal, $Value&" cookies") EndFunc Func UpClick() If $Value>= $Upgradebuy Then $Value-=$Upgradebuy $Click+=1 $Upgradebuy*=$BuyIncrease GUICtrlSetData($UpgradeClick, "Cookie science - cost "&$Upgradebuy) GUICtrlSetData($LVal, $Value&" cookies") else MsgBox (1, "Error", "Not enough cookies") EndIf EndFunc Func stop() Exit EndFunc While 1 $Value+=$ValPS Sleep(1000) GUICtrlSetData($LVal, $Value&" cookies") GUICtrlSetData($LValPS, $ValPS&" cookies Per second") WEnd feel free to give some ideas/tips to make it better^^ Greetz Edited July 10, 2014 by satanttin Link to comment Share on other sites More sharing options...
blckpythn Posted July 9, 2014 Share Posted July 9, 2014 (edited) I like it, one thing I would change is the decimal increase in cookies. After only a few minutes I managed to get 74.89999999999 cookies. Maybe after the counter has reached 1.0+ cookies per second, remove the decimals from the current cookie count? In fact, you may want to strip them entirely to avoid memory issues later. Edited July 9, 2014 by blckpythn Link to comment Share on other sites More sharing options...
jdelaney Posted July 9, 2014 Share Posted July 9, 2014 tons of them, here http://orteil.dashnet.org/cookieclicker/ IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
satanttin Posted July 10, 2014 Author Share Posted July 10, 2014 I like it, one thing I would change is the decimal increase in cookies. After only a few minutes I managed to get 74.89999999999 cookies. Maybe after the counter has reached 1.0+ cookies per second, remove the decimals from the current cookie count? In fact, you may want to strip them entirely to avoid memory issues later. yeah that's true i have to take a look into that might be a while don't got that much time to code and don''t know how to do it:P will add it to the list. think the lowest CPS is going to be 0.5 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now