Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SingleInstance Force
- #Persistent
- CoordMode, Mouse, Screen
- SetWorkingDir %A_ScriptDir%
- ; Cooldown Timing
- totalCooldown := 114000 ; 1:54 in ms
- waitToClick := 39000 ; Wait 39 seconds to reach 1:15
- postClickWait := 72000 ; Wait remaining cooldown: 1:12 (114s - 39s - 3s)
- toggle := false
- cycleRunning := false
- ; GUI
- Gui, +AlwaysOnTop -SysMenu +ToolWindow
- Gui, Font, s10, Segoe UI
- Gui, Add, Text, vStatusText w250 Center, Status: ❌ OFF
- Gui, Add, Button, gToggleScript w250, ▶️ Start / Stop
- Gui, Add, Text, vCountdownText w250 Center, Next click in: N/A
- Gui, Show, , 🐸 Echo Frog Clicker
- SetTimer, UpdateCountdownDisplay, 1000
- return
- ToggleScript:
- toggle := !toggle
- if (toggle) {
- GuiControl,, StatusText, Status: ✅ ON
- StartCooldownCycle()
- } else {
- GuiControl,, StatusText, Status: ❌ OFF
- SetTimer, CooldownCycle, Off
- SetTimer, CountdownTick, Off
- GuiControl,, CountdownText, Next click in: N/A
- cycleRunning := false
- }
- return
- StartCooldownCycle() {
- if (!cycleRunning) {
- cycleRunning := true
- nextClickIn := waitToClick / 1000
- timeLeft := totalCooldown / 1000
- SetTimer, CountdownTick, 1000
- SetTimer, CooldownCycle, -%waitToClick%
- }
- }
- CooldownCycle:
- ; First click at 1:15
- ClickAutoMiddle()
- ; Second click after 3 sec
- SetTimer, SecondClick, -3000
- ; Wait the rest of the cooldown
- SetTimer, NextCycle, -%postClickWait%
- return
- SecondClick:
- ClickAutoMiddle()
- return
- NextCycle:
- if (toggle) {
- nextClickIn := waitToClick / 1000
- timeLeft := totalCooldown / 1000
- SetTimer, CooldownCycle, -%waitToClick%
- } else {
- SetTimer, CountdownTick, Off
- GuiControl,, CountdownText, Next click in: N/A
- cycleRunning := false
- }
- return
- ClickAutoMiddle() {
- MouseMove, 1185, 585
- Click
- }
- CountdownTick:
- if (!toggle)
- return
- nextClickIn--
- timeLeft--
- if (nextClickIn < 0)
- nextClickIn := 0
- mins := Floor(nextClickIn / 60)
- secs := Mod(nextClickIn, 60)
- GuiControl,, CountdownText, Next click in: % Format("{:02}:{:02}", mins, secs)
- return
- GuiClose:
- ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement