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.

User:Nisu Bastet/macro/combined

From A Tale in the Desert
Jump to navigationJump to search

intro

ubar mega big multi macro
just for copy paste, some are double
all are for AHK
3 different text files, seperated with ---
most macros needs ADD macros or FILE macros to help
check if macro contains a filename or a () in it

basic settings, needed by all macros


^+[:: ;STRG SHIFT [
WinSet, Region, , A
return

^+d:: ;STRG SHIFT d
Winset, Disable, , A
return

^+]:: ;STRG SHIFT ]
Winset, Enable, , A
return

^+e::Edit
;STRG SHIFT E

^+q::Pause, Toggle
;STRG SHIFT Q

^+r::Reload
;STRG SHIFT R


^+x::ExitApp 
; Exit macro  strg shift X

end click t3


; Atitd autohotkey macros
; watched for End timer and clicks when it runs out
; waits until mouse is not moving
^#d:: ;STRG WIN D
Loop
{
  IfWinactive, eGenesis Client
  {    
    MouseGetPos, MouseX, MouseY
    Sleep, 100
    MouseGetPos, MouseX2, MouseY2
    DX = 0
    DY = 0
    DX += %MouseX%
    DX -= %MouseX2%
    DY += %MouseY%
    DY -= %MouseY2%
      if DX = 0
      {
        if DY = 0
        {
  
MouseGetPos, MousX, MousY
endadd()
;conadd()
Mousemove, MousX, MousY
     
	}
    }
  }
  Sleep, 400
}
return


constituion adding t3


conadd()
{
if contimer() = 0
{
sleep 200
FileReadLine, conX, C:\ATITD2.txt, 1
FileReadLine, cony, C:\ATITD2.txt, 2
mouseclick, right, conX, conY, 1, 0
sleep 200
}
}


focus adding t3


focadd()
{
if foctimer() = 0
{
sleep 200
FileReadLine, focX, C:\ATITD2.txt, 1
FileReadLine, focy, C:\ATITD2.txt, 2
mouseclick, right, focX, focY, 1, 0
sleep 200
}
}

endurance adding t3


endadd()
  {  
    if endtimer() = 0
    {    
;eatfish()
sleep 200
;send s
MouseClick, right ;,632, 125 , 1, 0
sleep 200
        }
      }
return


strength adding t3


stradd()
  {  
    if strtimer() = 0
    {  
sleep 300
	MouseClick, right, 330, 488, 1, 0
sleep 300
        }
      }
return



papyrus planting t3



^+j:: ;strg shift j
;papy säen
Loop
{
  IfWinActive, eGenesis Client
  {   
;checks for 0 in /clockloc
;Null is 5 coords wide
;Null is 3 coord high
pixelgetcolor, null0, 686, 55 ;000000
pixelgetcolor, null1, 686, 58 ;
pixelgetcolor, null2, 691, 55
pixelgetcolor, null3, 691, 58 ;000000
pixelgetcolor, null4, 684, 55 ;000000
pixelgetcolor, null5, 684, 58 ;
pixelgetcolor, null6, 689, 55
pixelgetcolor, null7, 689, 58 ;000000
pixelgetcolor, null08, 683, 55 ;000000
pixelgetcolor, null09, 683, 58 ;
pixelgetcolor, null10, 688, 55
pixelgetcolor, null01, 688, 58 ;000000
pixelgetcolor, null02, 681, 55 ;000000
pixelgetcolor, null03, 681, 58 ;
pixelgetcolor, null04, 686, 55
pixelgetcolor, null11, 686, 58 ;000000
sleep 50
if (null0 = 0 or null4 = 0 or null08 = 0 or null01 = 0)
{
if (null1 = 0 or null5 = 0 or null09 = 0 or null02 = 0)
{
if (null2 = 0 or null6 = 0 or null10 = 0 or null03 = 0)
{
if (null3 = 0 or null7 = 0 or null11 = 0 or null04 = 0)
{
  FileReadLine, filelineY, C:\ATITD2.txt, 2
  if ( ErrorLevel <> 0 or filelineY = "" )
  {
    break
  }
      FileReadLine, filelineX, C:\ATITD2.txt, 1
    MouseGetPos, MouseX, MouseY
sleep 120
      Mouseclick, right, %filelineX%, %filelineY%, 1, 0
      Sleep, 120
    MouseMove, MouseX, MouseY
sleep 5000
    }
}
}
}
}
}
return


carving t3



;needs add macros from t3
;schnitzen
^+p:: ;strg shift p
Loop
{
  IfWinActive, eGenesis Client
  {   
endadd()   
if foctimer() = 0 ;<=====
{
  FileReadLine, filelineY, C:\ATITD2.txt, 2
  if ( ErrorLevel <> 0 or filelineY = "" )
  {
    break
  }
      FileReadLine, filelineX, C:\ATITD2.txt, 1
    MouseGetPos, MouseX, MouseY
sleep 120
      Mouseclick, right, %filelineX%, %filelineY%, 1, 0
      Sleep, 120
    MouseMove, MouseX, MouseY
    }
  } 
sleep 500
}
return


general file handle


;is needed by other macros !
; for carving macro...
^9:: ;STRG 9  -löschen
FileDelete, C:\ATITD2.txt
return

position save to file


;is needed by other macros !
; for carving macro...
^0:: ;STRG 0  -nimmt koords
MouseGetPos, MouseX, MouseY
FileAppend, %MouseX%`n, C:\ATITD2.txt
FileAppend, %MouseY%`n, C:\ATITD2.txt
return

carpentry shop


; boards bretter
; zimmerei carpentry.. uses unlimited spots and clicks permanent
; needs macro *position save to file* too
;mark spots with macro above
; need chat have minimized and use hotkey

^+u:: ;STRG shift U 
i = 2
Loop
{  
  IfWinActive, eGenesis Client
  {
  FileReadLine, filelineY, C:\ATITD2.txt, %i%  
  if ( ErrorLevel <> 0 or filelineY = "" )
  	{
	if i=2
		{
 		break
		}
	  else 
		{
    		i = 2   
		} 
  	}
  else 
	{
	line := i-1
	FileReadLine, filelineX, C:\ATITD2.txt, %line%
      Mousemove, %filelineX%, %filelineY%
      Sleep, 50
send, P
	i := i+2
      }
}
}
return

runs between saved spots


; runs between saved spots
^#g:: ;STRG WIN G
i = 2
Loop
{  
  IfWinActive, eGenesis Client
  {
  FileReadLine, filelineY, C:\ATITD2.txt, %i%  
  if ( ErrorLevel <> 0 or filelineY = "" )
  	{
	if i=2
		{
 		break
		}
	  else 
		{
    		i = 2   
		} 
  	}
  else 
	{
	line := i-1
	FileReadLine, filelineX, C:\ATITD2.txt, %line%
      Mousemove, %filelineX%, %filelineY%
      sleep, 1300
      Mouseclick, left, %filelineX%, %filelineY%
      Sleep, 1550
	i := i+2
      }
}
}
return




brick racks stuff



;same as above carpentry shop macro, but more hotkeys used
; bricks firebricks ziegel
!8:: ;alt 8 
i = 2
Loop
{  
  IfWinActive, eGenesis Client
  {
  FileReadLine, filelineY, C:\ATITD2.txt, %i%  
  if ( ErrorLevel <> 0 or filelineY = "" )
  	{
	if i=2
		{
 		break
		}
	  else 
		{
    		i = 2   
		sleep 7000
		} 
  	}
  else 
	{
	line := i-1
	FileReadLine, filelineX, C:\ATITD2.txt, %line%
      Sleep, 100
      Mousemove, %filelineX%, %filelineY%
      Sleep, 100
send, t
      Sleep, 100
send, b ; for bricks
; send, C ; for wet clay bricks
; send, f ; for wet fire bricks
	i := i+2
;popup() ; use this only if works on your screen settings
      }
}
}
return


popup()
{
pixelgetcolor,pop, 646, 576  ; might not work
if pop = 0
{
MsgBox, Pop Up !
}
}
return

brick racks stuff


^8:: ;STRG 8  acro moves 4 time each
i = 2
Loop
{  
  IfWinActive, eGenesis Client
  {
loop, 2
{
  FileReadLine, filelineY, C:\ATITD2.txt, %i%  
  if ( ErrorLevel <> 0 or filelineY = "" )
  	{
	if i=2
		{
 		break
		}
	  else 
		{
    		i = 2   
		} 
  	}
  else 
	{
	line := i-1
	FileReadLine, filelineX, C:\ATITD2.txt, %line%
      Mouseclick, right, %filelineX%, %filelineY% ,1 ,0      
Sleep, 8000
} 
}
	i := i+2     
}
}
return



Mining t3




; mining
; just random clicking on saved coords
^#!d:: ;STRG WIN ALT D
i = 0
count = 0
Loop
{
  i += 1
  FileReadLine, fileline, C:\ATITD.txt, %i%
  
  if ( ErrorLevel <> 0 or fileline = "" )
  {
    i -= 1
    break
  }
}
filelineYPrev = ""
Loop
{
  IfWinActive, eGenesis Client
  {
    if ( strtimer() = 0 and pertimer() = 0 )
    {
      j:= Floor(i/2)
      Random, line, 1, %j%
      line *= 2
      FileReadLine, filelineY, C:\ATITD.txt, %line%
      if filelineYPrev != ""
      {
        ;MsgBox, %filelineY%, %filelineYPrev%
        if filelineY = %filelineYPrev%
        {
          continue
        }
      }
      filelineYPrev = %filelineY%
      line -= 1
      FileReadLine, filelineX, C:\ATITD.txt, %line%
      MouseMove, %filelineX%, %filelineY%
      Sleep, 100
;ab hier kann man auch  send, w
; MouseGetPos, MouseX, MouseY
 ;MouseClick, right
 ;Sleep, 200
 ;MouseClick, right, MouseX+30, MouseY-5, 1, 0
;bis hier wahlweise 
send, w
    }
  }
  Sleep, 700
;endadd()  ;deepwell
}
return


smelter


;smelter schmelztopf
!1:: ;alt 1 
Send T
sleep 150
MouseClick, L, 0, 0, 1, 0, , R 
Sleep, 150 
MouseClick, L, 30, 0, 1, 0, , R 
Sleep, 150
MouseMove -30, 0, 0,R 
Sleep, 150
Send, 25
Sleep, 150
send {enter} 
Sleep, 150 
MouseClick, L, 0, 0, 1, 0, , R 
Sleep, 150 
MouseClick, L, 30, 10, 1, 0, , R 
Sleep, 150
MouseMove -30, -10, 0,R 
Sleep, 150
Send, 94
Sleep, 150
send {enter} 
Sleep, 150 
MouseClick, L, 0, 0, 1, 0, , R 
Sleep, 150 
MouseClick, L, 30, -20, 1, 0, , R 
Sleep, 150
MouseMove -30, 20, 0,R 
Sleep, 200
send t
return


Max dropdown menu


!4:: ;alt 4    checks for Max-dropdown menu and clicks it
loop
{
  IfWinActive, eGenesis Client
  {
pixelgetcolor, max1, 634, 524
pixelgetcolor, max2, 634, 518
pixelgetcolor, max3, 713, 505
sleep 100
if (max1 = 0 and max2 = 0 and max3 = 0)
{
 MouseGetPos, MouseX, MouseY
sleep 50
mouseclick, right, 650, 525
sleep, 200
mousemove, mousex, mousey
}
else
{
sleep 350
}
}
}
return



kettles


;kettles  wasserkessel
!3:: ;alt 3 
  IfWinActive, eGenesis Client
  {
mousegetpos, mouseX, mouseY
MouseClick, R, 0, 0, 1, 0, , R 
Sleep, 150 
MouseClick, R, 50, 90, 1, 0, , R 
Sleep, 150
MouseClick, right, 645, 520, 1, 0 
Sleep, 150 
MouseClick, right, 665,75, 1, 0 
Sleep, 150 
mousemove, mouseX, mouseY
}
return


hookah



!5:: ;alt 5  rauchen
loop
{
  IfWinActive, eGenesis Client
  {
conadd()
}
}
return


auto run


; Auto run  autorun
^#1:: ;STRG win 1
Loop
{
  IfWinActive, eGenesis Client
  {
    MouseClick, Left
    Sleep, 43000
  }
  Sleep, 100
}
return


pigment lab


; special, needs to be set by your color settings
; for the idea the coords are from my scree
;pigment lab window must be top left
;makes colors... Farben

^+g:: ; strg shift g
IfWinActive, eGenesis Client
  {
loop,788 
{
;here the coords of the points u have to click for each incredient, maybe different at your place
; cabbage 276.... carrot 294 ... Clay 312
; deadtong 330 ... toadskin 348 .. earthlight 366
; redsand 384 ... lead 402 ... silver 420
; iron 438 ... copper 456 ... sulfur 474
; potash 492 ... lime 510 ... saltpeter 528

;gold=gold
;9 Carrot, 1 Sulfur, 1 Lime, 1 Saltpeter, 1 Clay
; below special color, to get the idea how it works

mouseclick, right, 21, 384, 1, 0 
		sleep 150
mouseclick, right, 21, 384, 1, 0 
		sleep 150
mouseclick, right, 21, 384, 1, 0 
		sleep 150 
mouseclick, right, 21, 384, 1, 0 
		sleep 150
mouseclick, right, 21, 384, 1, 0 
		sleep 150
mouseclick, right, 21, 384, 1, 0 
		sleep 150
mouseclick, right, 21, 384, 1, 0 
		sleep 150
mouseclick, right, 21, 384, 1, 0 
		sleep 150
mouseclick, right, 21, 384, 1, 0 
		sleep 150
mouseclick, right, 21, 384, 1, 0 
		sleep 1000
mouseclick, right, 95, 95, 1, 0 ;take color
		sleep 1000
}
}


grass t3



; grass macro
; clicks on grass icon when you move your mouse over it
^#p:: ;STRG WIN p
Loop
{
  IfWinActive, eGenesis Client
  {
    Sleep, 100
    PixelGetColor, color4, 1177, 68    
    if color4 = 0x9BCEFB
    {
      MouseGetPos, MouseX3, MouseY3
      BlockInput, MouseMove
	mousemove, 1200, 40
      sleep, 50
      if color4 = 0x9BCEFB
      {
	MouseClick, right, 1200, 40, 1, 0
      }
 	MouseMove, %MouseX3%, %MouseY3%, 0
      BlockInput, MouseMoveOff
      Sleep, 2500
    }
  }
}
return


acro t3


; Acro. Clicks every 7 seconds. will wait until mouse stops moving before clicking.
^#b:: ;STRG WIN b
Loop
{
  IfWinActive, eGenesis Client
  {
    MouseGetPos, MouseX, MouseY
    Sleep, 200
    MouseGetPos, MouseX2, MouseY2
    DX = 0
    DY = 0
    DX += %MouseX%
    DX -= %MouseX2%
    DY += %MouseY%
    DY -= %MouseY2%
    if DX = 0
    {
      if DY = 0
      {
        MouseClick, left
        Sleep, 8500
      }
    }

  }
}
return

clay t3


; clay gathering. a lot like the grass macro
^#c:: ;STRG WIN c
Loop
{
  IfWinActive, eGenesis Client
  {

    MouseGetPos, MouseX6, MouseY6
/*
    WinGetPos, x, y, w, h, eGenesis Client
    MouseGetPos, MouseX6, MouseY6
    DX = %w%
    DX -= %MouseX6%
    if DX < 132
    {
      if MouseY6 < 122
      {
        if DX > 68
        {
*/
          PixelGetColor, color9, 1178, 62
          if color9 = 0x1E19C5
          {
            MouseClick, left, 1178, 62, 1, 0
sleep 50
Mousemove, MouseX6, MouseY6
            Sleep, 900
          }
        }
/*
      }
    }
  }
*/
  Sleep, 100
}
return

fishing t3


; fishing
; eats grilled cabbage when off, 
; needs eat macro for it too
^#f:: ;STRG WIN f
Loop
{
  IfWinActive, eGenesis Client
  {
    WinGetPos, x, y, w, h, eGenesis Client
    MouseGetPos, MouseX6, MouseY6
    DX = %w%
    DX -= %MouseX6%
    if MouseY6 < 122
    {
eatfish()
      MouseClick, left
      Sleep, 18000
    }
  }
  Sleep, 10
}
return


onionhelper t3


!Y:: ;alt Y   zwiebel making, grass
  IfWinActive, eGenesis Client
  {
MouseClick, R, 0, 0, 1, 0, , R ; clickt wo Mauszeiger steht
Sleep, 120 
;MouseClick, R, 30, +5, 1, 0, , R ;onions
MouseClick, R, 30, -25, 1, 0, , R ;gras
}
return


flaxhelper t3


!<:: ;alt <  flax making
  IfWinActive, eGenesis Client
  {
MouseClick, R, 0, 0, 1, 0, , R ; clickt wo Mauszeiger steht
Sleep, 120 
MouseClick, R, 30, -5, 1, 0, , R  ;flax
}
return


building menu t3/t4


;uses numpad arrow keys and others

; baumenu
^Numpad8::
  IfWinActive, eGenesis Client
  {
mousemove, 63, 80
sleep, 20
mouseclick, left
}
return

^Numpad4::
  IfWinActive, eGenesis Client
  {
mousemove, 41, 104
sleep, 20
mouseclick, left
}
return

^Numpad6::
  IfWinActive, eGenesis Client
  {
mousemove, 84, 104
sleep, 20
mouseclick, left
}
return

^Numpad2::
  IfWinActive, eGenesis Client
  {
mousemove, 65, 127
sleep, 20
mouseclick, left
}
return

^Numpad7::
  IfWinActive, eGenesis Client
  {
mousemove, 49, 86
sleep, 20
mouseclick, left
}
return

^Numpad9::
  IfWinActive, eGenesis Client
  {
mousemove, 79, 90
sleep, 20
mouseclick, left
}
return

^Numpad3::
  IfWinActive, eGenesis Client
  {
mousemove, 82, 121
sleep, 20
mouseclick, left
}
return

^Numpad1::
  IfWinActive, eGenesis Client
  {
mousemove, 49, 117
sleep, 20
mouseclick, left
}
return

^Numpad5:: ;strg numpad5 bauen
  IfWinActive, eGenesis Client
  {
mousemove, 40, 165
sleep, 20
mouseclick, left
}
return

^*:: ;strg shift *    rotating
  IfWinActive, eGenesis Client
  {
mousemove, 87, 46
sleep, 20
mouseclick, left
}
return


slate t3



;Looks for slate icon in two locations,
;moves the mouse to it and clicks on it
;then moves the mouse back
^#s:: ;STRG WIN s
Loop
{
  IfWinActive, eGenesis Client
  {
    Sleep, 80
    PixelGetColor, color2, 1044, 115
    PixelGetColor, color3, 1110, 114
    PixelGetColor, color4, 980, 114
    if color2 = 0x575757
    {
      MouseGetPos, MouseX3, MouseY3
      BlockInput, MouseMove
      Mouseclick, right, 1050, 74, 1, 0
      MouseMove, %MouseX3%, %MouseY3%, 0
      BlockInput, MouseMoveOff
      Sleep, 1000
    }
    if color3 = 0x575757
    {
      MouseGetPos, MouseX3, MouseY3
      BlockInput, MouseMove
      Mouseclick, right, 1113, 70, 1, 0
      MouseMove, %MouseX3%, %MouseY3%, 0
      BlockInput, MouseMoveOff
      Sleep, 1000
    }
    if color4 = 0x575757
    {
      MouseGetPos, MouseX3, MouseY3
      BlockInput, MouseMove
      Mouseclick, right, 980, 114, 1, 0
      MouseMove, %MouseX3%, %MouseY3%, 0
      BlockInput, MouseMoveOff
      Sleep, 1000
    }

  }
}
return


endurance helper t3


; ONLY ONE click for end timer, eats fish/onions
; needs eat macro

^+k:: ;strg shift k 
MouseGetPos, MouseX0, MouseY0
Loop
{
  IfWinActive, eGenesis Client
  {
    if ( endTimer() = 0 and GetKeyState("LButton") = 0 )
    {
      eatFish()
      Sleep, 200
      MouseGetPos, MouseX, MouseY
      MouseClick, right, MouseX0, MouseY0, 1, 0
      MouseMove, MouseX, MouseY, 0
      Reload
    }
  }
  Sleep, 200
}


marble t3


;needs lots of adjusting on your PC!
;needs eat macro and end macro
^+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)
/*
;private quarry
y1 := 95 ;plus 27 mit titelbar (68)
y2 := 111 ;plus  mit titelbar 
y3 := 127 ;plus  mit titelbar
y4 := 143 ;plus  mit titelbar
*/
;gildenquarry +16
y1 := 111 
y2 := 127 
y3 := 143 
y4 := 159 

Loop
{
  IfWinActive, eGenesis Client
  {
    if ( endTimer() = 0 and GetKeyState("LButton") = 0 )
    {
      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


eat macro t3


;needed by lot of macros above

eatFish() ; or onions
{
  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
}

end macro t3


;needed by lot of macros above
; needs picture, useless in t4
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
}


focus macro t3


;needed by lot of macros above

; needs picture, useless in t4

focTimer()
{
WinGetPos, , , w, h, eGenesis Client
  ImageSearch, , , w-200, 100, w, 200, foc.png
  if ErrorLevel = 0 ;bild da
  {
    return 1
  }
  if ErrorLevel = 1 ;bild nicht da
  {
    return 0
  }
  return 2
}

perception macro t3


;needed by lot of macros above

; needs picture, useless in t4

perTimer()
{
WinGetPos, , , w, h, eGenesis Client
  ImageSearch, , , w-300, 0, w, 200, per.png
  if ErrorLevel = 0 ;bild da
  {
    return 1
  }
  if ErrorLevel = 1 ;bild nicht da
  {
    return 0
  }
  return 2
}

strength macro t3


;needed by lot of macros above

; needs picture, useless in t4

strTimer()
{
WinGetPos, , , w, h, eGenesis Client
  ImageSearch, , , w-300, 0, w, 200, str.png
  if ErrorLevel = 0 ;bild da
  {
    return 1
  }
  if ErrorLevel = 1 ;bild nicht da
  {
    return 0
  }
  return 2
}


constitution macro t3


;needed by lot of macros above

; needs picture, useless in t4

conTimer()
{
WinGetPos, , , w, h, eGenesis Client
  ImageSearch, , , w-300, 0, w, 200, cons.png
  if ErrorLevel = 0 ;bild da
  {
    return 1
  }
  if ErrorLevel = 1 ;bild nicht da
  {
    return 0
  }
  return 2
}


image test macro t3


; needs picture, just for testing on macro technics
; only for pro



^+l:: ;strg shift L -imagesearch test
{
/*
SendMessage, 0x201, 0, 65536*MouseY+MouseX, , eGenesis Client ;mouse down screen coords
SendMessage, 0x202, 0, 65536*MouseY+MouseX, , eGenesis Client ;mouse up screen coords
SendMessage, 0x201, 0, 65536*354+243, , eGenesis Client ;mouse down
SendMessage, 0x202, 0, 65536*354+243, , eGenesis Client ;mouse up
SendMessage, 0x201, 0, 65536*84+213, , eGenesis Client ;mouse down
SendMessage, 0x202, 0, 65536*84+213, , eGenesis Client ;mouse up
SendMessage, 0x201, 0, 65536*93+473, , eGenesis Client ;mouse down
SendMessage, 0x202, 0, 65536*93+473, , eGenesis Client ;mouse up
sleep 10

}
return
*/

loop
IfWinActive, eGenesis Client
  {
WinGetPos, , , w, h, eGenesis Client

  ImageSearch, , , w-300, 0, w, 200, foc.png
MsgBox, ErrorLevel: %ErrorLevel%

  if ErrorLevel = 0 ;bild da
  {
    send 0
  }

  if ErrorLevel = 1 ;bild nicht da
  {
    send 1
  }

;errorlevel = 2 ; bildfile fehlt
sleep, 990
}
}
return



smelter afk macro t3



;smelter auto use
!2:: ;ALT 2   
i = 2
Loop
{  
  IfWinActive, eGenesis Client
  {
  FileReadLine, filelineY, C:\ATITD2.txt, %i%  
  if ( ErrorLevel <> 0 or filelineY = "" )
  	{	
 		break
  	}
  else 
	{
	line := i-1
	FileReadLine, filelineX, C:\ATITD2.txt, %line%
      Mousemove, %filelineX%, %filelineY%
      Sleep, 250
send, t
      Sleep, 250
MouseClick, L, 0, 0, 1, 0, , R 
Sleep, 250 
MouseClick, L, 30, 0, 1, 0, , R 
Sleep, 250
MouseMove -30, 0, 0,R 
Sleep, 250
Send, 25
Sleep, 250
send {enter} 
Sleep, 250 
MouseClick, L, 0, 0, 1, 0, , R 
Sleep, 250 
MouseClick, L, 30, 10, 1, 0, , R 
Sleep, 250
MouseMove -30, -10, 0,R 
Sleep, 250
Send, 94
Sleep, 250
send {enter} 
Sleep, 250 
MouseClick, L, 0, 0, 1, 0, , R 
Sleep, 250 
MouseClick, L, 30, -20, 1, 0, , R 
Sleep, 250
MouseMove -30, 20, 0,R 
Sleep, 1000
	i := i+2

}
}
}
return



cc manual macro t3



;holzkohle CC charcoal
; ---->> OVEN set on guild  <<-----
^+1:: ;strg shift 1   wood add
  IfWinActive, eGenesis Client
  {
MouseClick, right, 40, 254, 1, 0 ;oven
sleep, 15
MouseClick, right, 285, 254, 1, 0 ;245
sleep, 15 
MouseClick, right, 530, 254, 1, 0 ;245
sleep, 15
MouseClick, right, 775, 254, 1, 0 ;new line
sleep, 15
MouseClick, right, 40, 508, 1, 0
sleep, 15
MouseClick, right, 285, 508, 1, 0
sleep, 15
}
return

;holzkohle wasser
^+2:: ;strg shift 2   h2o
  IfWinActive, eGenesis Client
  {
MouseClick, right, 90, 254, 1, 0 ;245
sleep, 20
MouseClick, right, 335, 254, 1, 0 ;245
sleep, 20
MouseClick, right, 580, 254, 1, 0 ;245
sleep, 20
MouseClick, right, 825, 254, 1, 0 ;new line
sleep, 20
MouseClick, right, 90, 508, 1, 0
sleep, 20
MouseClick, right, 335, 508, 1, 0
sleep, 20
}
return

;cc close air 134
^+3:: ;strg shift 3
  IfWinActive, eGenesis Client
  {
MouseClick, right, 134, 254, 1, 0 ;245
sleep, 20
MouseClick, right, 379, 254, 1, 0 ;245
sleep, 20
MouseClick, right, 624, 254, 1, 0 ;245
sleep, 20
MouseClick, right, 869, 254, 1, 0 ;new line
sleep, 20
MouseClick, right, 134, 508, 1, 0
sleep, 20
MouseClick, right, 379, 508, 1, 0 ;245
sleep, 20

}
return

;cc air normal 159
^+4:: ;strg shift 4
  IfWinActive, eGenesis Client
  {
MouseClick, right, 159, 254, 1, 0 ;245
sleep, 20
MouseClick, right, 404, 254, 1, 0 ;245
sleep, 20
MouseClick, right, 649, 254, 1, 0 ;245
sleep, 20
MouseClick, right, 894, 254, 1, 0 ;new line
sleep, 20
MouseClick, right, 159, 508, 1, 0
sleep, 20
MouseClick, right, 404, 508, 1, 0 ;245
sleep, 20

}
return

;cc air full open
^+5:: ;strg shift 5
  IfWinActive, eGenesis Client
  {
MouseClick, right, 186, 254, 1, 0 ;245
sleep, 20
MouseClick, right, 431, 254, 1, 0 ;245
sleep, 20
MouseClick, right, 676, 254, 1, 0 ;245
sleep, 20
MouseClick, right, 921, 254, 1, 0 ;new line
sleep, 20
MouseClick, right, 186, 508, 1, 0
sleep, 20
MouseClick, right, 431, 508, 1, 0 ;245
sleep, 20

}
return

;cc start
^+6:: ;strg shift 6
  IfWinActive, eGenesis Client
  {
MouseClick, right, 120, 248, 1, 0 ;245
sleep, 15
MouseClick, right, 365, 248, 1, 0 ;245
sleep, 15
MouseClick, right, 610, 248, 1, 0 ;245
sleep, 15
MouseClick, right, 855, 248, 1, 0 ;new line
sleep, 15
MouseClick, right, 120, 498, 1, 0
sleep, 15
MouseClick, right, 365, 498, 1, 0 ;245
sleep, 15

}
return

flax rake macro t3


; needs end macro
^+T:: ;strgshift t
loop 
{
  IfWinActive, eGenesis Client
  {
if endtimer() = 0
{
flachskamm()
}
sleep 500
}
}
return


flachskamm() ;
{
if endtimer() = 0
   {
pixelgetcolor, kamm, 96, 46
if kamm != 0
    {
return
    }
eatfish()
sleep 400
mouseclick, right, 100,60, 1, 0
sleep 500
pixelgetcolor, reinigen1, 14, 96
pixelgetcolor, reinigen2, 66, 96
pixelgetcolor, weiter1, 16, 112
pixelgetcolor, weiter2, 123, 112
pixelgetcolor, zerteil1, 18, 91
pixelgetcolor, zerteil2, 238, 93
sleep 500
if (weiter1 = 0 and weiter2 = 0)
    {
mouseclick, right, 40, 112, 1, 0
sleep 400
    }
if (zerteil1 = 0 and zerteil2 = 0)
    {
mouseclick, right, 40, 96, 1, 0
sleep 400
    }
if (reinigen1 = 0 and reinigen2 = 0)
    {
if (weiter2 != 0)
     {
if (zerteil2 != 0)
      {
mouseclick, right, 40, 96, 1, 0
sleep 400
      }
     }
    }
}
  }
return



kiln macro t3

          
;firebricks, jugs
^#2:: ;strg win 2
  IfWinActive, eGenesis Client
  {
send T
sleep, 20
send W
sleep, 20
send B ; firebricks
;send J ; jugs
sleep, 20
send F
sleep, 20
}
return


smelting pot sound macro t3


;plays a sound when smelting pots are done
^#!\:: ;STRG WIN ALT \
Sleep, 300000
SoundPlay, %WinDir%\Media\ding.wav
Sleep, 100
SoundPlay, %WinDir%\Media\ding.wav
Sleep, 100
SoundPlay, %WinDir%\Media\ding.wav
return

mining helper macro t3


; for mining macro...
^+/:: ;STRG SHIFT /
FileDelete, C:\ATITD.txt
return

; for mining macro...
^+a:: ;STRG SHIFT A
MouseGetPos, MouseX, MouseY
;FileOutput = %MouseX%, %MouseY%
;FileAppend, %FileOutput%`n, C:\ATITD.txt
FileAppend, %MouseX%`n, C:\ATITD.txt
FileAppend, %MouseY%`n, C:\ATITD.txt
return



color test macro t3


!Numpad1::  ; color-test
IfWinActive, eGenesis Client
{
	WinGetPos,,, winWidth, winHeight

bblue = 0
bred = 0
bgreen = 0

	Loop ,16
	{
		xindex := a_index + 191
		Loop ,16
		{
			yindex := a_index + 445
			PixelGetColor, color, %xindex%, %yindex%, slow

			bblue += (color // (256*256))/256
			bgreen += (mod((color // 256), 256))/256
			bred += (mod(color, 256))/256
		}
	}

blue = 0
green = 0
red = 0

	Loop ,16
	{
		xindex := a_index + 246
		Loop ,16
		{
			yindex := a_index + 165
			PixelGetColor, color, %xindex%, %yindex%, slow

			blue += (color // (256*256))/256
			green += (mod((color // 256), 256))/256
			red += (mod(color, 256))/256
		}
	}


	cblue := round((blue - bblue)/(248/256) + bblue)
	cgreen := round((green - bgreen)/(248/256) + bgreen)
	cred := round((red - bred)/(248/256) + bred)

sleep 100
	MsgBox R:%cred%  G:%cgreen%  B:%cblue% 

}
return





carpentry anvil t3


;line 1434

;carpentry blades
;zimmerei klingen
!Numpad2:: ;
; F8 double view, zoom all in, stand top right of anvil
x := 422  ; the top left position of the carpentry blade
y := 486
{
loop
{
loop
{
pixelgetcolor, bbb, 43, 78 ;checks for B from sägeblatt
sleep 300
if bbb != 0
{
mouseclick, right, 166, 85, 1, 0
sleep 300
}
if bbb = 0
{
break
}
}
mouseclick, right, 43, 78, 1, 0 ;choose sägeblatt
sleep, 1300
Mousemove, x+80, y
send, B
sleep, 500
send, 9
sleep, 500
Mouseclick, right, x+69, y+21, 1,0 ; ???? -- mid top
sleep, 500
Mouseclick, right, x+69, y+31, 1,0 ; B 9
sleep, 500
Mouseclick, right, x+71, y+183, 1, 0 ; ???? -- mid down
sleep, 500
Mouseclick, right, x+71, y+193, 1, 0 ; B 9
sleep, 500
Mouseclick, right, x+17, y+188, 1, 0 ; B 9 left down
sleep, 500 
Mouseclick, right, x+7, y+177, 1, 0 ; B 9
sleep, 500
Mouseclick, right, x+21, y+44, 1, 0 ; B 9 left top
sleep, 500 
Mouseclick, right, x+5, y+48, 1, 0 ; B 9
sleep, 500 
Mousemove, x+80, y
sleep, 500 
send, C
sleep, 500
send, 9
sleep, 500
Mouseclick, right, x+144, y+38, 1, 0 ; C 9
sleep, 500
Mouseclick, right, x+144, y+88, 1, 0 ; C 9
sleep, 500
Mouseclick, right, x+144, y+138, 1, 0 ; C 9
sleep, 500
Mouseclick, right, x+144, y+188, 1, 0 ; C 9
sleep, 500 

; qualität 5150-5200

send, 6
sleep, 500
Mouseclick, right, x+134, y+38, 1, 0 ; C 6
sleep, 500
Mouseclick, right, x+134, y+88, 1, 0 ; C 6
sleep, 500
Mouseclick, right, x+134, y+138, 1, 0 ; C 6
sleep, 500
Mouseclick, right, x+134, y+188, 1, 0 ; C 6
sleep, 500 
Mouseclick, right, x+144, y+38, 1, 0 ; C 6
sleep, 500
Mouseclick, right, x+144, y+88, 1, 0 ; C 6
sleep, 500
Mouseclick, right, x+144, y+138, 1, 0 ; C 6
sleep, 500
Mouseclick, right, x+144, y+188, 1, 0 ; C 6

; qualität 5900-6000

sleep, 500
send, 9
sleep, 500
Mouseclick, right, x+144, y+38, 1, 0 ; C 9

; qualität 6050-6150

sleep, 500
send, r
sleep, 500
send, 5
sleep, 500
Mouseclick, right, x+114, y+23, 1, 0 ; C 9
sleep, 500
Mouseclick, right, x+114, y+43, 1, 0 ; C 9
sleep, 500
Mouseclick, right, x+30, y+172, 1, 0 ; C 9

sleep, 500
send, c
sleep, 100
send, 5
sleep, 500
Mouseclick, right, x+107, y+46, 1, 0 ; C 9

sleep, 500
send, 9
sleep, 500
Mouseclick, right, x+144, y+22, 1, 0 ; C 9
sleep, 500
send, q
sleep, 100
Mouseclick, right, x, 245, 1, 0 ; abschliessen
sleep, 500
Mouseclick, right, 600, 535, 1, 0 ; JA!
sleep, 1500
}
}
return
; 457 655 B 6 ...



mining2 t3




; mining(remember to pin menu first)

^!m:: 
{
	IfWinExist, eGenesis Client 
		{
		WinActivate
		Gui, 2:Add, Text,, Recording mouse position`nPlease click on the button.
		Gui, 2:Show
		KeyWait, LButton, D
		MouseGetPos, MinePosX1, MinePosY1
		Gui, 2:Destroy
		
		Sleep, 200
		Gui, 2:Add, Text,, Recording mouse position`nPlease click on the button.
		Gui, 2:Show
		KeyWait, LButton, D
		MouseGetPos, MinePosX2, MinePosY2
		Gui, 2:Destroy

		Sleep, 200
		Gui, 2:Add, Text,, Recording mouse position`nPlease click on the button.
		Gui, 2:Show
		KeyWait, LButton, D
		MouseGetPos, MinePosX3, MinePosY3
		Gui, 2:Destroy

		Sleep, 200
		Gui, 2:Add, Text,, Recording mouse position`nPlease click on the button.
		Gui, 2:Show
		KeyWait, LButton, D
		MouseGetPos, MinePosX4, MinePosY4
		Gui, 2:Destroy

		Sleep, 200
		Gui, 2:Add, Text,, Recording mouse position`nPlease click on the button.
		Gui, 2:Show
		KeyWait, LButton, D
		MouseGetPos, MinePosX5, MinePosY5
		Gui, 2:Destroy

		Sleep, 200
		Gui, 2:Add, Text,, Recording mouse position`nPlease click on the button.
		Gui, 2:Show
		KeyWait, LButton, D
		MouseGetPos, MinePosX6, MinePosY6
		Gui, 2:Destroy

		Sleep, 200
		Gui, 2:Add, Text,, Recording mouse position`nPlease click on the button.
		Gui, 2:Show
		KeyWait, LButton, D
		MouseGetPos, MinePosX7, MinePosY7
		Gui, 2:Destroy

		Sleep, 200
		Gui, 2:Add, Text,, Click top left of timer.
		Gui, 2:Show
		Keywait, Lbutton, D
		MouseGetPos, Timer1X, Timer1Y
		Gui, 2:Destroy

		sleep, 200
		Gui, 2:Add, Text,, Click bottom right of timer.
		Gui, 2:Show
		Keywait, Lbutton, D
		MouseGetPos, Timer2X, Timer2Y
		Gui, 2:Destroy

		sleep, 200
		Gui, 2:Add, Text,, How many pulls/moves?
		Gui, 2:Add, Edit, Number vNumPulls
		Gui, 2:Add, Button, default gMineCommit, OK
		Gui, 2:Show
		return

		MineCommit:
		Gui, 2:Submit
		Gui, 2:Destroy
		CoordMode, Pixel, Screen
		loop, %NumPulls%
		{
			loop 
			{
				Sleep, 1000
				PixelSearch, Px, Py, %Timer1X%, %Timer1Y%, %Timer2X%, %Timer2Y%, 0xA8C9D9
				if ErrorLevel = 1
				{
					break
				}
			}
			WinGetActiveTitle, title
			MouseGetPos, X, Y
			WinActivate, eGenesis Client
			random, seed, 1, 7
			if %seed% = 1
			{
				MouseClick, left, %MinePosX1%, %MinePosY1%
			}
			if seed = 2
			{
				MouseClick, left, %MinePosX2%, %MinePosY2%
			}
			if seed = 3
			{
				MouseClick, left, %MinePosX3%, %MinePosY3%
			}
			if seed = 4
			{
				MouseClick, left, %MinePosX4%, %MinePosY4%
			}
			if seed = 5
			{
				MouseClick, left, %MinePosX5%, %MinePosY5%
			}
			if seed = 6
			{
				MouseClick, left, %MinePosX6%, %MinePosY6%
			}
			if seed = 7
			{
				MouseClick, left, %MinePosX7%, %MinePosY7%
			}
			WinActivate, %title%
			MouseMove, %X%, %Y%
		}
		return
	}
}

grass3 t3


^!g::
IfWinExist eGenesis Client 
{
	WinActivate
	Gui, 2:Add, Text,, Click top left of grass button.
	Gui, 2:Show
	Keywait, Lbutton, D
	MouseGetPos, Timer1X, Timer1Y
	Gui, 2:Destroy

	sleep, 200
	Gui, 2:Add, Text,, Click bottom right of grass button.
	Gui, 2:Show
	Keywait, Lbutton, D
	MouseGetPos, Timer2X, Timer2Y
	Gui, 2:Destroy

	sleep, 200
	Gui, 2:Add, Text,, Click middle of grass button.
	Gui, 2:Show
	Keywait, Lbutton, D
	MouseGetPos, ClickX, ClickY
	Gui, 2:Destroy

	sleep, 200
	Gui, 2:Add, Text,, How many pulls/moves?
	Gui, 2:Add, Edit, Number vCycles
	Gui, 2:Add, Button, default gGrassCommit, OK
	Gui, 2:Show
	return
	
	GrassCommit:
	Gui, 2:Submit
	Gui, 2:Destroy
	CoordMode, Pixel, Screen
	loop, %Cycles%
	{
	loop
	{
		Sleep, 250
		PixelSearch, Px, Py, %Timer1X%, %Timer1Y%, %Timer2X%, %Timer2Y%, 0xE8302B
		if ErrorLevel = 0
			{
				WinGetActiveTitle, title
				MouseGetPos, X, Y
				WinActivate, eGenesis Client
				MouseClick, left, %ClickX%, %ClickY%
				WinActivate, %title%
				MouseMove, %X%, %Y%
				break
			}
		
	}
	}
	return
}
return


slate 2 t3


^!s::
IfWinExist eGenesis Client
{
	WinActivate
	WinGetPos,,, winWidth, winHeight
	widthOffset := winWidth - 300
	heightOffset := 50
	loop
	{
		CoordMode, Mouse, Relative
		Sleep, 5
		PixelSearch, Px, Py, widthOffset, 20, winWidth, 50, 0x006AC0
		if (ErrorLevel = 0 and WinActive("eGenesis Client")) 
		{
			MouseGetPos, OldMX, OldMY
			MouseClick, left, %Px%, %Py%,, 0
			MouseMove, %OldMX%, %OldMY%, 0
			Sleep, 2000
		}
	}
}
return

mining 4 t3


^!n:: 
{
	IfWinExist, eGenesis Client 
		{
		WinActivate
		Gui, 2:Add, Text,, Recording mouse position`nPlease click on the button.
		Gui, 2:Show
		KeyWait, LButton, D
		MouseGetPos, MinePosX1, MinePosY1
		Gui, 2:Destroy

		Sleep, 200
		Gui, 2:Add, Text,, Click top left of timer.
		Gui, 2:Show
		Keywait, Lbutton, D
		MouseGetPos, Timer1X, Timer1Y
		Gui, 2:Destroy

		sleep, 200
		Gui, 2:Add, Text,, Click bottom right of timer.
		Gui, 2:Show
		Keywait, Lbutton, D
		MouseGetPos, Timer2X, Timer2Y
		Gui, 2:Destroy

		sleep, 200
		Gui, 2:Add, Text,, How many pulls/moves?
		Gui, 2:Add, Edit, Number vNumPulls
		Gui, 2:Add, Button, default gTimer, OK
		Gui, 2:Show
		return

		Timer:
		Gui, 2:Submit
		Gui, 2:Destroy
		CoordMode, Pixel, Screen
		loop, %NumPulls%
		{
			loop 
			{
				Sleep, 1000
				PixelSearch, Px, Py, %Timer1X%, %Timer1Y%, %Timer2X%, %Timer2Y%, 0xA8C9D9
				if ErrorLevel = 1
				{
					break
				}
			}
			WinGetActiveTitle, title
			MouseGetPos, X, Y
			WinActivate, eGenesis Client
			MouseClick, left, %MinePosX1%, %MinePosY1%
			WinActivate, %title%
			MouseMove, %X%, %Y%
		}
		return
	}
}



file t4



; DATEI löschen
^+0:: ;strg shift 0
FileDelete, C:\Spiele\ATITD.txt
return

; DATEI coords speichern
; speichert jedesmal immer 1 X/Y Wert dazu
^+9:: ;strg shift 9
MouseGetPos, MouseX, MouseY
FileAppend, %MouseX%`n, C:\Spiele\ATITD.txt
FileAppend, %MouseY%`n, C:\Spiele\ATITD.txt
return


; Farbe testen und speichern
; checks Color on given coords
!b:: ;Alt b 
MouseX = 70
MouseY = 23
MouseGetPos, MouseX, MouseY
 PixelGetColor, color659, MouseX, MouseY ;gets color
FileAppend, %color659%`n, C:\Spiele\ATITD.txt
FileAppend, %MouseX%`n, C:\Spiele\ATITD.txt
FileAppend, %MouseY%`n, C:\Spiele\ATITD.txt
return


; DATEI werte speichern
^+8:: ;strg shift 8
FileAppend, %winWidth%`n, C:\Spiele\ATITD.txt
FileAppend, %winHeight%`n, C:\Spiele\ATITD.txt
FileAppend, %wood01%`n, C:\Spiele\ATITD.txt
FileAppend, %wood02%`n, C:\Spiele\ATITD.txt
FileAppend, %wood03%`n, C:\Spiele\ATITD.txt
FileAppend, %wood04%`n, C:\Spiele\ATITD.txt
FileAppend, %wood05%`n, C:\Spiele\ATITD.txt
return



screen view settings t4



;Set screen view F8
^+F11:: ;strg shift S
  IfWinactive, eGenesis Client
  {
sleep 200
	MouseGetPos, OldMX, OldMY
	Sleep 200
	Send {F5}{F8}{F8}
	Sleep 200
	MouseMove, 2000,2000
	Sleep 5000
	MouseMove, %OldMX%, %OldMY%, 0
}
return

screen size settings t4


; Atitd screen groesse  1143, 814
^+F12:: ;strg shift f12
WinSet, Style, -0xC00000, eGenesis Client
WinMove, eGenesis Client, , 0, 0, A_ScreenWidth-1, A_ScreenHeight-40
return


wood run t4


;needs adjustments on your site
; basic idea: 
; pin each tree after the next on left side, then after 9 trees, next on right side
; then set coords to run to next tree
; remain to carry grilled cabbage, maybe set coords to eat again



;---------------------------------------------
;------------------ W O O D ------------------
;---------------------------------------------
; F8 ganz rauszoomen, draufsicht! 
^+w:: ; strg shift w
MouseX = 13 ; sets F and G line
MouseGetPos, woodx01,  woodx02
loop
{
checkeatend() ; perception food
sleep, 300

loop, 5 ;anzahl wood runs
{
  IfWinactive, eGenesis Client
  {
    	MouseClick, left,  MouseX,  40 ;1. Baum fenster top left
sleep, 200
	checkwood()
sleep, 300
	MouseClick, left,  MouseX,  124 ;2. Baum fenster unter 1. fenster top left
sleep, 200
	checkwood()
sleep, 200
;moving
	MouseClick, left,  819,  190 ; MOVING
	Sleep, 400
	MouseClick, left,  MouseX,  208 ;3 baum fenster
sleep, 200
	checkwood()
sleep, 200
;moving
	MouseClick, left,  819,  190 ; MOVING
	Sleep, 400
	MouseClick, left,  MouseX,  292 ;4 baum fenster
sleep, 200
	checkwood()
sleep, 200
	MouseClick, left,  MouseX,  376 ;5 baum fenster
sleep, 200
	checkwood()
sleep, 200
;moving
	MouseClick, left,  819,  190 ; MOVING
	Sleep, 400
	MouseClick, left,  MouseX,  460 ;6 baum fenster
	checkwood()
;moving
	MouseClick, left,  819,  190 ; MOVING
	Sleep, 400
	MouseClick, left,  MouseX,  544 ;7 baum fenster, left
	checkwood()
;moving
	MouseClick, left,  819,  190 ; MOVING
	Sleep, 400
	MouseClick, left,  MouseX,  628 ;8 baum fenster, 
	checkwood()
;moving
	MouseClick, left,  969,  288 ; MOVING
	Sleep, 400
	MouseClick, left,  MouseX,  712 ;9 baum fenster, LINKS
	checkwood()
	MouseClick, left,  843,  40 ;1 baum fenster, RECHTS  bottle tree
	checkwood()
;moving
	MouseClick, left,  869,  418 ; MOVING
	Sleep, 400
	MouseClick, left,  845,  124 ;2 baum fenster, RECHTS  Royal Palm
	checkwood()
;moving back
	MouseClick, left,  417,  474 ; MOVING
	Sleep, 400
	}
}

MouseClick, left,  446,  230 ; movig to stop point
sleep 900
 MouseClick, right,  woodx01,  woodx02
sleep 75000
 MouseClick, right,  woodx01,  woodx02
sleep 1900
 MouseClick, right,  woodx01,  woodx02
sleep 1900
   MouseClick, right, 570, 449 
sleep 3900
	MouseClick, left,  547,  675 
sleep 500

}
return




checkwood()
{
MouseGetPos, MouseX, MouseY
Sleep, 200
wood02 := MouseY + 8
wood03 := MouseY + 12
woodi1 := MouseY - 20
Sleep, 200

loop ; checks ob holzfenster da is
 {
 Sleep, 250
 MouseClick, left, MouseX, woodi1 ;check color
 Sleep, 1000
 PixelGetColor, wood04, MouseX, wood03 ;G from Gather Wood
 PixelGetColor, wood06, MouseX, wood02 ;F from fertilize
 Sleep, 200
  if (wood04 != 0) ; nix DA
   {
   Sleep, 300
   wood06 := 1
   }
  if (wood06 = 0) ;F from fertilize  is DA!
   {
   Sleep, 200
   wood04 := 1
   Sleep, 200
   MouseClick, right, 377, 197 ;STOP moving
   Sleep, 1000
   }    
  if (wood04 = 0) ; G from Gather Wood  is DA!
   {
   MouseClick, left, MouseX, wood02 ;Get wood
   Sleep, 500
   break
   }
 }
sleep, 111
loop ; checks ob holz genommen
 {
 Sleep, 250
 MouseClick, left, MouseX, woodi1 ;check color
 Sleep, 500
 PixelGetColor, wood05, MouseX, wood02 ;F from fertilize
 Sleep, 200
 if (wood05 != 0)
  {
  Sleep, 500
  }
 if (wood05 = 0)
  {
  break
  }
 }
} ; wood ende



flax helper for 40 fields t4


; -----------------------------------------
; -------------- F L A X - links ----------
; -----------------------------------------
;Flax making
!<:: ; ALT <  links
  IfWinactive, eGenesis Client
  {

	MouseGetPos, MouseX, MouseY
	Mx := MouseX -30
    	MouseClick, R, 0, 0, 1, 0, , R
        Blockinput, MouseMove
	Sleep, 90
    	MouseClick, R, 30, -5, 1, 0, , R
	Sleep, 5
	MouseMove, MX, MouseY
        Blockinput, MouseMoveOff
  }
return


; -----------------------------------------
; -------------- F L A X  -  Rechts -------
; -----------------------------------------
;Flax making
!Y:: ; ALT Y  rechts
  IfWinactive, eGenesis Client
  {

    	MouseClick, R, 0, 0, 1, 0, , R
	MouseGetPos, MouseX, MouseY
        Blockinput, MouseMove
	Sleep, 120

    	MouseClick, R, 30, -5, 1, 0, , R
	MX := MouseX +30
	MouseMove, MX, MouseY
        Blockinput, MouseMoveOff
  }
return


; -----------------------------------------
; -------------- F L A X  -  R I P  -------
; -----------------------------------------
;Flax seed rip
^+7:: ;strg shift 7 -  rechts
  IfWinactive, eGenesis Client
  {

        Blockinput, MouseMove
    	MouseClick, R, 0, 0, 1, 0, , R
	MouseGetPos, MouseX, MouseY
	Sleep, 120
    	MouseClick, R, 30, 26, 1, 0, , R
	Sleep, 120
    	MouseClick, R, 46, -20, 1, 0, , R
	MX := MouseX +30
	MouseMove, MX, MouseY
        Blockinput, MouseMoveOff
  }
return


1 click ticks t4


;---------------------------------------------
;---------------- 1 C L i C K  ---------------
;---------------------------------------------
!F:: ; fish? 1 click blah     
 MouseGetPos, MouseX2, MouseY2
loop
{
  IfWinactive, eGenesis Client
  {
      BlockInput, MouseMove
sleep 30
      MouseGetPos, MouseX3, MouseY3
sleep 200
    	MouseClick, right, MouseX2, MouseY2
sleep 300
 	MouseMove, %MouseX3%, %MouseY3%, 0
sleep 30
      BlockInput, MouseMoveOff

 sleep 17000
}
}
return


2 click ticks t4


;---------------------------------------------
;---------------- 2 C L i C K  ---------------
;---------------------------------------------
^+h:: ; 2 click blah ;1143 814
loop
{
  IfWinactive, eGenesis Client
  {
    	MouseClick, right, 223, 57, 1, 0
 sleep 1000
    	MouseClick, left, 563, 608, 1, 0 
 sleep 3000
    	MouseClick, right, 223, 57, 1, 0
 sleep 1000
    	MouseClick, left, 563, 213, 1, 0
 sleep 3000
}
}
return


grass 1spot t4


;---------------------------------------------
;----------------  G R A S S   ---------------
;---------------------------------------------
	WinGetPos,,, winWidth, winHeight
; grass macro
; clicks on grass icon when you move your mouse over it
^+g:: ;STRG shift g
Loop
{
  IfWinActive, eGenesis Client
  {
    Sleep, 200
    checkmessage()
    PixelGetColor, color4, 228, 54    
    if color4 = 0x4A6D9C    
    {
      MouseGetPos, MouseX3, MouseY3
      BlockInput, MouseMove
	mousemove, 228, 54
      sleep, 250
      if color4 = 0x4A6D9C  
      {
	MouseClick, right
      Sleep, 200
    MouseMove, 564, 218
    sleep 1800
    MouseClick, left

      }
      sleep, 250
 	MouseMove, %MouseX3%, %MouseY3%, 0
      BlockInput, MouseMoveOff
      Sleep, 200
    }
    Sleep, 500
    PixelGetColor, color4, 228, 54    
    if color4 = 0x4A6D9C    
    {
      MouseGetPos, MouseX3, MouseY3
      BlockInput, MouseMove
	mousemove, 228, 54
      sleep, 250
      if color4 = 0x4A6D9C  
      {
	MouseClick, right
      Sleep, 200
      MouseMove, 564, 632
      sleep 1800
      MouseClick, left 
      }
      sleep, 250
 	MouseMove, %MouseX3%, %MouseY3%, 0
      BlockInput, MouseMoveOff
      Sleep, 200
    }
    Sleep, 500

  }
}
return


onions t4

need this for onion macro:

Find Harvest th.png


;needs special screen settings, so try it first
; 4 onions
; 1 jug, 4 seeds needed
; needs add macros for t4

; -----------------------------------------
; ------------- O N I O N -----------------
; -----------------------------------------
^+O:: ; strg shift O
loop, 
{
  IfWinactive, eGenesis Client
  {
; plant -> place "plant onion windows" top left
  sleep 200
  MouseClick, right, 87, 40, 1, 0
  sleep 400
; 1. seed rechts
  MouseClick, right, 44, 21, 1, 0
  sleep 400
  MouseClick, right, 87, 77, 1, 0
  sleep 150
  MouseClick, right, 87, 77, 1, 0
  sleep 400
  MouseClick, right, 33, 139, 1, 0
  sleep 400
; 2. seed, unten
  MouseClick, right, 44, 21
  sleep 400
  MouseClick, right, 64, 100
  sleep 150
  MouseClick, right, 64, 100
  sleep 400
  MouseClick, right, 33, 139
  sleep 400
; 3. seed, links
  MouseClick, right, 44, 21
  sleep 400
  MouseClick, right, 40, 76
  sleep 150
  MouseClick, right, 40, 76
  sleep 400
  MouseClick, right, 33, 139
  sleep 400
; 4. seed, oben
  MouseClick, right, 44, 21
  sleep 400
  MouseClick, right, 64, 54
  sleep 150
  MouseClick, right, 64, 54
  sleep 400
  MouseClick, right, 33, 139
  sleep 400
; -------------------------------------
; Moves windows right plant
    MouseClick, right, 624, 409
    MouseGetPos, Moov01, Moov02
    sleep 200
      MouseMove , Moov01+13, Moov02-21
      sleep 51
	Click down
      sleep 50
	MouseMove , 205, 178
      MouseGetPos, Moov01, Moov02
      sleep 200
	Click up 
      sleep 150
      MouseClick, right, Moov01+162, Moov02
      sleep 350
; Moves windows down plant
    MouseClick, right, 577, 466
    MouseGetPos, Moov01, Moov02
    sleep 200
      MouseMove , Moov01+13, Moov02-21
      sleep 51
	Click down
      sleep 50
	MouseMove , 465, 178
      MouseGetPos, Moov01, Moov02
      sleep 200
	Click up 
      sleep 150
      MouseClick, right, Moov01+162, Moov02
      sleep 350
; Moves windows left plant
    MouseClick, right, 515, 418
    MouseGetPos, Moov01, Moov02
    sleep 200
      MouseMove , Moov01+13, Moov02-21
      sleep 51
	Click down
      sleep 50
	MouseMove , 685, 178
      MouseGetPos, Moov01, Moov02
      sleep 200
	Click up 
      sleep 150
      MouseClick, right, Moov01+162, Moov02
      sleep 350
; Moves windows top plant
    MouseClick, right, 579, 360
    MouseGetPos, Moov01, Moov02
    sleep 200
      MouseMove , Moov01+13, Moov02-21
      sleep 51
	Click down
      sleep 50
	MouseMove , 910,178
      MouseGetPos, Moov01, Moov02
      sleep 200
	Click up 
      sleep 150
      MouseClick, right , Moov01+162, Moov02
      sleep 350
; -------------------------------------
; Water
loop, 4
{
checkwater()
   MouseClick, right, 250, 206
sleep 500
checkwater()
   MouseClick, right, 500, 205
sleep 500
checkwater()
   MouseClick, right, 710, 206
sleep 500
checkwater()
   MouseClick, right, 950, 205
sleep 1000
}
loop  ; 1. onion
 {
click 250, 173
sleep 500
ImageSearch, Px, Py, 190, 190, 370, 230, *50 Find_Harvest_th.png
sleep 150
	if (ErrorLevel < 1) 
	{
		Click 250 , 206 ;Click Harvest This
sleep 400
		Click 367, 175 ; unpin window
		break 
	}
 }
loop ; 2. onion
 {
click 500, 173
sleep 500
ImageSearch, Px, Py, 450, 190, 610, 230, *50 Find_Harvest_th.png
sleep 150
	if (ErrorLevel < 1) 
	{
		Click 500, 205 ;Click Harvest This
sleep 400
		Click 627, 177 ; unpin window
		break 
	}
 }

loop ; 3. onion
 {
click 710, 173
sleep 500
ImageSearch, Px, Py, 670, 190, 840, 230, *50 Find_Harvest_th.png
sleep 150
	if (ErrorLevel < 1) 
	{
		Click 710, 206 ;Click Harvest This
sleep 400
		Click 847, 175 ; unpin window
		break 
	}
 }

loop ; 4. onion
 {
click 950, 173
sleep 500
ImageSearch, Px, Py, 890, 190, 1060, 230, *50 Find_Harvest_th.png
sleep 150
	if (ErrorLevel < 1) 
	{
		Click 950, 205 ;Click Harvest This
sleep 400
		Click 1072, 176 ; unpin window
		break 
	}
 }

/*

; harvest onions 1.spot
   MouseClick, right, 250, 206
sleep 200
   MouseClick, right, 250, 206
sleep 400
   MouseClick, right, 367, 175
sleep 4200
; harvest onions 2.spot
   MouseClick, right, 500, 205
sleep 200
   MouseClick, right, 500, 205
sleep 400
   MouseClick, right, 627, 177
sleep 4200
; harvest onions 3. spot
   MouseClick, right, 710, 206
sleep 200
   MouseClick, right, 710, 206
sleep 400
   MouseClick, right, 847, 175
sleep 4200
; harvest onions 4. spot
   MouseClick, right, 950, 205
sleep 200
   MouseClick, right, 950, 205
sleep 400
   MouseClick, right, 1072, 176
*/
  }
sleep 5000
}
return


pop add t4


;needed by some t4 macros

; popup with message
checkmessage()
{
loop, 1
 {
 Sleep, 150
 PixelGetColor, mess01, 696, 623 ; popup da?
 PixelGetColor, mess02, 637, 469 ; popup da?
 PixelGetColor, mess03, 577, 508 ; popup da?
 Mousegetpos, mx2, my3
 Sleep, 150
  if (mess01 != 0 && mess02 != 0 && mess03 != 0) ;popup nicht da
   {
   Sleep, 33
   break
   }
  if (mess01 = 0) ;popup da
   {
   MouseClick, right, 696, 623 ; click popup
   Sleep, 200
mousemove, mx2, my3
   break
   }
  if (mess02 = 0) ;popup da
   {
   MouseClick, right, 637, 469 ; click popup
   Sleep, 300
mousemove, mx2, my3
   break
   }
  if (mess03 = 0) ;popup da
   {
   MouseClick, right, 577, 499 ; click popup
   Sleep, 300
mousemove, mx2, my3
   break
   }

 }
}
return


pop get t4


;needed by some t4 macros

; popup to get i.e. Water
checkgather()
{
loop, 4
 {
 PixelGetColor, gather01, 572, 451 ; popup da?
 Mousegetpos, mx2, my3

   Sleep, 400
  if (gather01 != 0) ;popup nicht da
   {
   Sleep, 400
   }
  if (gather01 = 0) ;popup da
   {
   MouseClick, right, 572, 455 ; click popup
   Sleep, 500
mousemove, mx2, my3
   Sleep, 200
   break
   }
 }
}
return

pop water t4


;needed by some t4 macros



; ---- check Water ----
checkwater()
 {
   Sleep, 400
 PixelGetColor, water01, 342, 66 ; 3. posi water
 PixelGetColor, water02, 277, 69  ; 2. posi water
 Mousegetpos, mx2, my3
 Sleep, 400
  if (water01 = 0xD6AA8C) ;Water 3. posi da
   {
   MouseClick, right, 345, 83 ; click water
   Sleep, 500
mousemove, mx2, my3
   Sleep, 200
   checkgather()
   checkwater()
   }
  if (water02 = 0xEFC7B5) ;Water 2. posi da
   {
   MouseClick, right, 277, 69 ; click water
   Sleep, 500
mousemove, mx2, my3
   Sleep, 200
   checkgather()
   checkwater()
   }

 }
return


water t4


;needed by some t4 macros

; -----------------------------------------
; ------------- water -----------------
; -----------------------------------------
^+T:: ;strg shift T   ->>  Water
{
checkwater()
}
return


endurance t4


; need set the coords of endurance in skill window and have skil window always same arrangement
; needs ADD macro from t4
; for digs, can move mouse, for limestone, for dirt, flax processing, clothwork etc


; -----------------------------------------
; ------------- endurance -----------------
; -----------------------------------------
; wenn schwarz klicken 0x000000
; sobald rot, aufhören 0x0000FF
; check 17/809, endu skill musst visible
!Z:: ;ALT Z   ->>  endu
IfWinactive, eGenesis Client
 {
Mousegetpos, mo2, mo3
 loop
  {
  Sleep, 200
  PixelGetColor, endu01, 17, 808 ; checks endu skill 
  Sleep, 200
  if (endu01 != 0x0000FF) ;nicht hellrot!
   {
 Mousegetpos, mx2, my3
  Sleep, 200

checkeatend()
   MouseClick, right, mo2, mo3
   Sleep, 300
mousemove, mx2, my3
  Sleep, 600

   }
  checkmessage()
  }
 }
return


endurance ADD macro t4

; checks if on food
; will eat griled onions on given coords

checkeatend()
{
sleep 300
Pixelgetcolor, eatend01, 198, 806
sleep 300
if (eatend01 !=0x009A00)
  {
  sleep 300 
  mouseclick, right, 333, 785 ; set here grilled food location
  sleep 300
  }
 }
return


strength AND endurance t4


; need set the coords of endurance in skill window and have skil window always same arrangement
; needs ADD macro from t4
; for digs, can move mouse, for limestone, for dirt, for flax processing, clothwork, etc
; at SAME time for mining too or coconuts
; needs lots of coord settings


^+Z:: ;strg shift Z   ->>  endu / strg
i := 0
Mousegetpos, mo2, mo3
IfWinactive, eGenesis Client
 {
 loop
  {
  Sleep, 200
  PixelGetColor, endu01, 17, 808 ; checks endu skill 
  PixelGetColor, strg01, 59, 781 ; checks strg skill 
  if (endu01 != 0x0000FF) ;nicht hellrot!
   {
;   MouseClick, right, mo2, mo3
;  Sleep, 2000

; mousemove, 540,333
; send p
i := i + 1
 if (i = 5)
 {
;send C
i := 0
}
checkeatend()
   MouseClick, right, 645, 164
   Sleep, 431
   }
  if (strg01 != 0x0000FF) ;nicht hellrot!
   {   
;   MouseClick, right, mo2, mo3
   MouseClick, right, 474, 156
   Sleep, 423
   }

  checkmessage()
  }
 }
return



Clay t4


; needs adjusting for running
; line with ";" needs to be tuned
; needs ADD macro

; -----------------------------------------
; ------------- C L A Y -------------------
; -----------------------------------------
!G:: ; gather clay 1 click blah
IfWinActive, eGenesis Client
{
;checkwater()
;sleep 300
loop
; anzahl south nord runs
 {
;sleep 1000
;MouseClick, left, 561, 681 ; run south
;loop, 15 
; anzahl clay checks
 ; {
   checkclay()
;   checkmessage()
;  }
;sleep 1000
;checkwater()
;checkmessage()
;checkgather()
;sleep 1000
;MouseClick, left, 585, 145 ; run north
;loop, 15 
; anzahl clay checks
 ; {
;   checkclay()
 ;  checkmessage()
;  }
sleep 500
checkwater()
checkmessage()
;checkgather()
;sleep 1000
} ; loop run north/south ende
;sleep 1000
;checkwater()
}
return

clay ADD macro t4


checkclay()
{
; checks clay posi 1
sleep 300
pixelgetcolor, clay01, 219, 67 ; 1. posi clay
sleep 200
if (clay01 = 0xBDC3D6) 
 {
 Mouseclick, right, 230, 81
 sleep 200
 Mousemove, 270, 100
 sleep 300
 }
}
return


another clay macro t4


; needs adjusting for running
; needs ADD macro

;---------------------------------------------
;----------------  C L A Y     ---------------
;---------------------------------------------
	WinGetPos,,, winWidth, winHeight
; clay macro
; clicks on clay icon every 1 step back forth
!t:: ;alt t

{
  IfWinActive, eGenesis Client
  {
checkwater()
loop, 20
{
    Sleep, 200
    checkmessage()
    PixelGetColor, color4, 219, 67    
    if color4 = 0xBDC3D6    
    {
      MouseGetPos, MouseX3, MouseY3
      BlockInput, MouseMove
      checkclay()
    sleep 800
    MouseMove, 564, 218
    sleep 400
    MouseClick, left

      
      sleep, 250
 	MouseMove, %MouseX3%, %MouseY3%, 0
      BlockInput, MouseMoveOff
      Sleep, 200
    }
    Sleep, 500
    PixelGetColor, color4, 219, 67    
    if color4 = 0xBDC3D6    
    {
      MouseGetPos, MouseX3, MouseY3
      BlockInput, MouseMove
      checkclay()
    sleep 800
      MouseMove, 564, 632
      sleep 400
      MouseClick, left 
      
      sleep, 250
 	MouseMove, %MouseX3%, %MouseY3%, 0
      BlockInput, MouseMoveOff
      Sleep, 200
    }
    Sleep, 500
}
  }
}
return


window helper macro t4


; adjusts placing of pinned windows by 1 coord

; -----------------------------------------
; -------------- move window --------------
; -----------------------------------------

!M:: ; moving 1 coords fenster

      MouseGetPos, Moov101, Moov102
      sleep 251
	Click down
      sleep 250

      MouseMove , Moov101-1, Moov102-1
      sleep 200
	Click up 
return



carpentry macro t4

; needs FILE macro to mark carpentry shops

; -----------------------------------------
; --------------- boards ---------------
; -----------------------------------------
; boards bretter
; zimmerei carpentry.. uses 8 spots and clicks permanent
^+u:: ;STRG shift U 
i = 2
Loop
{  
  IfWinActive, eGenesis Client
  {
  FileReadLine, filelineY, C:\Spiele\ATITD.txt, %i%  
  if ( ErrorLevel <> 0 or filelineY = "" )
  	{
	if i=2
		{
 		break
		}
	  else 
		{
    		i = 2   
		} 
  	}
  else 
	{
	line := i-1
	FileReadLine, filelineX, C:\Spiele\ATITD.txt, %line%
      Mousemove, %filelineX%, %filelineY%
      Sleep, 50
send, P
	i := i+2
      }
}
}
return


auto kiln macro t4

; needs FILE macro to mark carpentry shops


!2:: ;ALT 2   auto guild buildings at coord 1853 3938
loop, 12 
;after all fired, need 1 kiln in not fire mode top left
{
;checkkiln()
i = 2
Loop 
; kilns
{  
  IfWinActive, eGenesis Client
  {
  FileReadLine, filelineY, C:\Spiele\ATITD.txt, %i%  
  if ( ErrorLevel <> 0 or filelineY = "" )
  	{	
	;if i=2
		{
 		break
		}
	 ; else 
	;	{
    	;	i = 2   
	;	} 
  	}
  else 
	{
	line := i-1
	FileReadLine, filelineX, C:\Spiele\ATITD.txt, %line%
      Sleep, 150
      Mousemove, %filelineX%, %filelineY%
      Sleep, 250

;send T
;sleep, 300
;send W
;sleep, 300
;send B ; firebricks
;send J ; jugs
send c
sleep, 300
;send F
sleep, 300
	i := i+2

}
}
}
sleep 200000
}

return

checkkiln()  
{
;if T from ture kiln da
loop ; 
 {
 Sleep, 550
 MouseClick, left, 236, 40 ;check color
 Sleep, 1500
 PixelGetColor, kiln1, 70, 23 ;T from true
 Sleep, 200
  if (kiln1 != 0) ; nix DA
   {
   Sleep, 1000
   }
  if (kiln1 = 0x000000) 
   {
   Sleep, 300
   break
   }    
 }
}
return