Skip to content

Instantly share code, notes, and snippets.

@seeker
Created July 18, 2012 19:24
Show Gist options
  • Save seeker/3138262 to your computer and use it in GitHub Desktop.
Save seeker/3138262 to your computer and use it in GitHub Desktop.
Script to automate stats rolling when creating a new avatar in E.Y.E: Divine Cybermancy
Opt("MouseCoordMode",0) ; Coordiantes relative to window
Opt("PixelCoordMode",0) ; Coordiantes relative to window
; Script to roll stats when creating a avatar in E.Y.E Divine Cybermancy
;
; Set game resolution to 1600x900 and windowed mode for the script to work,
; or correct the cordinates
; 1235, 183 STR
; 1235, 205 PSI
$xStr = 1235
$yStr = 183
$yOffset = 22 ; y distance between stats
$searchOffset = 5 ; pixels in each direction to look at
$windowHandle = 0
$colorGreen = 0x00C100
$greenThreshold = 7 ; number of attributes that must be green to abort (max 8)
$maxRolls = 100 ; how many times to roll before giving up
; Script start
$windowHandle = WinActivate ("E.Y.E: Divine Cybermancy")
$greenCount = 0
; Window found & activated?
If $windowHandle == 0 Then
Exit
EndIf
; check atributes Strength down to Agility (rollable attributes)
For $try = 0 to $maxRolls
$greenCount = 0
For $i = 0 to 7
$green = isGreen($xStr,($yStr + ($i * $yOffset)))
If $green = True Then
$greenCount += 1
EndIf
Next
If $greenCount >= $greenThreshold Then
ExitLoop
EndIf
MouseClick("Left", 469, 334,1,1) ; Genetic Fusion!
Sleep(300)
Next
Exit
Func isGreen($xCord, $yCord)
PixelSearch($xCord - $searchOffset, $yCord - $searchOffset, $xCord + $searchOffset, $yCord + $searchOffset, $colorGreen,20)
If @error Then
Return False
Else
Return True
EndIf
EndFunc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment