satanttin Posted July 9, 2014 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
blckpythn Posted July 9, 2014 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
jdelaney Posted July 9, 2014 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.
satanttin Posted July 10, 2014 Author 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
AntoinetteBArnold Posted Saturday at 07:37 AM Posted Saturday at 07:37 AM (edited) This sounds like a great project! You’ve already got the core mechanics in place, and adding more upgrades, better GUI, and save/autoload will make it even better. The mouse-click upgrade is a nice touch—more ways to boost cookie production always make it more fun. Looking forward to seeing how it evolves Edited yesterday at 01:42 AM by AntoinetteBArnold
water Posted Saturday at 07:46 AM Posted Saturday at 07:46 AM Welcome to AutoIt and the forum You noticed that the thread is nearly 10 years old and the OP has left in October 2015? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
VAN0 Posted Saturday at 01:54 PM Posted Saturday at 01:54 PM 6 hours ago, water said: Welcome to AutoIt and the forum You noticed that the thread is nearly 10 years old and the OP has left in October 2015? Seems to be a bot...
Nine Posted Saturday at 03:43 PM Posted Saturday at 03:43 PM 1 hour ago, VAN0 said: Seems to be a bot... Hmm, you are probably right. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Multi-Threading Made Easy
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