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

Users > Tesuji

mine-leverage

#SingleInstance force

SendMode Play
SetMouseDelay, 10, Play

WindowCount := 0
Sequence := 0

MineCount := 3

timer := 5000

randWindow()
{
  global
  if (Sequence = 0)
  {
    ; Populate new table.
    Loop %WindowCount% {
      RandomList%A_Index% := A_Index
    }

    ; Shuffle.
    ; See The Art of Computer Programming Volume 2, Section 3.4.2, Algorithm P
    j := WindowCount
    Loop %WindowCount% {
      k := 0
      Random, k, 1, j
      temp := RandomList%k%
      RandomList%k% := RandomList%j%
      RandomList%j% := temp
      j := j - 1
    }

    Sequence := WindowCount
  }
  result := RandomList%Sequence%
  Sequence := Sequence - 1
  return result
}

^+a::
WindowCount := WindowCount + 1
x := 0
y := 0
MouseGetPos, x, y
WindowX%WindowCount% := x
WindowY%WindowCount% := y
return

^+x::
WindowCount := 0
Sequence := 0
MsgBox, 0, , % "Clearing Click Positions"
return

^+m::
Loop %MineCount%
{
  Index := randWindow()
  x := WindowX%Index%
  y := WindowY%Index%
  Click %x%, %y%
  Sleep %timer%
}
return

; All are based on CTRL+SHIFT
; P = Pause
; 1 = 0.8 seconds
; 2 = 1.0 seconds
; 3 = 1.0 seconds
; 4 = 1.0 seconds
; 5 = 1.0 seconds
; 6 = 1.0 seconds
; 7 = 1.0 seconds
; 8 = 1.0 seconds
; 9 = 1.0 seconds
; 0 = Starts Mining (Press a time first!)

^+P::
pause
return

^+1::
timer := 800
return

^+2::
timer := 1000
return

^+3::
timer := 1200
return

^+4::
timer := 1400
return

^+5::
timer := 1600
return

^+6::
timer := 1800
return

^+7::
timer := 4000
return

^+8::
timer := 4500
return

^+9::
timer := 5000
return 

cc-leverage

#SingleInstance force

CoordMode, Pixel, Screen
SendMode Play
SetMouseDelay, 10, Play

; Number of columns before going to next row
ColumnCount := 4

; Relative positions of each location.
; Set here permanently or recalibrate every time.
SizeX := 222
SizeY := 239
BeginX := 106
BeginY := 200
WoodX := 33
WoodY := 207
WaterX := 87
WaterY := 209
CloseX := 134
CloseY := 208
MiddleX := 156
MiddleY := 208
OpenX := 179
OpenY := 208

WindowCount := 0
IsCalibrating := false

BaseX(Index)
{
  global ColumnCount
  global SizeX
  return (Floor(Mod(Index, ColumnCount))) * SizeX
}

BaseY(Index)
{
  global ColumnCount
  global SizeY
  return (Floor(Index / ColumnCount)) * SizeY
}

ClickAll(RelX, RelY)
{
  global WindowCount
  Loop %WindowCount%
  {
    x := BaseX(A_Index - 1) + RelX
    y := BaseY(A_Index - 1) + RelY
    ControlClick, X%x% Y%y%, ahk_class eGenesis Client,,,, NA
;    Click %x%, %y%
  }
}

^d::
Suspend Toggle
return

^a::
if IsCalibrating
{
  return
}
; else
  x := 0
  y := 0
  MouseGetPos, x, y
  MouseClickDrag, Left, %x%, %y%, 1, 1
  MouseClickDrag, Left, 1, 1, % BaseX(WindowCount) , % BaseY(WindowCount)
  WindowCount := WindowCount + 1
return

^x::
WindowCount := 0
MsgBox, 0, , % "Clearing Window Positions"
return

^r::
if IsCalibrating
{
  IsCalibrating := false
  MsgBox, 0, , % "Ending Recalibration Mode"
  return
}
; else
  IsCalibrating := true
  MsgBox, 0, , % "Beginning Recalibration Mode. Press Control-h for help."
return

^h::
if IsCalibrating
{
  MsgBox, 0, % "Calibration Mode", % "Calibrate each button hotkey. First, move a Charcoal Oven window to the upper-left corner of the screen. Then move the mouse over each kind of button and press the associated hotkey. Current status:`n"
  . "Size (s): (" . SizeX . ", " . SizeY . ")`n"
  . "Begin (b): (" . BeginX . ", " . BeginY . ")`n"
  . "Wood (w): (" . WoodX . ", " . WoodY . ")`n"
  . "Water(e): (" . WaterX . ", " . WaterY . ")`n"
  . "Close(1): (" . CloseX . ", " . CloseY . ")`n"
  . "Middle(2): (" . MiddleX . ", " . MiddleY . ")`n"
  . "Open (3): (" . OpenX . ", " . OpenY . ")`n`n"
  . "To finish calibrating, press Control-R`n"
  . "Change the appropriate variables in the script to make calibration permanent."
  return
}
; else
  MsgBox, 0, % "Run Mode", % WindowCount . " windows active.`n"
  . "Keys:`n"
  . "Control-a: Add a window and position it. Hover the mouse over the window and press this key. Do not move a window after it has been placed.`n"
  . "Control-x: Clear all window settings. You must set them up again by using control-a on each window.`n"
  . "Control-d: Toggle hotkeys on or off`n"
  . "Control-r: Begin recalibrating relative button positions`n`n"
  . "Control-b: Press Begin on all windows`n"
  . "Control-w: Add wood to all windows`n"
  . "Control-e: Add water to all windows`n"
  . "Control-1: Close all vents`n"
  . "Control-2: Set all vents to partially open`n"
  . "Control-3: Open all vents"
return

^s::
if IsCalibrating
{
  MouseGetPos, SizeX, SizeY
  return
}
; else
return

^b::
if IsCalibrating
{
  MouseGetPos, BeginX, BeginY
  return
}
; else
  ClickAll(BeginX, BeginY)
return

^w::
if IsCalibrating
{
  MouseGetPos, WoodX, WoodY
  return
}
; else
  ClickAll(WoodX, WoodY)
return

^e::
if IsCalibrating
{
  MouseGetPos, WaterX, WaterY
  return
}
; else
  ClickAll(WaterX, WaterY)
return

^1::
if IsCalibrating
{
  MouseGetPos, CloseX, CloseY
  return
}
; else
  ClickAll(CloseX, CloseY)
return

^2::
if IsCalibrating
{
  MouseGetPos, MiddleX, MiddleY
  return
}
; else
  ClickAll(MiddleX, MiddleY)
return

^3::
if IsCalibrating
{
  MouseGetPos, OpenX, OpenY
  return
}
; else
  ClickAll(OpenX, OpenY)
return

Home | Atlas | Guides | Tests | Research | Techs | Skills | Index | Recent Changes | Preferences | Login
You must log in to edit pages. | View other revisions
Last edited April 13, 2008 2:30 am by Tesuji (diff)
Search: