Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 08:07

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

Advertisement



help with pixel search

Discussion on help with pixel search within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2011
Posts: 7
Received Thanks: 0
help with pixel search

I need to implement in my autoit bot some changes and i am gonna use pixel search.



What i exactly want is a script that start pressing a buton then compare a pixel if this pixel is grey make script 1 until pixel is not grey , when the pixel became not grey make script 2 till its finished, and when script 2 finish has to go to the compare pixel spot for starting again with script 1 till is not grey to make script 2 ...... and so on indefinitly


it would be something like this?


#Region
$Form1 = GUICreate("BOT", 350, 220, 250, 131)
$Button1 = GUICtrlCreateButton("GO", 74, 32, 185, 49, 0)
GUISetState(@SW_SHOW)
#EndRegion

While 1
$nMsg = GUIGetMsg()

Select

Case $Button1
While 1

$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )

If Not @error Then

script 1

EndIf

script 2

wend

or can i make it better way?

cuz script 1 is short but script2 are more than 300 code lines and perhaps i make my script complicated to understand

need some help

and i also need a pag with the hex number of all colors cuz the number i have put in func is the red color (like the example found in help of autoit)

srry 4 my low lvl of english
hectorin is offline  
Old 08/07/2011, 21:56   #2
 
elite*gold: 0
Join Date: Mar 2011
Posts: 8,645
Received Thanks: 3,454
Please but your Source in a [ PHP][/PHP] code
Freddy​ is offline  
Old 08/07/2011, 22:11   #3


 
buFFy!'s Avatar
 
elite*gold: 1826
Join Date: Mar 2009
Posts: 4,310
Received Thanks: 6,287
Code:
Runs an external program and pauses script execution until the program finishes.

RunWait ( "program" [, "workingdir" [, show_flag [, opt_flag ]]] )
buFFy! is offline  
Old 08/08/2011, 01:30   #4
 
elite*gold: 0
Join Date: Aug 2011
Posts: 7
Received Thanks: 0
thats all the source, but its not doing what i want:

Quote:
#cs ----------------------------------------------------------------------------

AutoIt Version: 3.3.6.1
Author: Hectorin

Script Function:
Template AutoIt script.

#ce ----------------------------------------------------------------------------

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region
$Form1 = GUICreate("Hellgate bot by hectorin", 350, 220, 250, 131)
$Button1 = GUICtrlCreateButton("DALE CAÑA", 74, 32, 185, 49, 0)
$Button2 = GUICtrlCreateButton("YA BASTA", 74, 132, 185, 49, 0)
GUISetState(@SW_SHOW)
#EndRegion

HotKeySet("{F12}", "Terminate")

Func _move($loop,$key)
For $i = $loop to 1 Step -1
ControlSend("Hellgate (x86 DX9)", "", "", $key)
Next
EndFunc

Func Terminate()
Exit 0
EndFunc

While 1
$nMsg = GUIGetMsg()

Select

Case $Button1
While 1
sleep(2000)


$coord = PixelSearch( 0, 0, 1241, 16, 0xFF0000, 10 )

While 1

_move(50,"s") ; move backward and forward till enter SH
Sleep(200)
_move(50,"w")
Sleep(100)

WEnd ; Color has changed then has entered SH

Sleep(3000) ; time to load screen


_move(50,"w") ; Once inside has to make all this
Sleep(5)
_move(40,"a")
ControlSend("Hellgate (x86 DX9)", "", "", "{F2}") ;swapp weapon
Sleep(1350)
ControlSend("Hellgate (x86 DX9)", "", "", "{3}") ; use zombi form
Sleep(2500)
ControlSend("Hellgate (x86 DX9)", "", "", "{F1}") ; swap original weapons
Sleep(1350)
ControlSend("Hellgate (x86 DX9)", "", "", "{1}")
Sleep(1350)
_move(30,"f") ; loot
ControlSend("Hellgate (x86 DX9)", "", "", "{6}")
Sleep(350)
ControlSend("Hellgate (x86 DX9)", "", "", "{5}")
Sleep(1350)
ControlSend("Hellgate (x86 DX9)", "", "", "{7}")
Sleep(1350)
_move(30,"f") ; loot
ControlSend("Hellgate (x86 DX9)", "", "", "{8}")
Sleep(1350)
ControlSend("Hellgate (x86 DX9)", "", "", "{9}")
Sleep(1350)
ControlSend("Hellgate (x86 DX9)", "", "", "{0}") ; all sumons are up
Sleep(100)
_move(150,"w")
Sleep(10)
_move(25,"a")
ControlSend("Hellgate (x86 DX9)", "", "", "{2}") ; reaper
Sleep(3500)
ControlSend("Hellgate (x86 DX9)", "", "", "{1}")
Sleep(1350)
_move(30,"f") ; loot
ControlSend("Hellgate (x86 DX9)", "", "", "{6}") ; basic function for sumon any pet its dead
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{5}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{7}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{8}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{4}") ; nova
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{9}")
Sleep(100)
_move(30,"f") ; loot
ControlSend("Hellgate (x86 DX9)", "", "", "{0}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{6}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{5}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{7}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{8}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{9}")
_move(30,"f") ; loot
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{0}"); finished sumon pet dead
Sleep(2100)
ControlSend("Hellgate (x86 DX9)", "", "", "{6}") ; basic function for sumon any pet its dead
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{5}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{7}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{4}") ; nova
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{8}")
Sleep(100)
_move(30,"f") ; loot
ControlSend("Hellgate (x86 DX9)", "", "", "{9}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{0}")
Sleep(1500)
_move(30,"a")
_move(30,"f") ; loot
Sleep(15)
_move(30,"f") ; loot
_move(50,"w")
_move(30,"f") ; loot
ControlSend("Hellgate (x86 DX9)", "", "", "{4}") ; nova
_move(30,"f") ; loot
sleep(500)
ControlSend("Hellgate (x86 DX9)", "", "", "{1}")
Sleep(1350)
ControlSend("Hellgate (x86 DX9)", "", "", "{6}") ; basic function for sumon any pet its dead
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{5}")
_move(30,"f") ; loot
Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{7}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{8}")
Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{4}") ; nova
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{9}")
Sleep(100)
_move(30,"f") ; loot
ControlSend("Hellgate (x86 DX9)", "", "", "{0}")
Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{6}") ; basic function for sumon any pet its dead
Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{5}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{7}")
Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{8}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{4}") ; nova
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{9}")
Sleep(1000)
_move(30,"f") ; loot
ControlSend("Hellgate (x86 DX9)", "", "", "{0}")
Sleep(3000)
_move(100,"w")
_move(30,"f") ; loot
ControlSend("Hellgate (x86 DX9)", "", "", "{4}") ; nova
sleep(500)
ControlSend("Hellgate (x86 DX9)", "", "", "{1}")
Sleep(1350)
ControlSend("Hellgate (x86 DX9)", "", "", "{6}")
Sleep(100)
_move(30,"f") ; loot
ControlSend("Hellgate (x86 DX9)", "", "", "{5}")
Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{7}")
ControlSend("Hellgate (x86 DX9)", "", "", "{4}") ; nova
Sleep(100)
Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{8}")
Sleep(1000)
_move(30,"f") ; loot
ControlSend("Hellgate (x86 DX9)", "", "", "{9}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{0}")
Sleep(3000)
_move(40,"d")
_move(30,"f") ; loot
_move(40,"s") ; loot
ControlSend("Hellgate (x86 DX9)", "", "", "{'}") ; hp inyector
Sleep(350)
ControlSend("Hellgate (x86 DX9)", "", "", "{4}") ; nova
Sleep(250)
ControlSend("Hellgate (x86 DX9)", "", "", "{1}")
_move(30,"f") ; loot
Sleep(1350)
ControlSend("Hellgate (x86 DX9)", "", "", "{6}") ; basic function for sumon any pet its dead
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{5}")
Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{7}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{4}") ; nova
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{8}")
_move(30,"f") ; loot
Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{9}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{0}")
Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{6}")
_move(30,"f") ; loot
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{5}")
ControlSend("Hellgate (x86 DX9)", "", "", "{4}") ; nova
Sleep(100)
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{7}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{8}")
Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{9}")
_move(30,"f") ; loot
Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{0}"); finished sumon pet dead
Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{6}") ; basic function for sumon any pet its dead
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{5}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{4}") ; nova
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{7}")
Sleep(100)
_move(30,"f") ; loot
ControlSend("Hellgate (x86 DX9)", "", "", "{8}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{9}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{0}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{4}") ; nova
Sleep(350)
ControlSend("Hellgate (x86 DX9)", "", "", "{1}")
Sleep(1350)
ControlSend("Hellgate (x86 DX9)", "", "", "{6}")
Sleep(350)
_move(30,"f") ; loot
ControlSend("Hellgate (x86 DX9)", "", "", "{5}")
Sleep(1350)
ControlSend("Hellgate (x86 DX9)", "", "", "{7}")
Sleep(350)
ControlSend("Hellgate (x86 DX9)", "", "", "{8}")
_move(30,"f") ; loot
Sleep(350)
ControlSend("Hellgate (x86 DX9)", "", "", "{9}")
Sleep(1350)
ControlSend("Hellgate (x86 DX9)", "", "", "{0}")
_move(90,"d")
_move(30,"f") ; loot
ControlSend("Hellgate (x86 DX9)", "", "", "{4}") ; nova
Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{1}")
Sleep(1350)
ControlSend("Hellgate (x86 DX9)", "", "", "{6}") ; basic function for sumon any pet its dead
_move(30,"f") ; loot
Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{5}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{7}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{8}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{9}")
Sleep(1000)
_move(30,"f") ; loot
ControlSend("Hellgate (x86 DX9)", "", "", "{0}")
Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{6}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{5}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{7}")
Sleep(100)
_move(30,"f") ; loot
ControlSend("Hellgate (x86 DX9)", "", "", "{8}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{9}")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{0}"); finished sumon pet dead
Sleep(1350)
ControlSend("Hellgate (x86 DX9)", "", "", "{4}") ; nova
_move(30,"f") ; loot
Sleep(2500)
_move(30,"f") ; loot
_move(15,"a")
_move(30,"f") ; loot
ControlSend("Hellgate (x86 DX9)", "", "", "{4}") ; nova
_move(30,"f") ; loot

Sleep(2350)
_move(30,"f") ; loot

ControlSend("Hellgate (x86 DX9)", "", "", "{ENTER}")
Sleep(100)
Send("+7stuck")
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{ENTER}")
Sleep(15000)
_move(90,"s")
Sleep(5)
_move(18,"w")
Sleep(5) ; walking back and fordward cuz sometimes door doesnt detect us well
_move(18,"s")
Sleep(4000)

Send("{ALTDOWN}"); finished running SH doing a reset here
Sleep(500)
MouseClick("left",1039,79,1)
Sleep(500)
MouseClick("left",1039,79,1)
Sleep(100)
ControlSend("Hellgate (x86 DX9)", "", "", "{ENTER}")
Sleep(10)
MouseClick("left",558,571,1)
Sleep(500)
MouseClick("left",558,571,1)
Sleep(200)
ControlSend("Hellgate (x86 DX9)", "", "", "{ENTER}")
Sleep(100)
MouseClick("left",645,550,1)
Sleep(300)
MouseClick("left",645,550,1)
Sleep(400)
Send("{ALTUP}")
Sleep(350) ; reset done now its gonna start again GOTO START

WEnd

Case $Button2
GUIDelete()
ExitLoop

EndSelect


wend
Now is just doing this:

Quote:
_move(50,"s")
Sleep(200)
_move(50,"w")
Sleep(100)
what i need is if coords x=1241 and Y=16 are yellow color repeat this:

Quote:
_move(50,"s")
Sleep(200)
_move(50,"w")
Sleep(100)
but when coords x=1241 and Y=16 are not yellow color continue running rest of the scrip not just repiting forward backward:

Quote:
Sleep(3000) ; time to enter and load SH


_move(50,"w")
Sleep(5)
_move(40,"a")
ControlSend("Hellgate (x86 DX9)", "", "", "{F2}") ;swapp weapon
Sleep(1350)..... and all lines till the end moment that script will start again testing yellow color cuz its a loop.
hectorin is offline  
Reply


Similar Threads Similar Threads
Pixel search Bot Problem
01/10/2011 - General Coding - 6 Replies
Hallo ich habe hier folgenden Bot gemacht: Auto it Global $paused Global $i Global $a = 100 Global $Mouse Global $ii HotKeySet("{F8}", "_Scannerstart")
Problem bei Pixel search
12/07/2010 - AutoIt - 15 Replies
Heey, habe noch nie etwas mit AutoIt geschreiben... Hier mein script: Ich wollte eigentlich nur dass mein Mauszeiger auf 736, 699 klickt, dann die Pixel in dem Bereich sucht und drauf klickt. Daraufhin wieder woanders hin klickt und wieder die Pixel den dem Bereich sucht und wieder drauf klickt.
Pixel Search Click
04/11/2010 - AutoIt - 4 Replies
Hi, I am trying to open up Internet Explorer using Pixel Search, But i keep getting Error. Here is my script : It finds the color then double clicks on it,but it cannot find the color,i hope some one can help me, +k for any one who can
Aoc Bot with Pixel search or how
07/20/2008 - General Gaming Releases - 0 Replies
Hi there sorry for my poor english I tryed a aoc bot , but i got several problems the enemys are fare away so i need to walk to them and then hit. i cannot get the next target cause first the bot need to look for 50m to see is there a enemy
Pixel search
02/23/2008 - Guild Wars - 18 Replies
hallihallo bin immoment dabei einen meiner eigenen bots zu optimieren und wollte ne Pixelsearchfunktion einbauen. Leider weiß ich nicht genau wie man das macht vorallem mit den farben. mein ziel: 3 verschiedene punkte im gw fenster(mit: x1;y1;;x2;y2;;x3;y3) sollen geprüft werden ob sie in GRÜN sind. falls x1;y1 grün ist -> (dollerzeichen)folge = 1 falls x2;y2 grün ist -> (dollerzeichen)folge = 2 falls x3;y3 grün ist -> (dollerzeichen)folge = 3



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


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.