The Wiki for Tale 4 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.

If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.

Difference between revisions of "User:Nisu Bastet/macro/quarry"

From A Tale in the Desert
Jump to navigationJump to search
Line 14: Line 14:
  
 
;The y coordinate of each dash (coords relative to window)
 
;The y coordinate of each dash (coords relative to window)
/*
 
 
y1 := 95 ;plus 27 mit titelbar (68)
 
y1 := 95 ;plus 27 mit titelbar (68)
 
y2 := 111 ;plus  mit titelbar  
 
y2 := 111 ;plus  mit titelbar  
 
y3 := 127 ;plus  mit titelbar
 
y3 := 127 ;plus  mit titelbar
 
y4 := 143 ;plus  mit titelbar
 
y4 := 143 ;plus  mit titelbar
*/
 
y1 := 111 ;gildenquarry +16
 
y2 := 127
 
y3 := 143
 
y4 := 159
 
  
 
Loop
 
Loop
Line 29: Line 23:
 
   IfWinActive, eGenesis Client
 
   IfWinActive, eGenesis Client
 
   {
 
   {
     if ( endTimer() = 0 and GetKeyState("LButton") = 0 )
+
 
 +
;start of endtimer check
 +
 
 +
PixelGetColor, endu01, 18, 937 ; get pixel of end timer in skill window
 +
      Sleep, 400
 +
     if ( endu01 != 0x0000FF and GetKeyState("LButton") = 0 )
 +
   
 +
; end of endtimer check
 +
 
 
     {
 
     {
 
       BlockInput, MouseMove
 
       BlockInput, MouseMove
Line 187: Line 189:
  
  
 
+
eatfish()
eatFish()
 
 
{
 
{
 
   PixelGetColor, color, 199, 911  ;checks endurance
 
   PixelGetColor, color, 199, 911  ;checks endurance
Line 205: Line 206:
  
  
endTimer()
 
{
 
WinGetPos, , , w, h, eGenesis Client
 
  ImageSearch, , , w-300, 0, w, 200, end.png
 
  if ErrorLevel = 0 ;bild da
 
  {
 
    return 1
 
  }
 
  if ErrorLevel = 1 ;bild nicht da
 
  {
 
    return 0
 
  }
 
  return 2
 
}
 
;end marmor macro inclusiv function
 
  
  
 
</pre>
 
</pre>

Revision as of 18:43, 15 May 2010

AHK Macro

Quarry macro from T3
need to adjust end timer
...



^+m:: ;Strg Shift m marmor marble
;Position of this quarry worker: 1 through 4
myPosition := 1 ; ich bin der erste der in der alphabetischen reihenfolge klicken muss

;The y coordinate of each dash (coords relative to window)
y1 := 95 ;plus 27 mit titelbar (68)
y2 := 111 ;plus  mit titelbar 
y3 := 127 ;plus  mit titelbar
y4 := 143 ;plus  mit titelbar

Loop
{
  IfWinActive, eGenesis Client
  {

;start of endtimer check

 PixelGetColor, endu01, 18, 937 ; get pixel of end timer in skill window
      Sleep, 400
    if ( endu01 != 0x0000FF and GetKeyState("LButton") = 0 )
    
; end of endtimer check

    {
      BlockInput, MouseMove
      MouseGetPos, MouseX, MouseY
      
      ;An empty part of the quarry window where it will click to refresh the window
      MouseClick, right, 70, 57, 1, 0
;      MouseMove, MouseX, MouseY, 0
      BlockInput, MouseMoveOff
      Sleep, 400


      yCount := 0
      Loop, 4
      {
        yCount += 1
  
        ;163 is the x coordinate of the beginning of the -- dash after 'Eastern'
        count := 164
        Loop, 14
        {
          PixelGetColor, color%count%, count, y%yCount%
          count += 1
        }

        ;same as above
        count := 164
        match := 0
        Loop, 14
        {
          if ( match = 4 and color%count% != 0 )
          {
            lastPixel := count - 1
          }
          if ( color%count% = 0 )
          {
            match += 1
          }
          else
          {
            match := 0
          }
          count += 1
        }
    
        position%yCount% := 0
    
        ; Here the numbers 166, 171, 173, and 175 are the x coords of the *last* pixel of each dash...
        ; 166 is the dash after Eastern, 171 after Western, 173 after Northern, 175 after Southern 
; mel: x+4-3 y+34
        
        if ( lastPixel = 167 ) ;east
        {
          position%yCount% := 0
        }
        if ( lastPixel = 174 ) ;north
        {
          position%yCount% := 4
        }
        if ( lastPixel = 176 ) ;south
        {
          position%yCount% := 8
        }
        if ( lastPixel = 172 ) ;west
        {
          position%yCount% := 12
        }
        PixelGetColor, color1, lastPixel+3, y%yCount%-4
        PixelGetColor, color2, lastPixel+3, y%yCount%+4
        PixelGetColor, color3, lastPixel+3, y%yCount%+1
        PixelGetColor, color4, lastPixel+2, y%yCount%+3

        if ( color1 = 0 and color2 = 0 )
        {
          position%yCount% += 1
        }
        if ( color1 != 0 and color2 = 0 )
        {
          position%yCount% += 2
        }
        if ( color3 = 0 )
        {
          position%yCount% += 3
        }
        if ( color4 != 0 )
        {
          position%yCount% += 4
        }

      }

    
      count := 16
      place := 5
      Loop, 16
      {
        if ( position1 = count )
        {
          place -= 1
          if ( place = myPosition )
          {
            clickPosition := 1
            break
          }
        }
        if ( position2 = count )
        {
          place -= 1
          if ( place = myPosition )
          {
            clickPosition := 2
            break
          }
        }
        if ( position3 = count )
        {
          place -= 1
          if ( place = myPosition )
          {
            clickPosition := 3
            break
          }
        }
        if ( position4 = count )
        {
          place -= 1
          if ( place = myPosition )
          {
            clickPosition := 4
            break
          }
        }
        count -= 1
      }

;    ToolTip, lastPixel: %lastPixel%`nposition1: %position1%`nposition2: %position2%`nposition3: %position3%`nposition4: %position4%`nclickPosition: %clickPosition%, 500, 0, 5
      
      if ( lastPosition1 != position1 or lastPosition2 != position2 or lastPosition3 != position3 or lastPosition4 != position4 )
      {
        eatFish()

 ;       MouseGetPos, MouseX, MouseY

        MouseClick, right, 34, y%clickPosition%, 1, 0 ;clicks quarry
;        MouseMove, MouseX, MouseY, 0
      }
      lastPosition1 := position1
      lastPosition2 := position2
      lastPosition3 := position3
      lastPosition4 := position4
    }
  }
  Sleep, 1000
}
return



eatfish()
{
  PixelGetColor, color, 199, 911  ;checks endurance
;geschicke kleinziehen aber nicht schliessen
  PixelGetColor, color2, 257, 898  ;checks if food avaible
;konsume gegrillten fisch neben geschicke fenster unten
  if ( color != 0 and color2 = 0 )
  {
    MouseGetPos, MouseX, MouseY
    MouseClick, right, 354, 902, 1, 0
    MouseMove, MouseX, MouseY, 0
    return 1
  }
  return 0
}