Skip to content

Instantly share code, notes, and snippets.

@stieglma
Created September 27, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stieglma/25ea53a2191ff515a753 to your computer and use it in GitHub Desktop.
Save stieglma/25ea53a2191ff515a753 to your computer and use it in GitHub Desktop.
#NoEnv
#Warn
#SingleInstance Force
SendMode Input
SetMouseDelay, 0, Play
#Persistent
CoordMode, Mouse, Client
global TotalSeconds := 0
global KeyIndex := 0 ; Keys to look through (asdfg)
global IdleTime := (69 * 60) ; adjust the value as you like
; (usually 0, but when starting the script later in a run,
; a higher value may be needed)
global IdleCycle := (180 * 60) ; 120 minutes per idle cycle
; +-------------------------------------------------+
; | |
; | All functions used in this Script |
; | |
; +-------------------------------------------------+
printToolTip() ; prints a tooltip in the top right corner of the TimeClickers Window
{
IfWinActive ahk_exe TimeClickers.exe
{
Line1 := "Approx. Time until next Timewarp: " . ((IdleCycle - IdleTime)/60) . " minutes"
Line2 := "Approx. Time until next ability activation: " . (60 - Mod(IdleTime, 60)) . " seconds"
ToolTip, %Line1%, 2, 109, 1
ToolTip, %Line2%, 2, 130, 2
}
else
{
ToolTip,,,,1
ToolTip,,,,2
}
}
buyLeftUpgrades() ; Buy Upgrades
{ ; this function is used during startup where
; enough money is available for all weapons
Send, a
Sleep, 100
Send, s
Sleep, 100
Send, d
Sleep, 100
Send, f
Sleep, 100
Send, g
Sleep, 100
}
buyRightUpgrades() ; Buy Upgrades for Click Pistol and Abilities
{
Loop 13 ;Buy Click Pistol Upgrades
{
Click 1200 250
Sleep, 100
}
Loop 10 ;Buy Active Upgrades
{
Click 1200 350
Sleep, 100
}
}
changeUpgradeLevel() ; Set the Upgrade level to One further
{ ; than it was before
Click 50 710
Sleep, 100
}
resetStepToPromotion() ; Reset upgrade level from "MAX" to "Promotion".
{
Loop 3
{
changeUpgradeLevel()
}
}
setIdleMode() ; Click the idle mode buttons
{
Click 380 1000 ;Rocket Launcher idle
Sleep, 100
Click 900 1000 ;Click Pistol Idle
Sleep, 100
}
TimeWarp()
{
IfWinActive ahk_exe TimeClickers.exe
{
SetTimer, Clicker, OFF
SetTimer, Buy, Off
Sleep 1000 ; make sure clicks are over
Click, 1220, 350 ; Click on Time Warp
Sleep, 1000 ; Wait for GUI
Click, 530, 540 ; Click yes to Time Warp
Sleep, 1000 ; Wait for Time Warp Timeout
buyRightUpgrades()
Sleep, 1000
resetStepToPromotion() ; reset upgrade level from "MAX" to promotion
; Make sure that on startup the upgrade level is on "MAX"
buyLeftUpgrades() ; should be the first 100 for all weapons
; we don't want to buy more so that we can activate the idle mode
; properly, otherwise it may happen that the idle buttons are hidden
; by a time/weapon cube overlay which prevents us from clicking it
; so we buy the rest afterwards
setIdleMode() ; then use both weapons in idle (auto-aiming)
changeUpgradeLevel() ; this will change it back to "MAX"
buyLeftUpgrades() ; buy as much as you can
Click, 638, 400 ; Click the middle of the screen
SetTimer, Clicker, 5
SetTimer, Buy, 200
IdleTime := 0
}
}
; +-------------------------------------------------+
; | |
; | Begginning of main script |
; | (only Timers, and an Exit hotkey) |
; | |
; +-------------------------------------------------+
SetTimer, Tick, 1000 ; (computation task only) increases some variables ever second
SetTimer, Clicker, 5 ; clicks ~200 times each second
; a smaller value does not increase clicking times
; at least I didn't notice, so perhaps there is a clicking
; cap in TimeClickers, or TimeClickers is just not able to
; handle more clicks and ignores some
SetTimer, Buy, 200 ; trys to by upgrades 5 times each second
SetTimer, Warp, 60000 ; looks if it should warp every minute
SetTimer, Ability, 60000 ; trys to activate all abilities every minute
Tick:
TotalSeconds++
IdleTime++
printToolTip()
return
Clicker:
IfWinActive ahk_exe TimeClickers.exe
{
Click
}
return
Buy:
IfWinActive ahk_exe TimeClickers.exe
{
if(KeyIndex == 0)
{
Send, a
} else if(KeyIndex == 1)
{
Send, s
} else if(KeyIndex == 2)
{
Send, d
} else if(KeyIndex == 3)
{
Send, f
} else if(KeyIndex == 4)
{
Send, g
}
KeyIndex++
if(KeyIndex >= 5)
{
KeyIndex := 0
}
}
return
Warp:
IfWinActive ahk_exe TimeClickers.exe
{
if(IdleTime >= IdleCycle)
{
TimeWarp()
}
}
return
Ability: ; activate all abilities
IfWinActive ahk_exe TimeClickers.exe
{
Send, {Space}70
}
return
#IfWinActive
Esc::
ExitApp
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment