Search: Home | Atlas | Guides | Tests | Research | Techs | Skills | Index | Recent Changes | Preferences | Login

Users > Spoiled > Mining VA 0.9

This macro will randomly choose a spot in a window you define and send "w" to work a mine, until the timers are displayed. Because the timer is so short, it frequently interrupts chat, but if you mainly want to read or just mine some on the side instead of having in-depth DP discussions, this macro will work and be simple about it.

For some reason, I didn't get the toggle functionality to work with this one, so there are separate "Pause/Unpause" and "Reload" hotkeys. You will need the images "Str.bmp" and "Per.bmp" in the same directory as the macro. They're attached to this page at the bottom.

Controls:


#IfWinActive, eGenesis Client
SendMode Input
SetDefaultMouseSpeed, 0
CoordMode, Mouse, Screen

WinActivate, eGenesis Client
WinGetPos,,, winWidth, winHeight, A
searchx1 := winWidth - 200
searchx2 := winWidth


^!+p::Pause
^!+r::Reload

^!n::
WinActivate, eGenesis Client
Gui, +AlwaysOnTop +ToolWindow
Gui, Add, Text,, Hover over the middle of your mine hole/entry, enter your minimal expected timer, press Enter
Gui, Add, Edit, vDelay, 4000
Gui, Add, Button, default gSetPoint, OK
Gui, Show
return

SetPoint:
Gui, Submit
Gui, Destroy
MouseGetPos, hx, hy
Gui, +AlwaysOnTop +ToolWindow
Gui, Add, Text,, And now how far you want to spread from that point randomly(producing a rectangle with the middle in the middle, yes).
Gui, Add, Button, default gSetSpread, OK
Gui, Show
return

SetSpread:
Gui, Submit
Gui, Destroy
MouseGetPos, sx, sy
distancex := abs(hx - sx)
distancey := abs(hy - sy)
;if (distancex > distancey)
;	distancey := distancex
;else
;	distancex := distancey

WinActivate, eGenesis Client
return

#MaxThreadsPerHotkey 3
^!m::
#MaxThreadsPerHotkey 1
if KeepRunning
{
	KeepRunning := false
	return
}
KeepRunning := true
Happened := false
loop
{
	WinGetTitle, OtherWindow, A	
	WinActivate, eGenesis Client
	loop {
		ImageSearch,,, %searchx1%, 68, %searchx2%, 120, *2 Str.bmp
		if (ErrorLevel = 1)
		{
			ImageSearch,,, %searchx1%, 68, %searchx2%, 120, *2 Per.bmp
			if (ErrorLevel = 1)	
				break
		}
		else
			sleep 25
	}
	MouseGetPos, mosx, mosy
	
	loop {							;Randomize modifiers and distance from the middle.
		Random, mod1, -1, 1
		if (mod1 != 0)
		{
			loop{
				Random, mod2, -1, 1
				if (mod2 != 0)
					break
			}
		break
		}
	}
	Random, dx,, %distancex%
	Random, dy,, %distancey%
	px := hx + (mod1 * dx)
	py := hy + (mod2 * dy)

	MouseMove, %px%, %py%
	sleep 50
	Send w
	sleep 100
	ImageSearch,,, 1100, 68, 1284, 120, *2 Str.bmp
	if (ErrorLevel = 1)
	{
		if (Happened = true)
		{
			sleep 200
			Send {Enter}
			Happened := false
			continue
		}
		sleep 200
		Send {Enter}
		sleep 200
		Send {Enter}
		Happened := true		;To get out of possible loop
		continue
	}
	MouseMove, %mosx%, %mosy%
	WinActivate, %OtherWindow%
	if not KeepRunning  
		break
	sleep %Delay%
}
KeepRunning := false
return

Home | Atlas | Guides | Tests | Research | Techs | Skills | Index | Recent Changes | Preferences | Login
This page is read-only | | Create/Edit another page | View other revisions
Last edited July 24, 2006 1:51 pm by Spoiled (diff)
Users must be logged in to edit this page.
Search: