Skip to content

Instantly share code, notes, and snippets.

@Sorebit
Last active June 23, 2020 20: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 Sorebit/6a94292ce94f64f67068b90179fe8cd4 to your computer and use it in GitHub Desktop.
Save Sorebit/6a94292ce94f64f67068b90179fe8cd4 to your computer and use it in GitHub Desktop.
AutoIt3 Club Penguin gold digger
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.14.5
Author: https://github.com/sorebit
Script Function:
This is a Club Penguin AFK gold digger.
Usage:
1. Open cponline.pw/play in full window.
2. Scroll down.
3. Go to the mine to dig gold, stand somewhere in the middle
4. Run script
#ce ----------------------------------------------------------------------------
; Script Start
#include <AutoItConstants.au3>
Global $windowTitle = "Dig v0.1"
; TODO: Get coords from user mouse clicks
; TODO: Transform this into a script that loops through input screen positions
Global $x = 800
Global $y = 750
Func Reenter()
Local $xExitOff = 300
Local $yExitOff = -400
Local $xEntryOff = -450
Local $yEntryOff = -400
MouseClick("left", $x + $xExitOff , $y + $yExitOff, 1)
Sleep(6 * 1000)
MouseClick("left", $x + $xEntryOff , $y + $yEntryOff, 1)
Sleep(6 * 1000)
EndFunc
Func DigLoop($maxIter)
Local $iter = 0
Local $digDuration = 12
Local $walkDuration = 2
; Digging places are rotated from these offset arrays
Local $c = 0
Local $cSize = 3
Local $xOffs[$cSize] = [0, 100, 200]
Local $yOffs[$cSize] = [0, -200, 0]
While $iter < $maxIter
; Click and let peng walk
MouseClick("left", $x + $xOffs[$c] , $y + $yOffs[$c], 1, 1)
Sleep($walkDuration * 1000)
; Send single d press
Send("{d down}")
Sleep(200)
Send("{d up}")
; Wait duration
Sleep($digDuration * 1000)
; Update counters
$c += 1
$iter += 1
If $c == $cSize Then
$c = 0
EndIf
WEnd
EndFunc
Func Main()
While True
Reenter()
DigLoop(6)
WEnd
EndFunc
; Main Logic
MsgBox(1, $windowTitle, "Press OK to start")
Main()
MsgBox(1, $windowTitle, "Done")
; Script End
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment