Sign in to follow this  
Followers 0
lolifox

Troubles with pixels

9 posts in this topic

#1 ·  Posted (edited)

Hello. ahem... this game is NOT online neither english game, so i assume its safe to post (since i wont mention it's name it moar safer :mellow:)

alright here's my problem... i just want that it would be auto on very short range, in other words just few clicks is involved based on pixel search... sooo that's what i gathered till now :

Global $Pixel

HotKeySet("{ESC}", "Close")
HotKeySet("{SPACE}", "TogglePause")

Sleep(2000)

While 1
Sleep(100)

Do
    $Pixel = PixelSearch(851, 420, 848, 371, 0x2C3D49)  ; first click
    MouseClick("right", 497, 352, 5, 1)
    Sleep(300)
Until Not IsArray($Pixel)

Do
    $Pixel = PixelSearch(423, 282, 420, 233, 0xFDF7E7)  ; searching for mobs
    MouseClick("left", 423, 282, 5, 1)
    Sleep(2600)
Until Not IsArray($Pixel)

Do
    $Pixel = PixelSearch(541, 330, 538, 281, 0xFFFFFF)  ; clicking on info
    MouseClick("left", 541, 330, 5, 1)
    Sleep(200)
Until Not IsArray($Pixel)

Do
    $Pixel = PixelSearch(196, 317, 193, 268, 0x467C5E)  ; starting auto-battle
    MouseMove(196, 317, 5)
    Sleep(100)
    MouseClick("left", 196, 317, 5, 1)
    Sleep(200)
Until Not IsArray($Pixel)

Do
    $Pixel = PixelSearch(453, 114, 450, 65, 0xE398C4)   ; picking loot
    MouseClick("left", 510, 318, 5, 2)
    Sleep(300)
Until Not IsArray($Pixel)

Do
    $Pixel = PixelSearch(664, 286, 661, 237, 0xF5DF94)  ; sccepting heal
    MouseClick("left", 510, 318, 5, 1)
    Sleep(200)
Until Not IsArray($Pixel)

Do
    $Pixel = PixelSearch(18, 606, 15, 557, 0x191A21)    ; skipping text
    MouseClick("left", 510, 218, 15, 5)
    Sleep(200)
Until Not IsArray($Pixel)

WEnd

Func TogglePause()
    $Paused = NOT $Paused
While $Paused
    sleep(100)
    ToolTip('Script is "Paused"', 0, 0)
WEnd
    ToolTip("")
EndFunc


Func Close()
    Exit 0
EndFunc  ;Terminate

sooo it should just click on when when defined pixel is on screen, but... it looks like it doesn't do anything apart mouseclick line... maybe someone can enlighten me, how to work correctly with pixelsearch

and second question, can i set the priority what pixel after another must go? like "clicking info" and "skipping text" would be top priority, when pixel is met

thanks for any reply

Edited by lolifox

Share this post


Link to post
Share on other sites



thanks for reply, but no offense... that was the point of this thread, "Why it doesn't pixelsearch......"

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

What if you try debbugging it?

Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites

well it just replies all clicks in a row... if battle prolongs, it starts messing up things, i know since i'm using autoclicker function pretty long time. i tried to add tool tips where and what clicks is used, and it showed it just spams them...

as for debug didn't tried it, could you explain in more detailed way?

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Maybe, something like this.

Global $Paused = False
Local $Pixel1, $Pixel2, $Pixel3, $Pixel4, $Pixel5, $Pixel6, $Pixel7

HotKeySet("{ESC}", "Close")
HotKeySet("{SPACE}", "TogglePause")

Do
    While 1
        Sleep(10)

        $Pixel1 = PixelSearch(851, 420, 848, 371, 0x2C3D49) ; first click
        $Pixel2 = PixelSearch(423, 282, 420, 233, 0xFDF7E7) ; searching for mobs
        $Pixel3 = PixelSearch(541, 330, 538, 281, 0xFFFFFF) ; clicking on info
        $Pixel4 = PixelSearch(196, 317, 193, 268, 0x467C5E) ; starting auto-battle
        $Pixel5 = PixelSearch(453, 114, 450, 65, 0xE398C4) ; picking loot
        $Pixel6 = PixelSearch(664, 286, 661, 237, 0xF5DF94) ; sccepting heal
        $Pixel7 = PixelSearch(18, 606, 15, 557, 0x191A21) ; skipping text

        Select
            Case IsArray($Pixel1)
                MouseClick("right", 497, 352, 5, 1)
                Sleep(300)
            Case IsArray($Pixel2)
                MouseClick("left", 423, 282, 5, 1)
                Sleep(2600)
            Case IsArray($Pixel3)
                MouseClick("left", 541, 330, 5, 1)
                Sleep(200)
            Case IsArray($Pixel4)
                MouseMove(196, 317, 5)
                Sleep(100)
                MouseClick("left", 196, 317, 5, 1)
                Sleep(200)
            Case IsArray($Pixel5)
                MouseClick("left", 510, 318, 5, 2)
                Sleep(300)
            Case IsArray($Pixel6)
                MouseClick("left", 510, 318, 5, 1)
                Sleep(200)
            Case IsArray($Pixel7)
                MouseClick("left", 510, 218, 15, 5)
                Sleep(200)
        EndSelect
    WEnd
Until 0


Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
EndFunc ;==>TogglePause

Func Close()
    Exit 0
EndFunc ;==>Close
Edited by Malkey

Share this post


Link to post
Share on other sites

whoa... malkey thank you very much, now i just need to fix correct colors and vualia :mellow:

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