Sign in to follow this  
Followers 0
sandman

What have I done wrong?

3 posts in this topic

; Autolooter by sandman: made for 1280x1024 screens. Soon to be remodeled for other screen sizes.

#include <GUIConstants.au3>
$lootwin = GUICreate("AutoLoot 0.1", 301, 101, 302, 173)
$startbtn = GUICtrlCreateButton("Start", 24, 16, 75, 25, 0)
$helpbtn = GUICtrlCreateButton("Help", 24, 56, 75, 25, 0)
$stopbtn = GUICtrlCreateButton("Stop", 176, 16, 75, 25, 0)
$aboutbtn = GUICtrlCreateButton("About", 176, 56, 75, 25, 0)
GUISetState(@SW_SHOW)

$active = 0

Dim $msg, $msg2, $msg3, $msg4, $msg5

While 1
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg2 = $startbtn
            CheckActive()
        Case $msg3 = $stopbtn
            CheckActive()
        Case $msg4 = $helpbtn
            MsgBox(0, "Help", "The most commonly experienced problem and probably the only problem is that for some reason, the program isn't doing anything to" & _
            "affect the MYKO window. This is almost definitely because you need to run the HS bypass program by frognik before you run MYKO and this autolooter" & _
            "each time before you start playing.")
        Case $msg5 = $aboutbtn
            MsgBox(0, "About", "This program was created by sandman in a 1-week time period. Copying this product and redistributing said product is strictly" & _
            "prohibited unless you or the reproducer, whoever he or she is, has my formal written permission and authorization that I have given this permission." & _
            "Questions and comments can go to may_contain_peanuts@yahoo.com. (C) 2007 sandman. All rights reserved.")
    EndSelect
WEnd
    
Func CheckActive()
    If $active = 0 Then
        AdLibEnable("loot")
        GUICtrlSetState($startbtn, $GUI_DISABLE)
        GUICtrlSetState($stopbtn, $GUI_ENABLE)
        $start = 1
    Else
        AdLibDisable("loot")
        GUICtrlSetState($startbtn, $GUI_ENABLE)
        GUICtrlSetState($stopbtn, $GUI_DISABLE)
        $start = 0
    EndIf
EndFunc

Func loot()
    While 1
        $treasure = PixelSearch(0, 0, 1280, 1024, "40281e") ; Search for a treasure box
        If Not @error Then
            MouseClick("", $treasure[0], $treasure[1])
            Sleep(2000)
        EndIf
        $loot1 = PixelSearch(0, 0, 1280, 1024, "796d5f") ; Search for money if it is dropped
        If Not @error Then
            MouseClick("", $loot1[0], $loot1[1])
        EndIf       
        Sleep(1000)
    WEnd
EndFunc

I don't see any errors in here and neither does the editor, but the program isn't responding. I have to exit it via the tray.

What did I do wrong?


[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Share this post


Link to post
Share on other sites



While 1
    $msg = GUIGetMsg();<<<--- You forgot to tell it to look for a message ;)
    Select


[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

Oh.. wow. That was a bad mistake. Thanks Smoke!


[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

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