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:Cegaiel/Macros/PapyPicker/Code

From A Tale in the Desert
< User:Cegaiel‎ | Macros‎ | PapyPicker
Revision as of 01:16, 25 September 2010 by Cegaiel (talk | contribs)
Jump to navigationJump to search
;This was created/tested in 1280x1024 resolution
;The script will search an area (square box around avatar's location) for the papy color (0xDBD401). It will right click each papy and gather.
;Start script with Ctrl+Alt+W. It will zoom in to my favorite zoom level and then start looking for papy to gather.
;Just run close to any papy, it will get picked.


;The video settings I am using is:
;Shadow Quality: 2nd checkbox (from left)
;Time of day lighting: 1st checkbox
;Light Intensity: 3rd checkbox

;Screenshot avail at http://www.atitd.org/wiki/tale4/User:Cegaiel/Macros/PapyPicker


;Execute Script with Ctrl+Alt+W
;Ctrl+R = Reload
;Ctrl+P = Pause/Resume


;Author: Cegaiel
;Date: 9/16/2010
;Last Update: 9/23/2010


^r::reload
^p::Pause
^!w::







	; Wait for the window to become active, then get the window stats
	WinWait, eGenesis Client, 
	IfWinNotActive, eGenesis Client, , WinActivate, eGenesis Client, 
	WinWaitActive, eGenesis Client,
	WinGetActiveStats, win_Title, Xmax, Ymax, win_Xpos, win_Ypos






SetDefaultMouseSpeed,0
  SetMouseDelay,-1




;This just simply sets the zoom level to what I felt was just right
;The below is optional and can be removed...



Msgbox, The screen will now zoom in, then back out to a descent zoom level in F6 mode!`n`nDon't move the mouse until you are given the Ready box, in a moment.


	Send {F6}

	Xcenter := Xmax//2 - 3
	Ycenter := Ymax//2 + 16
	MouseMove, Xcenter, Ycenter, 0


Loop, 32
{
		click, WU
		sleep 250
}

	MouseMove, Xcenter, Ycenter, 0


Loop, 16
{
		click, WD
		sleep 250
}


Msgbox, Papy Picker now ready!`n`nJust start running past pappy and it will automatically pick it via right click.`n`nCtrl+P to pause/resume, Ctrl+R to reload script

; End zooming





;This searches for the color of pappy (0xDBD401) in a square box around the avatar

;The upper left corner coords are 475,450
;The bottom right corner is 820,650
;You can adjust as you see fit.

;Use my Get Mouse Position macro to help you find the coords you want to use, if you need to...



;NOTE: The number 25 in the Pixelsearch line represents how many shades away from color 0xDBD401 that it will accept as a valid color
;If you are having problems with in not clicking the color, try raising that number 5 shades at a time (ie 30)
;If it is too sensitive and clicking on all kinds of stuff around you, then try lowering it 5 shades a time (ie 20)

;Also it is possible some video cards may show the papy color slightly different. If after changing your video settings to match mine and it still does not work,
;Then use my Get Mouse Position macro to find out what the color for you and change the 0xDBD401 to match it.




Loop
{

PixelSearch, Px, Py, 475, 450, 820, 650, 0xDBD401, 25, Fast|RGB
if ErrorLevel = 0
{
NewX := Px + 2
NewY := Py + 5
MouseGetPos, OldX, OldY
Click Right %NewX%, %NewY%
MouseMove, %OldX%, %OldY%

Sleep 150
}



}