Sign in to follow this  
Followers 0
notakiller

Cant Find My Scripting Error

4 posts in this topic

hi guys i did that script based on color changes (to pick items ...) and yet its not working properly ... i want it to scan those points and when something changes there it picks it ... but if it dont find a color change it has to scan the rest of the places ... now when it scan 1 place that changes it starts to try to pick all the rest 2 :)

heres the script

While 1

$checksum = PixelChecksum(140,245,142,247)

While $checksum = PixelChecksum(140,245,142,247)

Sleep(100)

$checksum = PixelChecksum(171,231,173,233)

While $checksum = PixelChecksum(171,231,173,233)

Sleep(100)

$checksum = PixelChecksum(194,222,196,224)

While $checksum = PixelChecksum(194,222,196,224)

Sleep(100)

$checksum = PixelChecksum(296,166,298,168)

While $checksum = PixelChecksum(296,166,298,168)

Sleep(100)

$checksum = PixelChecksum(330,151,332,153)

While $checksum = PixelChecksum(330,151,332,153)

Sleep(100)

$checksum = PixelChecksum(351,139,353,141)

While $checksum = PixelChecksum(351,139,353,141)

Sleep(100)

$checksum = PixelChecksum(408,144,410,146)

While $checksum = PixelChecksum(408,144,410,146)

Sleep(100)

$checksum = PixelChecksum(424,151,426,153)

While $checksum = PixelChecksum(424,151,426,153)

Sleep(100)

$checksum = PixelChecksum(571,218,573,220)

While $checksum = PixelChecksum(571,218,573,220)

Sleep(100)

$checksum = PixelChecksum(599,235,601,237)

While $checksum = PixelChecksum(599,235,601,237)

Sleep(100)

WEnd

MouseMove(599,235)

MouseDown("left")

MouseUp("left")

Sleep(500)

MouseMove(639,302)

MouseDown("left")

MouseUp("left")

Sleep(11000)

WEnd

MouseMove(571,218)

MouseDown("left")

MouseUp("left")

Sleep(500)

MouseMove(610,246)

MouseDown("left")

MouseUp("left")

Sleep(11000)

WEnd

MouseMove(424,151)

MouseDown("left")

MouseUp("left")

Sleep(500)

MouseMove(464,179)

MouseDown("left")

MouseUp("left")

Sleep(11000)

WEnd

MouseMove(408,144)

MouseDown("left")

MouseUp("left")

Sleep(500)

MouseMove(448,172)

MouseDown("left")

MouseUp("left")

Sleep(11000)

WEnd

MouseMove(351,139)

MouseDown("left")

MouseUp("left")

Sleep(500)

MouseMove(391,167)

MouseDown("left")

MouseUp("left")

Sleep(11000)

WEnd

MouseMove(330,151)

MouseDown("left")

MouseUp("left")

Sleep(500)

MouseMove(370,179)

MouseDown("left")

MouseUp("left")

Sleep(11000)

WEnd

MouseMove(296,166)

MouseDown("left")

MouseUp("left")

Sleep(500)

MouseMove(336,194)

MouseDown("left")

MouseUp("left")

Sleep(11000)

WEnd

MouseMove(194,222)

MouseDown("left")

MouseUp("left")

Sleep(500)

MouseMove(234,250)

MouseDown("left")

MouseUp("left")

Sleep(11000)

WEnd

MouseMove(171,231)

MouseDown("left")

MouseUp("left")

Sleep(500)

MouseMove(211,259)

MouseDown("left")

MouseUp("left")

Sleep(11000)

WEnd

MouseMove(140,245)

MouseDown("left")

MouseUp("left")

Sleep(500)

MouseMove(180,273)

MouseDown("left")

MouseUp("left")

Sleep(11000)

WEnd

Share this post


Link to post
Share on other sites



That looks like way too many nested While loops. Start by looking at your code with correct indentation and see if anything seems wrong to you. If you really want it to look like that (which I really doubt), you really should change the variable names.

What I suspect is the case is that you want a big loop to go on the outside, with each check and reaction on the inside.

While 1
    $checksum = PixelChecksum(140,245,142,247)
    While $checksum = PixelChecksum(140,245,142,247)
        Sleep(100)
        $checksum = PixelChecksum(171,231,173,233)
        While $checksum = PixelChecksum(171,231,173,233)
            Sleep(100)
            $checksum = PixelChecksum(194,222,196,224)
            While $checksum = PixelChecksum(194,222,196,224)
                Sleep(100)
                $checksum = PixelChecksum(296,166,298,168)
                While $checksum = PixelChecksum(296,166,298,168)
                    Sleep(100)
                    $checksum = PixelChecksum(330,151,332,153)
                    While $checksum = PixelChecksum(330,151,332,153)
                        Sleep(100)
                        $checksum = PixelChecksum(351,139,353,141)
                        While $checksum = PixelChecksum(351,139,353,141)
                            Sleep(100)
                            $checksum = PixelChecksum(408,144,410,146)
                            While $checksum = PixelChecksum(408,144,410,146)
                                Sleep(100)
                                $checksum = PixelChecksum(424,151,426,153)
                                While $checksum = PixelChecksum(424,151,426,153)
                                    Sleep(100)
                                    $checksum = PixelChecksum(571,218,573,220)
                                    While $checksum = PixelChecksum(571,218,573,220)
                                        Sleep(100)
                                        $checksum = PixelChecksum(599,235,601,237)
                                        While $checksum = PixelChecksum(599,235,601,237)
                                            Sleep(100)
                                        WEnd
                                        MouseMove(599,235)
                                        MouseDown("left")
                                        MouseUp("left")
                                        Sleep(500)
                                        MouseMove(639,302)
                                        MouseDown("left")
                                        MouseUp("left")
                                        Sleep(11000)
                                    WEnd
                                    MouseMove(571,218)
                                    MouseDown("left")
                                    MouseUp("left")
                                    Sleep(500)
                                    MouseMove(610,246)
                                    MouseDown("left")
                                    MouseUp("left")
                                    Sleep(11000)
                                WEnd
                                MouseMove(424,151)
                                MouseDown("left")
                                MouseUp("left")
                                Sleep(500)
                                MouseMove(464,179)
                                MouseDown("left")
                                MouseUp("left")
                                Sleep(11000)
                            WEnd
                            MouseMove(408,144)
                            MouseDown("left")
                            MouseUp("left")
                            Sleep(500)
                            MouseMove(448,172)
                            MouseDown("left")
                            MouseUp("left")
                            Sleep(11000)
                        WEnd
                        MouseMove(351,139)
                        MouseDown("left")
                        MouseUp("left")
                        Sleep(500)
                        MouseMove(391,167)
                        MouseDown("left")
                        MouseUp("left")
                        Sleep(11000)
                    WEnd
                    MouseMove(330,151)
                    MouseDown("left")
                    MouseUp("left")
                    Sleep(500)
                    MouseMove(370,179)
                    MouseDown("left")
                    MouseUp("left")
                    Sleep(11000)
                WEnd
                MouseMove(296,166)
                MouseDown("left")
                MouseUp("left")
                Sleep(500)
                MouseMove(336,194)
                MouseDown("left")
                MouseUp("left")
                Sleep(11000)
            WEnd
            MouseMove(194,222)
            MouseDown("left")
            MouseUp("left")
            Sleep(500)
            MouseMove(234,250)
            MouseDown("left")
            MouseUp("left")
            Sleep(11000)
        WEnd
        MouseMove(171,231)
        MouseDown("left")
        MouseUp("left")
        Sleep(500)
        MouseMove(211,259)
        MouseDown("left")
        MouseUp("left")
        Sleep(11000)
    WEnd
    MouseMove(140,245)
    MouseDown("left")
    MouseUp("left")
    Sleep(500)
    MouseMove(180,273)
    MouseDown("left")
    MouseUp("left")
    Sleep(11000)
WEnd

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

wow thx for the fast reply :) mmm yeah in that structure its way better lol thanks alot :mellow: also another question >< im creating a bot, ... i dont think pixelcheksum is the best way to make my bot work ... i need it to detect when an area is able to be used and just go to it any suggestion (like to go fishing when theres like flies on the water) thanks alot :)

Edited by notakiller

Share this post


Link to post
Share on other sites

Sounds like a World of Warcraft bot... might want to try searching the forums first. I'm not really sure how well pixelchecksum will work in that case...

Also, I suggest getting Scite (code editor with formatting, coloring, etc) and beta (more functions, better stuff) to improve your program.

http://www.autoitscript.com/autoit3/files/beta/autoit/

http://www.autoitscript.com/autoit3/scite/downloads.php

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