Jump to content

help plz?


Golbez
 Share

Recommended Posts

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

Link to comment
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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

  • Moderators

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

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.

Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...