Sign in to follow this  
Followers 0
Golbez

help plz?

26 posts in this topic

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 B) if u got aol im. my sn is: zephino

Share this post


Link to post
Share on other sites



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?

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by Golbez

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by Golbez

Share this post


Link to post
Share on other sites

do u got aol im? this getten annoyen B)

n i dont no what 2 do now

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by Golbez

Share this post


Link to post
Share on other sites

do you have to click more than 1 time on a monster?

i modified your code a bit

hotkeyset("^+!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

Share this post


Link to post
Share on other sites

thanx 4 adding the loop, but im not goen 2 need it till i get it so the pixelsearch works.. its still not working

Share this post


Link to post
Share on other sites

Have you tried using the AutoInfo Tool in your SciTe Editor to get the Coord Locations, and or Color Definitions that your looking for?


[center]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.[/center]

Share this post


Link to post
Share on other sites

#12 ·  Posted (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

Posted Image

Edited by Golbez

Share this post


Link to post
Share on other sites

It wouldn't be $corrd[A], $coord

Replace A with 0 and B with 1


[center]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.[/center]

Share this post


Link to post
Share on other sites

new error

Posted Image

Share this post


Link to post
Share on other sites

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)?


[center]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.[/center]

Share this post


Link to post
Share on other sites

i did show the code n i dont no how 2 define it.. plz tell me how B)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#19 ·  Posted (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 by ronsrules

[center]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.[/center]

Share this post


Link to post
Share on other sites

nope still got the error

$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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0