Sign in to follow this  
Followers 0
Xoenix

It just wont work :(

4 posts in this topic

#1 ·  Posted (edited)

Well I tried...

I think the problem is something with TimerInit and TimerDiff

;) Really appreciate some help here.

#include <GuiConstants.au3>

GuiCreate("Smart Bot - Ant Tunnel", 348, 223, 366,266)
$n = GUICtrlCreatePic(@Systemdir & "\oobe\images\wpakey.jpg",0,0, 366,266)
GuiCtrlSetState($n, $GUI_DISABLE)
$Button1 = GuiCtrlCreateButton("About", 80, 72, 57, 33)
$Button2 = GuiCtrlCreateButton("Stop", 200, 72, 57, 33)
$Button3 = GuiCtrlCreateButton("Start", 200, 112, 57, 33)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button1;Channel Button
        MsgBox (0, "About", "Version 1.0 - Made by Xoenix - (Copyright) 2005")
    Case $msg = $Button2;Stop Button
        Terminate()
    Case $msg = $Button3;Start Button
        Overall()
    Case Else
;;;
    EndSelect
WEnd
Exit


;Terminate
Func Terminate()
    Exit 0
EndFunc

Func Overall()
    While 1
        WinWaitActive("MapleStory")
        $coord2 = PixelSearch( 590, 355, 768, 392, 0x557799, 0, 2 )
        While @error = 0
            Send ("{ALT}")
            Sleep (1000)
            $coord2 = PixelSearch( 590, 355, 768, 392, 0x557799, 0, 2 )
            local $time = timerInit()
        Wend
        While 1
            If MonsterFind() then
                Attack()
                $time = timerInit()
            endIf
            if timerDiff($time) > 10000 then exitLoop
            sleep(100)
        Wend
        Send("{ESC}")
        Sleep(600)
        Send("{ENTER}")
        Sleep(600)
        Send("{RIGHT}")
        Sleep(200)
        Send("{ENTER}")
        Sleep(5000)
        Send ("{RIGHT down}")
        Sleep (500)
        Send ("{RIGHT up}")
        Sleep (500)
    Wend
EndFunc

;Attack
Func Attack()
    While 1
        WinWaitActive("MapleStory")
        $coord2 = PixelSearch( 590, 355, 768, 392, 0x557799, 0, 2 )
        While @error = 0
            Send ("{ALT}")
            Sleep (1000)
            $coord2 = PixelSearch( 590, 355, 768, 392, 0x557799, 0, 2 )
        Wend
        Sleep (10000)
        Send("{ESC}")
        Sleep(600)
        Send("{ENTER}")
        Sleep(600)
        Send("{RIGHT}")
        Sleep(200)
        Send("{ENTER}")
        Sleep(5000)
        Send ("{RIGHT down}")
        Sleep (500)
        Send ("{RIGHT up}")
        Sleep (500)
    WEnd
EndFunc

;Find Monster
Func MonsterFind()
    While 1
        $coord2 = PixelSearch( 590, 355, 768, 392, 0x557799, 0, 2 )
        While @error = 0
            Send ("{ALT}")
            Sleep (1000)
        WEnd
    Wend
EndFunc

I just have no idea, the guy keeps attacking, never stops.

I tried troubleshooting but I don't fully understand what I've got in there, someone shed some light on this?

Edited by Larry

Share this post


Link to post
Share on other sites



This doesn't look right: If MonsterFind() then

Try debugging:

If MonsterFind() then

MsgBox(0, "No Error", "Testing Complete", 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.

Share this post


Link to post
Share on other sites

You are stuck in MonsterFind(). There is no out, no Return, no ExitLoop in that function. Also, your If MonsterFind() is invalid because MonsterFind() does not return any boolean info... that is Return 0 or Return 1.

Same for Attack().

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

So I have 2 neverending functions... I'll fix em up best I can, and still no luck Ill ask you peeps again ;)

Thanks for the help :P

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