autocomplex Posted August 20, 2007 Share Posted August 20, 2007 I'm Using Pixel search to find a color of an object, that a user puts a box around. However, even when I put the color in the box it wont start clicking. Heres the code ... expandcollapse popupIf PixelSearch($smallx+2,$smally+42,$smallx+2+$smallScanWidth,$smally+42+$smallScanHeight,$DropColor,$Sens) = $DropColor Then ;Wield Pickaxe in #1 Inventory Slot MouseMove( 835, 370) MouseClick("left", 835, 370) ;Wield Pickaxe in #2 Inventory Slot MouseMove( 880, 370) MouseClick( "left" , 880, 370 ) ;Wield Pickaxe in #3 Inventory Slot MouseMove( 925, 370) MouseClick( "left" , 925, 370 ) ;Wield Pickaxe in #4 Inventory Slot MouseMove( 970, 370) MouseClick( "left" , 970, 370 ) ;drop #5 inventory spot MouseMove( 835, 475) MouseClick("right", 835, 475) MouseMove( 835, 520) MouseClick( "left" , 835, 520) ;drop #6 inventory spot MouseMove( 880, 475) MouseClick("right", 880, 475) MouseMove( 880, 520) MouseClick( "left" , 880, 520) ;drop #7 inventory spot MouseMove( 925, 475) MouseClick("right", 925, 475) MouseMove( 925, 520) MouseClick( "left" , 925, 520) This is where the color is, but it does the above first. It is done this way so that when this object is picked up, the sequence of events begins until the object is deleted. ;drop #8 inventory spot MouseMove( 970, 475) MouseClick("right", 970, 475) MouseMove( 970, 520) MouseClick( "left" , 970, 520) Endif Please enlighten me =) Want Runescape Specific Scripts and Bots?Visit AutoIt Runescape Team (ARST) forum! Link to comment Share on other sites More sharing options...
bogQ Posted August 20, 2007 Share Posted August 20, 2007 I'm Using Pixel search to find a color of an object, that a user puts a box around. However, even when I put the color in the box it wont start clicking. Heres the code ... expandcollapse popupIf PixelSearch($smallx+2,$smally+42,$smallx+2+$smallScanWidth,$smally+42+$smallScanHeight,$DropColor,$Sens) = $DropColor Then ;Wield Pickaxe in #1 Inventory Slot MouseMove( 835, 370) MouseClick("left", 835, 370) ;Wield Pickaxe in #2 Inventory Slot MouseMove( 880, 370) MouseClick( "left" , 880, 370 ) ;Wield Pickaxe in #3 Inventory Slot MouseMove( 925, 370) MouseClick( "left" , 925, 370 ) ;Wield Pickaxe in #4 Inventory Slot MouseMove( 970, 370) MouseClick( "left" , 970, 370 ) ;drop #5 inventory spot MouseMove( 835, 475) MouseClick("right", 835, 475) MouseMove( 835, 520) MouseClick( "left" , 835, 520) ;drop #6 inventory spot MouseMove( 880, 475) MouseClick("right", 880, 475) MouseMove( 880, 520) MouseClick( "left" , 880, 520) ;drop #7 inventory spot MouseMove( 925, 475) MouseClick("right", 925, 475) MouseMove( 925, 520) MouseClick( "left" , 925, 520) This is where the color is, but it does the above first. It is done this way so that when this object is picked up, the sequence of events begins until the object is deleted. ;drop #8 inventory spot MouseMove( 970, 475) MouseClick("right", 970, 475) MouseMove( 970, 520) MouseClick( "left" , 970, 520) Endif Please enlighten me =) PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] ) Return Value Success: Returns a two-element array of pixel's coordinates. (Array[0] = x, Array[1] = y) Failure: Sets @error to 1 if color is not found. so you beter done something like expandcollapse popup$data = PixelSearch($smallx+2,$smally+42,$smallx+2+$smallScanWidth,$smally+42+$smallScanHeight,$DropColor,$Sens) if $data <> 1 then ;Wield Pickaxe in #1 Inventory Slot MouseMove( 835, 370) MouseClick("left", 835, 370) ;Wield Pickaxe in #2 Inventory Slot MouseMove( 880, 370) MouseClick( "left" , 880, 370 ) ;Wield Pickaxe in #3 Inventory Slot MouseMove( 925, 370) MouseClick( "left" , 925, 370 ) ;Wield Pickaxe in #4 Inventory Slot MouseMove( 970, 370) MouseClick( "left" , 970, 370 ) ;drop #5 inventory spot MouseMove( 835, 475) MouseClick("right", 835, 475) MouseMove( 835, 520) MouseClick( "left" , 835, 520) ;drop #6 inventory spot MouseMove( 880, 475) MouseClick("right", 880, 475) MouseMove( 880, 520) MouseClick( "left" , 880, 520) ;drop #7 inventory spot MouseMove( 925, 475) MouseClick("right", 925, 475) MouseMove( 925, 520) MouseClick( "left" , 925, 520) ;drop #8 inventory spot MouseMove( 970, 475) MouseClick("right", 970, 475) MouseMove( 970, 520) MouseClick( "left" , 970, 520) Endif or im reading something wrong in help file ^^ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
weaponx Posted August 20, 2007 Share Posted August 20, 2007 This line is wrong: If PixelSearch($smallx+2,$smally+42,$smallx+2+$smallScanWidth,$smally+42+$smallScanHeight,$DropColor,$Sens) = $DropColor ThenoÝ÷ ØÏ¥Iæ«r¬²çz˺XÂ)eën®v§jºÚÉ»êÞÊç(«x"¶Úrh¬ìµæjëh×6If IsArray(PixelSearch($smallx+2,$smally+42,$smallx+2+$smallScanWidth,$smally+42+$smallScanHeight,$DropColor,$Sens)) Then Link to comment Share on other sites More sharing options...
bogQ Posted August 20, 2007 Share Posted August 20, 2007 with variable you can get the position of PixelSearch so whats the point of checking if the data is IsArray or not if you dont load it in a variable? TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
weaponx Posted August 21, 2007 Share Posted August 21, 2007 (edited) with variable you can get the position of PixelSearchso whats the point of checking if the data is IsArray or not if you dont load it in a variable? $PixelXY = PixelSearch($smallx+2,$smally+42,$smallx+2+$smallScanWidth,$smally+42+$smallScanHeight,$DropColor,$Sens)If IsArray($PixelXY)Then Edited August 21, 2007 by weaponx Link to comment Share on other sites More sharing options...
autocomplex Posted August 21, 2007 Author Share Posted August 21, 2007 $PixelXY = PixelSearch($smallx+2,$smally+42,$smallx+2+$smallScanWidth,$smally+42+$smallScanHeight,$DropColor,$Sens)If IsArray($PixelXY)ThenIf IsArray? I know what they are, but can you tech my how to implement them in my code? Want Runescape Specific Scripts and Bots?Visit AutoIt Runescape Team (ARST) forum! Link to comment Share on other sites More sharing options...
bogQ Posted August 21, 2007 Share Posted August 21, 2007 If IsArray? I know what they are, but can you tech my how to implement them in my code? if your screen resolution is 800*600 and you need to scan it all to finde your color expandcollapse popupglobal $color = "0xFFFFFF" ;<== put heare your pixel color 4 search $PixelXY = PixelSearch (0,0,800,600,$color) ;<== If IsArray($PixelXY)Then ;<== you dont need this part MsgBox(0,"PixelSearch", "color "&$color&" finded on locaton x="&$PixelXY[0]&" y="&$PixelXY[1],5) TrayTip("Look at the mouse...", "...and youl see the location on where is that pixel", 5, 1) sleep(5000) MouseMove($PixelXY[0],$PixelXY[1],100) sleep(5000) TrayTip("clears any tray tip","",0) ;<== but its good to know where your pixel is finded ^^ MouseMove( 835, 370) MouseClick("left", 835, 370) MouseMove( 880, 370) MouseClick( "left" , 880, 370 ) MouseMove( 925, 370) MouseClick( "left" , 925, 370 ) MouseMove( 970, 370) MouseClick( "left" , 970, 370 ) MouseMove( 835, 475) MouseClick("right", 835, 475) MouseMove( 835, 520) MouseClick( "left" , 835, 520) MouseMove( 880, 475) MouseClick("right", 880, 475) MouseMove( 880, 520) MouseClick( "left" , 880, 520) MouseMove( 925, 475) MouseClick("right", 925, 475) MouseMove( 925, 520) MouseClick( "left" , 925, 520) MouseMove( 970, 475) MouseClick("right", 970, 475) MouseMove( 970, 520) MouseClick( "left" , 970, 520) Endif If Not IsArray($PixelXY)Then MsgBox(0,"PixelSearch", "Sry but we dident finde your color "&$color,5) EndIf TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
autocomplex Posted August 21, 2007 Author Share Posted August 21, 2007 Ok awsome i started doing sumthing liek this since my last post, let me add in some of your elements. Want Runescape Specific Scripts and Bots?Visit AutoIt Runescape Team (ARST) forum! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now