Public feed #378134

Mine

public text v1 · immutable
Raw Edit
·published 2007-03-02 08:58 UTC
rendered paste body
;-----
; Configurable AutoMiner v0.0
; CC-BY-NC-SA
; Copyright 2007 Allen Parker
;-----

#include <GUIConstants.au3>
#include <Color.au3>
#include "variables.au3"

AutoItSetOption( "MouseCoordMode", 1 )

#cs
Window Sizing for non-fullscreen:
w + 6; h + 25 (4 left/2 right, 22 top/3 bottom)
Fullscreen will register as proper resolution for offset math
-----
"items" offset ->
1024fs	x: 858 y: 420
1024w	x: 862 y: 442 @ topleft=0:0

items colors: 1116 1117x 442 - 164/165 pixels from the right hand side
RGB:	Hex: 0x6D6C77	Dec: 7171191
#ce

; Let's see if we're in windowed mode and set appropriate variable whatever the result
WinActivate("EVE")
sleep(5000)
$EveWin = WinGetPos("EVE")
If $EveWin[2] <> @DesktopWidth Then
	$FullScreen = 0
Else
	$FullScreen = 1
EndIf

If $FullScreen = 0 Then
	; Let's get current positions
	$EveWin = WinGetPos("EVE")
	; And set the position to a useful one for math
	If $EveWin[0] <> 0 OR $EveWin[1] <> 0 Then
		WinWait("EVE")
		WinActivate("EVE")
		WinWaitActive("EVE")
		WinMove("EVE", "", 0, 0)
	EndIf
	Global $baseX = 5
	Global $baseY = 22
ElseIf $FullScreen = 1 Then
	; No need for current positions, only lame defines
	Global $baseX = 0
	Global $baseY = 0
Else
	; We should never get here
EndIf

; Calculate the edge of the screen, since we're counting pixels from the right, not the left
$Xoffset = $ItemTabOffsetX + $baseX
$TabLocX = $EveWin[2] - $Xoffset
$TabLocY = $ItemTabOffsetY + $baseY

CheckItemsTab()

Func CheckItemsTab()
MouseMove($TabLocX, $TabLocY, 0)
If PixelGetColor($TabLocX, $TabLocY) = Dec($ItemTextColor) AND PixelGetColor($TabLocX, $TabLocY - 3) = Dec($ItemTextColor) Then
	; if we get here, it worked and it's safe to drag
	; let's make sure the items window is selected
	MouseClick("left", $TabLocX, $TabLocY)
Else
	ClickItemsTab()
;	CheckItemsTab()
EndIf
EndFunc
;MouseMove($TabLocY, $TabLocX, 0)
;MsgBox(0, "yay!", "it worked")

Func ClickItemsTab() ; x:1120 y:400 for items @ 1280x1024
	$ClickX = $EveWin[2] - 160
	$ClickY = $baseY + 400
	MouseClick("left", $ClickX, $ClickY)	
EndFunc

;------------------ end of main.au3
;------------------ start of variables.au3
; Main Globals
Global $EveWin
Global $Fullscreen

; Item Defines
Global $ItemTabOffsetX = 192
Global $ItemTabOffsetY = 418
Global $ItemTextColor = "676671" ;7171191