Jump to content

Mouse Moving Wrong


Recommended Posts

Hey again, I am still making that PK Bot for my game. But, with the co-ords I used for the Game, using a Windowed (800x600) Client, I am still having difficulties.

I want the mouse to move over the detected pixel, and PK them.. But, instead the mouse feels like it's funny to move to the top left hand part of my screen and perform it's actions. And it's not even the right pixel.. :)

I have removed the co-ords from this code, but the ones I used where: 300,400,300,400.

;Pixels of Enemies
$Elephant1 = 0x296163
$Elephant2 = 0x089a08
$Elephant3 = 0xbd9a18
$Elephant4 = 0xc69a08
$Elephant5 = 0xc65929
$Elephant6 = 0xde6542
$Elephant7 = 0xa52000
$Elephant8 = 0x101421

;Mouse Options
$button = "right"
$clicks = 1

While 1
    $Win = WinGetPos("Game Name","")
 
    $search = PixelSearch (0,0,0,0,$Elephant1,0)
    $search = PixelSearch (0,0,0,0,$Elephant2,0)
    $search = PixelSearch (0,0,0,0,$Elephant3,0)
    $search = PixelSearch (0,0,0,0,$Elephant4,0)
    $search = PixelSearch (0,0,0,0,$Elephant5,0)
    $search = PixelSearch (0,0,0,0,$Elephant6,0)
    $search = PixelSearch (0,0,0,0,$Elephant7,0)
    $search = PixelSearch (0,0,0,0,$Elephant8,0)
     If UBound($Win) > 0 Then
        Send ("^a")
        MouseClick("right",$search,$clicks,8)
        TrayTip("Congratulations", "You attacked everyone with success",0)
        Sleep(1000)
    Else
        TrayTip ("Error", "Cannot find correct window. Closing...",0)
        Sleep (5000)
        Exit
    EndIf
    Sleep(1000)
    Exit
WEnd

Anyone know why? o_O

Edited by SofaKingWeTardEd
Link to comment
Share on other sites

your problem is probably that your using the same variable name 4 every pixel search, try diffrent name or try to use if @error

MouseClick("right",$search,$clicks,8)

if im not wrong in this case its

MouseClick("right",$search[0],$search[1],$clicks,8)

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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

your problem is probably that your using the same variable name 4 every pixel search, try diffrent name or try to use if @error

MouseClick("right",$search,$clicks,8)

if im not wrong in this case its

MouseClick("right",$search[0],$search[1],$clicks,8)

I changed the variables to:

$search1 = PixelSearch (0,0,0,0,$Elephant1,0)
    $search2 = PixelSearch (0,0,0,0,$Elephant2,0)
    $search3 = PixelSearch (0,0,0,0,$Elephant3,0)
    $search4 = PixelSearch (0,0,0,0,$Elephant4,0)
    $search5 = PixelSearch (0,0,0,0,$Elephant5,0)
    $search6 = PixelSearch (0,0,0,0,$Elephant6,0)
    $search7 = PixelSearch (0,0,0,0,$Elephant7,0)
    $search8 = PixelSearch (0,0,0,0,$Elephant8,0)oÝ÷ ٩ݶ¦¢ërXÚºÚ"µÍ[ÝÙPÛXÚÊ ][ÝÜYÚ   ][ÝË  ÌÍÜÙXÚÌWK ÌÍÜÙXÚÌK  ÌÍÜÙXÚÌ×K    ÌÍÜÙXÚÍK  ÌÍÜÙXÚÍWK ÌÍÜÙXÚÍK  ÌÍÜÙXÚÍ×K    ÌÍÜÙXÚÎK  ÌÍØÛXÚÜË

But the main problem is that it isn't working within the game screen.

It's clicking my desktop :)

Link to comment
Share on other sites

combine it like this

MouseClick("right",$search1[0],$search1[1],$clicks,8)
MouseClick("right",$search2[0],$search2[1],$clicks,8)
MouseClick("right",$search3[0],$search3[1],$clicks,8)
MouseClick("right",$search4[0],$search4[1],$clicks,8)
MouseClick("right",$search5[0],$search5[1],$clicks,8)
MouseClick("right",$search6[0],$search6[1],$clicks,8)
MouseClick("right",$search7[0],$search7[1],$clicks,8)
MouseClick("right",$search8[0],$search8[1],$clicks,8)

what game? does it have protection? and whats the win name?

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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

try this

;Pixels of Enemies
$Elephant1 = 0x296163
$Elephant2 = 0x089a08
$Elephant3 = 0xbd9a18
$Elephant4 = 0xc69a08
$Elephant5 = 0xc65929
$Elephant6 = 0xde6542
$Elephant7 = 0xa52000
$Elephant8 = 0x101421


Global $Button[1]
While 1
    $Win = WinGetPos("Game Name","")
 
   $search1 = PixelSearch (0,0,0,0,$Elephant1,0)
    $search2 = PixelSearch (0,0,0,0,$Elephant2,0)
    $search3 = PixelSearch (0,0,0,0,$Elephant3,0)
    $search4 = PixelSearch (0,0,0,0,$Elephant4,0)
    $search5 = PixelSearch (0,0,0,0,$Elephant5,0)
    $search6 = PixelSearch (0,0,0,0,$Elephant6,0)
    $search7 = PixelSearch (0,0,0,0,$Elephant7,0)
    $search8 = PixelSearch (0,0,0,0,$Elephant8,0)
     If UBound($Win) > 0 Then
        Send ("^a")
        for $c =1 to 8
        Dim $search[$search[0][0]]
        MouseClick("right",$search[$search[$c]][0],$search[$search[$c]][1],1,0)
       Next
       TrayTip("Congratulations", "You attacked everyone with success",0)
        Sleep(1000)
    Else
        TrayTip ("Error", "Cannot find correct window. Closing...",0)
        Sleep (5000)
        Exit
    EndIf
    Sleep(1000)
    Exit
WEnd
Link to comment
Share on other sites

MouseClick doesn't take an array as a point, it takes two separate x and y variables. That is the biggest problem.

maby the problem is that he dont have winactivate command on start of the script ^^

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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

it would be helpfull to know if what game your playing

ok. i improved it

;Pixels of Enemies
dim $Elephant[8]
$Elephant1 = 0x296163
$Elephant2 = 0x089a08
$Elephant3 = 0xbd9a18
$Elephant4 = 0xc69a08
$Elephant5 = 0xc65929
$Elephant6 = 0xde6542
$Elephant7 = 0xa52000
$Elephant8 = 0x101421

While 1
        Send ("^a")
        for $c =1 to 8
        $search = PixelSearch (0,0,0,0,$Elephant[$Elephant[$c]],0)  
        if @error = 0 then
        MouseClick("right",$search[0],$search[1],1,0)
EndIf     
      Next
     sleep(1000)
WEnd
Edited by Aceguy
Link to comment
Share on other sites

it would be helpfull to know if what game your playing

I can't really discuss the game I am playing, because alot of them lurk this forum for cheats of their own. And if they got hold of this one, it would cause *mayhem* upon them. And the protection is non-existent.

All I can say is it's old. And, I know i'm typing everything right within the Window name.

But, at most it's size is 800x600, and windowed.

Just shoots off and doesn't work @_@

[Edit]

Valuater, that helped a ton. It now does the game client. ^_^

But, now it just goes to the top left hand of the Client :) :)

Edited by SofaKingWeTardEd
Link to comment
Share on other sites

I have removed the co-ords from this code, but the ones I used where: 300,400,300,400

why you use coordinates 300,400,300,400?

isn it logical to use 0,0,300,400

if you use 300,400,300,400 itl bring almost the same results like PixelGetColor, r you scaning only 1 pixel?

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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

Oh... come-on

ok -

go to the top-left corner and use the numbers like this

left,top

goto the bottom right corner and use the numbers like this

right,bottom

$search1 = pixel search (left,top,right,bottom,$Elephant1, 10, 10) ; change that last 2 numbers to 10

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

Oh... come-on

ok -

go to the top-left corner and use the numbers like this

left,top

goto the bottom right corner and use the numbers like this

right,bottom

8)

Ohhhhh!!! I'm sooo silly.

The Co-ords from left, top, right and bottom where:

139,343 - Left

767,272 - Right

393,60 - Top

393,467 - Bottom

I thought you used the first Co-ord and placed them in to work. (139,767,393,393)!

Wow, I really do lack common sense.. :)

Thank you Valuater :">

Link to comment
Share on other sites

Opt("MouseCoordMode", 2) ;1=absolute, 0=relative, 2=client
Opt("PixelCoordMode", 2) ;1=absolute, 0=relative, 2=client

HotKeySet ("{F1}", "PK")
HotKeySet ("{F2}", "End")

;Elephant Pixels
$Elephant1 = 0x296163
$Elephant2 = 0x089a08
$Elephant3 = 0xbd9a18
$Elephant4 = 0xc69a08
$Elephant5 = 0xc65929
$Elephant6 = 0xde6542
$Elephant7 = 0xa52000
$Elephant8 = 0x101421

;Mouseclick options.
$button = "right"
$clicks = 1

While 1
    Sleep (1)
WEnd

Func PK()
While 1
    $Win = WinGetPos("GAME","")

$search = PixelSearch (143,143,766,467,$Elephant1,10,10)
$search = PixelSearch (143,143,766,467,$Elephant2,10,10)
$search = PixelSearch (143,143,766,467,$Elephant3,10,10)
$search = PixelSearch (143,143,766,467,$Elephant4,10,10)
$search = PixelSearch (143,143,766,467,$Elephant5,10,10)
$search = PixelSearch (143,143,766,467,$Elephant6,10,10)
$search = PixelSearch (143,143,766,467,$Elephant7,10,10)
$search = PixelSearch (143,143,766,467,$Elephant8,10,10)
  
     If UBound($Win) > 0 Then
        Send ("^a")
        MouseClick("right",$search,$clicks,8,0)
       TrayTip("Congratulations", "You attacked everyone with success",0)
    Sleep(1000)
    Else
        TrayTip ("Error", "Cannot find correct window. Closing...",0)
        Sleep (5000)
        Exit
    EndIf
    Sleep(1000)
    Exit
WEnd
EndFunc

Func End()
    Exit
    EndFunc

Still jumps up to the left. :)

Edited by SofaKingWeTardEd
Link to comment
Share on other sites

Opt("MouseCoordMode", 2);1=absolute, 0=relative, 2=client
Opt("PixelCoordMode", 2);1=absolute, 0=relative, 2=client

HotKeySet ("{F1}", "PK")
HotKeySet ("{F2}", "End")

;Elephant Pixels
$Elephant1 = 0x296163
$Elephant2 = 0x089a08
$Elephant3 = 0xbd9a18
$Elephant4 = 0xc69a08
$Elephant5 = 0xc65929
$Elephant6 = 0xde6542
$Elephant7 = 0xa52000
$Elephant8 = 0x101421

;Mouseclick options.
$button = "right"
$clicks = 1

While 1
    Sleep (1)
WEnd

Func PK()
While 1
    $Win = WinGetPos("GAME","")
     If UBound($Win) > 0 Then
        Send ("^a")
       for $c =1 to 8
        $search = PixelSearch (0,0,0,0,$Elephant[$Elephant[$c]],0)  
        if @error = 0 then
        MouseClick("right",$search[0],$search[1],1,0)
endif             
 next
       TrayTip("Congratulations", "You attacked everyone with success",0)
    Sleep(1000)
    Else
        TrayTip ("Error", "Cannot find correct window. Closing...",0)
        Sleep (5000)
        Exit
    EndIf
    Sleep(1000)
    Exit
WEnd
EndFunc

Func End()
    Exit
    EndFunc

Edited by Aceguy
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...