Golbez Posted November 25, 2005 Posted November 25, 2005 can someone help me i dont get how 2 do this "pixelsearch". i dont get how 2 put in the coordnates the game window size is: 1024x768 top = 0 bottom = 1024 left = 0 right = 768 monster = 0x000070 $window =<full game window> WinActivate($window, "") AutoItSetOption ( "PixelCoordMode", 0 ) ;0 = relative coords to the active window ;1 = absolute screen coordinates (default) ;2 = relat $coord = PixelSearch( $left, $top, $right, $bottom, $monster, 50 ) ;MsgBox(4, "coord[0]", $coord[0], .5) ; Shows me were the coordinates are ;MsgBox(4, "coord[1]", $coord[1], .5) ; Shows me were the coordinates are PixelGetColor( $coord[0] , $coord[1] ) MouseMove ( $coord[0] , $coord[1] ) MouseClick("left" plz help me if u got aol im. my sn is: zephino
Nuffilein805 Posted November 25, 2005 Posted November 25, 2005 your search is quite slow, cause your checking every pixel what do you want with this line? PixelGetColor( $coord[0], $coord[1] )you already checked it, so its useless maybe you should do it like this $top = 0 $bottom = 768 $left = 0 $right = 1024 $monster = 0x000070 $window =<full game window> WinActivate($window, "") AutoItSetOption ( "PixelCoordMode", 0 ) $coord = PixelSearch( $left, $top, $right, $bottom, $monster, 50, 10) MouseMove ( $coord[0] , $coord[1] ) MouseClick("left") as you see i just modified your script, but this is at least a bit faster checks only every 10 pixel i changed your bottom- and right-value so this should work as well which game is this script for? my little chatmy little encryption toolmy little hidermy unsafe clickbot
Golbez Posted November 25, 2005 Author Posted November 25, 2005 (edited) thanx ill try this... if u could tell me how u new were 2 put the numbers 4 the window plz? im still havein the same problem as b4.. the mouse is not moving Edited November 25, 2005 by Golbez
Nuffilein805 Posted November 25, 2005 Posted November 25, 2005 you could use mouseclick("left", $coord[0], $coord[1], 1) maybe you should do a loop so your script runs forever my little chatmy little encryption toolmy little hidermy unsafe clickbot
Golbez Posted November 25, 2005 Author Posted November 25, 2005 (edited) i want the mouse 2 move right first b4 i finnish it error mouseclick("left",$coord[0],$coord[1],1 mouseclick("left",$coord^ERROR Error: subscript used with non-array variable. i think i figured it out... how do u dimension a variable (im used 2 q-basic, this comp language is very simular) Edited November 25, 2005 by Golbez
Nuffilein805 Posted November 25, 2005 Posted November 25, 2005 it should be an array as you used pixelsearch before (i hope) my little chatmy little encryption toolmy little hidermy unsafe clickbot
Golbez Posted November 25, 2005 Author Posted November 25, 2005 do u got aol im? this getten annoyen n i dont no what 2 do now
Golbez Posted November 25, 2005 Author Posted November 25, 2005 (edited) heres the full code $Restart = 1 $monster = Iniread ("GolBot.ini", "Settings", "monster", "") $window = Iniread ("GolBot.ini", "Settings", "window", "") $top = Iniread ("GolBot.ini", "Settings", "top", "") $bottom = Iniread ("GolBot.ini", "Settings", "bottom", "") $left = Iniread ("GolBot.ini", "Settings", "left", "") $right = Iniread ("GolBot.ini", "Settings", "right", "") $Server = Iniread ("GolBot.ini", "Account", "Server", "") $SRoadPath = Iniread ("GolBot.ini", "Account","SRoadPath", "") $SRoadExe = Iniread ("GolBot.ini", "Account","SRoadExe", "") $Launcher = Iniread ("GolBot.ini", "Account", "Launcher", "") $Client = Iniread ("GolBot.ini", "Account", "Client", "") $Account = Iniread ("GolBot.ini", "Account", "Account", "") $Password = Iniread ("GolBot.ini", "Account", "Password", "") $LauncherDelay = Iniread ("GolBot.ini", "Account", "LauncherDelay", "") $ClientDelay = Iniread ("GolBot.ini", "Account", "ClientDelay", "") $RestartDelay = Iniread ("GolBot.ini", "Account", "RestartDelay", "") $AccountDelay = Iniread ("GolBot.ini", "Account", "AccountDelay", "") $PasswordDelay = Iniread ("GolBot.ini", "Account", "PasswordDelay", "") WinActivate($window, "") AutoItSetOption ( "PixelCoordMode", 0 ) ;0 = relative coords to the active window ;1 = absolute screen coordinates (default) ;2 = relative coords to the client area of the active window $coord = PixelSearch( $left, $top, $right, $bottom, $monster, 10, 10) ;MsgBox(4, "coord[0]", $coord[0], .5) ;MsgBox(4, "coord[1]", $coord[1], .5) mouseclick("left", $coord[A], $coord[B], 1) ok heres the ini [Account] Server = 0 SRoadPath = "C:\Program Files\<game>" SRoadExe = "<game>.exe" Launcher = "<game> Online Launcher" Client = "<game>" Account = "myaccount" Password = "mypassword" ; ****************************** ;* DONT TOUCH UNDER THIS POINT! * ; ****************************** LauncherDelay = 1000 ;DONT TOUCH THIS! ClientDelay = 2000 ;DONT TOUCH THIS! RestartDelay = 1000 ;DONT TOUCH THIS! AccountDelay = 1000 ;DONT TOUCH THIS! PasswordDelay = 500 ;DONT TOUCH THIS! [Settings] monster = 0xffb9b3 ; ****************************** ;* DONT TOUCH UNDER THIS POINT! * ; ****************************** top = 0 ;DONT TOUCH THIS! bottom = 784 ;DONT TOUCH THIS! left = 0 ;DONT TOUCH THIS! right = 1024 ;DONT TOUCH THIS! window = ;DONT TOUCH THIS! Edited November 25, 2005 by Golbez
Nuffilein805 Posted November 25, 2005 Posted November 25, 2005 do you have to click more than 1 time on a monster? i modified your code a bit expandcollapse popuphotkeyset("^+!6", "leaveplz"); ctrl+alt+shift+6 $Restart = 1 $monster = Iniread ("GolBot.ini", "Settings", "monster", "") $window = Iniread ("GolBot.ini", "Settings", "window", "") $top = Iniread ("GolBot.ini", "Settings", "top", "") $bottom = Iniread ("GolBot.ini", "Settings", "bottom", "") $left = Iniread ("GolBot.ini", "Settings", "left", "") $right = Iniread ("GolBot.ini", "Settings", "right", "") $Server = Iniread ("GolBot.ini", "Account", "Server", "") $SRoadPath = Iniread ("GolBot.ini", "Account","SRoadPath", "") $SRoadExe = Iniread ("GolBot.ini", "Account","SRoadExe", "") $Launcher = Iniread ("GolBot.ini", "Account", "Launcher", "") $Client = Iniread ("GolBot.ini", "Account", "Client", "") $Account = Iniread ("GolBot.ini", "Account", "Account", "") $Password = Iniread ("GolBot.ini", "Account", "Password", "") $LauncherDelay = Iniread ("GolBot.ini", "Account", "LauncherDelay", "") $ClientDelay = Iniread ("GolBot.ini", "Account", "ClientDelay", "") $RestartDelay = Iniread ("GolBot.ini", "Account", "RestartDelay", "") $AccountDelay = Iniread ("GolBot.ini", "Account", "AccountDelay", "") $PasswordDelay = Iniread ("GolBot.ini", "Account", "PasswordDelay", "") $n = 0 do;here WinActivate($window, "") AutoItSetOption ( "PixelCoordMode", 0 ) ;0 = relative coords to the active window ;1 = absolute screen coordinates (default) ;2 = relative coords to the client area of the active window ;do; or here $m = timerinit() $coord = PixelSearch( $left, $top, $right, $bottom, $monster, 10, 10) ;MsgBox(4, "coord[0]", $coord[0], .5) ;MsgBox(4, "coord[1]", $coord[1], .5) $n = $n + timerdiff($m) if $n > 2000 then mouseclick("left", $coord[0], $coord[1], 1) $n = 0 endif until 1 = 2 func leaveplz() exit endfunc it has an infinite loop now which and you can exit your prog using "ctrl+alt+shift+6" the prog only clicks every 2 secs on the first found coordinate (only problem: if the screen moves the coordinates will change - i think about that) i hope this helps you my little chatmy little encryption toolmy little hidermy unsafe clickbot
Golbez Posted November 25, 2005 Author Posted November 25, 2005 thanx 4 adding the loop, but im not goen 2 need it till i get it so the pixelsearch works.. its still not working
Moderators SmOke_N Posted November 25, 2005 Moderators Posted November 25, 2005 Have you tried using the AutoInfo Tool in your SciTe Editor to get the Coord Locations, and or Color Definitions that your looking for? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Golbez Posted November 25, 2005 Author Posted November 25, 2005 (edited) yea that helped me but im stuck on how 2 get it 2 give me 2 coordinates with the pixel this is the error that i cant fix Edited November 25, 2005 by Golbez
Moderators SmOke_N Posted November 25, 2005 Moderators Posted November 25, 2005 It wouldn't be $corrd[A], $coord Replace A with 0 and B with 1 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Moderators SmOke_N Posted November 26, 2005 Moderators Posted November 26, 2005 Might as well just show the code, cuz ... this could be a guessing game from this point on... Did you even define $coord = PixelSearch() or $coord = $MouseGetPos() ? Opt("PixelCoordMode", 0) or Opt("MouseCoordMode", 0)? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Golbez Posted November 27, 2005 Author Posted November 27, 2005 i did show the code n i dont no how 2 define it.. plz tell me how
w0uter Posted November 27, 2005 Posted November 27, 2005 pixelsearch fails. do some error checking. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
Golbez Posted November 28, 2005 Author Posted November 28, 2005 i dont understand wtf u mean by that.. im kinda a noob but not.. i recently decided that i was going to teach myself this computer language. if u cant explaint better what u mean i would greatly appreciate your info
Moderators SmOke_N Posted November 28, 2005 Moderators Posted November 28, 2005 (edited) Kind of a noob but not???? In your words.. WTF is that? $coord = PixelSearch( $left, $top, $right, $bottom, $monster, 10, 10) If Not @error Then If IsArray($coord) Then mouseclick("left", $coord[0], $coord[1], 1) EndIf You shouldn't get the error anymore. Edit: Added Not @error Edited November 28, 2005 by ronsrules Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Golbez Posted November 28, 2005 Author Posted November 28, 2005 nope still got the error expandcollapse popup$Restart = 1 $monster = Iniread ("GolBot.ini", "Settings", "monster", "") $window = Iniread ("GolBot.ini", "Settings", "window", "") $top = Iniread ("GolBot.ini", "Settings", "top", "") $bottom = Iniread ("GolBot.ini", "Settings", "bottom", "") $left = Iniread ("GolBot.ini", "Settings", "left", "") $right = Iniread ("GolBot.ini", "Settings", "right", "") $Server = Iniread ("GolBot.ini", "Account", "Server", "") $SRoadPath = Iniread ("GolBot.ini", "Account","SRoadPath", "") $SRoadExe = Iniread ("GolBot.ini", "Account","SRoadExe", "") $Launcher = Iniread ("GolBot.ini", "Account", "Launcher", "") $Client = Iniread ("GolBot.ini", "Account", "Client", "") $Account = Iniread ("GolBot.ini", "Account", "Account", "") $Password = Iniread ("GolBot.ini", "Account", "Password", "") $LauncherDelay = Iniread ("GolBot.ini", "Account", "LauncherDelay", "") $ClientDelay = Iniread ("GolBot.ini", "Account", "ClientDelay", "") $RestartDelay = Iniread ("GolBot.ini", "Account", "RestartDelay", "") $AccountDelay = Iniread ("GolBot.ini", "Account", "AccountDelay", "") $PasswordDelay = Iniread ("GolBot.ini", "Account", "PasswordDelay", "") Func _iPixelSearch($i_left, $i_top, $i_right, $i_bottom, $i_color, $i_shade = 0, $i_step = 1) Local $av_ret[3] Local $ai_coords = PixelSearch($i_left, $i_top, $i_right, $i_bottom, $i_color, $i_shade, $i_step) If @error Then Return 0 EndIf $av_ret[0] = PixelGetColor($ai_coords[0], $ai_coords[1]) $av_ret[1] = $ai_coords[0] $av_ret[2] = $ai_coords[1] ;{$av_ret} return[0] = the found pixel color ;{$av_ret} return[1] = x coord ;{$av_ret} return[2] = y coord Return $av_ret EndFunc;==>_iPixelSearch WinActivate($window, "") AutoItSetOption ( "PixelCoordMode", 0 ) ;0 = relative coords to the active window ;1 = absolute screen coordinates (default) ;2 = relative coords to the client area of the active window $coord = PixelSearch( $left, $top, $right, $bottom, $monster, 10, 10) If Not @error Then If IsArray($coord) Then mouseclick("left", $coord[0], $coord[1], 1) EndIf ;MsgBox(4, "coord[0]", $coord[0], .5) ;MsgBox(4, "coord[1]", $coord[1], .5) mouseclick("left", $coord[0], $coord[1], 1) [Account] Server = 0 SRoadPath = "C:\Program Files\<game>" SRoadExe = "<game>.exe" Launcher = "<game> Online Launcher" Client = "<game>t" Account = "myaccount" Password = "mypassword" ; ****************************** ;* DONT TOUCH UNDER THIS POINT! * ; ****************************** LauncherDelay = 1000 ;DONT TOUCH THIS! ClientDelay = 2000 ;DONT TOUCH THIS! RestartDelay = 1000 ;DONT TOUCH THIS! AccountDelay = 1000 ;DONT TOUCH THIS! PasswordDelay = 500 ;DONT TOUCH THIS! [Settings] monster = 0xD33C26 ; ****************************** ;* DONT TOUCH UNDER THIS POINT! * ; ****************************** top = 0 ;y DONT TOUCH THIS! bottom = 784 ;Hight DONT TOUCH THIS! left = 0 ;x DONT TOUCH THIS! right = 1024 ;Weith DONT TOUCH THIS! window =SRO_Client ;DONT TOUCH THIS! this what the code looks like now
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