Register for your free account! | Forgot your password?

Go Back   elitepvpers > General Gaming > General Gaming Discussion
You last visited: Today at 11:40

  • Please register to post and access all features, it's quick, easy and FREE!

 

[AutoIt] realAutoloot pixelsearch script

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2008
Posts: 113
Received Thanks: 56
[AutoIt] realAutoloot pixelsearch script

that toke me almost one day , the script need some tweak i dont have time to finish it . it really easy to make it a one button script you define the area to search with printscreen for the left top corner and pause for the right bottom .
with the auto it info you can take the color of the item you want to loot , there is a protection against looping on the same item too.
Read the comment into the script.

Code:
;Author cyberheter0


Opt("MouseCoordMode", 0) ; relative coord to the active windows
Opt("MouseClickDragDelay", 250) ; drag speed

If Not FileExists(@ScriptDir&"\Bcoord.ini") Then
	IniWrite(@ScriptDir&"\Bcoord.ini","Bcoord","X","0")
	IniWrite(@ScriptDir&"\Bcoord.ini","Bcoord","Y","0")
  Sleep(500)
EndIf

Global $bpCoordSetX = IniRead(@ScriptDir&"\Bcoord.ini","Bcoord","X","0")
Global $bpCoordSetY = IniRead(@ScriptDir&"\Bcoord.ini","Bcoord","Y","0")
Global $pKP = 0 
Global $aPKP = 0
Global $xyRB
Global $xyLT
Global $pSX
Global $pSY
Global $count
Global $zcount
Global $error

HotKeySet("{F1}","setBCoord") ;set the coordinate bag
HotKeySet("{PRINTSCREEN}","lTGetCoord") ;left top x, y
HotKeySet("{PAUSE}","rBGetCoord") ; right bottom x, y
HotKeySet("{END}","Terminate")



WinWaitActive("Darkfall Online")



while 1
	if ($aPKP == 1) AND ($pKP == 1) then 
	    $getRB= StringSplit($xyRB, '_', 2)
		$getLT= StringSplit($xyLT, '_', 2)
		$pColor = "0x757878_0xB6BCBC_0xB9C986_0x8B8F8F" ;separate each value by an underscore color value of item
        $color= StringSplit($pColor, '_', 2)
		;MsgBox(0, "X and Y are LT :", $color[0] & "," & $color[1])
	    ;MsgBox(0, "X and Y are RB :", $getRB[0] & "," & $getRB[1])
		$count = 0
		Do
			;MsgBox(0, "count ", $count & "," & $color[$count])
			$zcount = 0
			Do
			$coord = PixelSearch( $getLT[0], $getLT[1], $getRB[0], $getRB[1], $color[$count], 30, 1) ;0x757878 ;0xB6BCBC 0xb9c986 $getLT[0]+303, $getLT[1]+225
			If Not @error Then
				;if (($coord[0] <> $pSX) And ($coord[1] <> $pSY)) Then
					MouseClickDrag("left", $coord[0], $coord[1], $bpCoordSetX+Random(10,20,1), $bpCoordSetY+Random(10,20,1), 0)
					MouseMove($getLT[0], $getLT[1], 0)
					$pSX = $coord[0]
					$pSY = $coord[1]
					$zcount += 1
					;MsgBox(0, "count ", $zcount)
					$error = @error
					if ($coord[0] == $pSX) And ($coord[1] == $pSY) And ($zcount ==1) Then
					    $error = 1
						;MsgBox(0, "count ", "in the loop")
					EndIf
			
			;MsgBox(0, "Coord check", $coord[0] & "," & $coord[1])
			EndIf
			;if @error Then
			;MsgBox(0, "Attention", "ERROR")
			;EndIf
			
			Until $error = 1
		$count += 1
		;MsgBox(0, "Attention", "passe le controle d'Erreur")
		Until $count = UBound($color)
	MsgBox(0, "Attention", "STOP")
	$pKP = 0
	$aPKP = 0
	EndIf
WEnd

Func setBCoord()
   $getPos = MouseGetPos()
   IniWrite(@ScriptDir&"\Bcoord.ini","Bcoord","X", $getPos[0])
   IniWrite(@ScriptDir&"\Bcoord.ini","Bcoord","Y", $getPos[1])
   $bpCoordSetX = $getPos[0]
   $bpCoordSetY = $getPos[1]
EndFunc

Func rBGetCoord()
	Sleep(100)
	ToolTip("the right bottom coord", 0, 0)
	Sleep(200)
	ToolTip("")
	$posRB = MouseGetPos()
	$xyRB = $posRB[0] & "_" & $posRB[1]
	$pKP = 1
 return $xyRB
EndFunc

Func lTGetCoord()
	Sleep(100)
	ToolTip("the left top coord", 0, 0)
	Sleep(200)
	$posLT = MouseGetPos()
	$xyLT = $posLT[0] & "_" & $posLT[1]
	$aPKP = 1
  return $xyLT
EndFunc

Func Terminate()
	Sleep(100)
	ToolTip("script terminated", 0, 0)
	Sleep(200)
    Exit 0
EndFunc



Penakle is offline  
Thanks
1 User
Reply



« Previous Thread | Next Thread »

Similar Threads
AutoIt PixelSearch
Hallo, kann mir jemand erklären, wie PixelSearch funktioniert? Ich hab zwar schon auf mehrere Seiten was dazu gesehen... Funktion PixelSearch ...
18 Replies - AutoIt
[AutoIt] PixelSearch Tut
Hallo, Mir ist aufgefallen dass die meisten nicht wissen wie man bestimmte Objekt mit Autoit sucht Die "Grundgedanken": Wenn ein Pixel mit...
8 Replies - AutoIt
[AutoIt] Pixelsearch
Hallo Leute, Ich hab mir vor kurzem ein Angelbot mit einer Pixelsearchfunktion gemacht, nur das Problem ist, dass ich nicht weis was ich schreiben...
3 Replies - General Coding
autoit Pixelsearch?
Hy ich versuche mir auch einmal nen Bot zu machen, bin aber eher ein Anfänger. Deswegen brauche ich ma Hilfe!! Mir geht es jetzt darum dass der...
7 Replies - Guild Wars



All times are GMT +1. The time now is 11:40.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.