Jump to content

Recommended Posts

Posted

OK to start out, heres my code

Func Pindle()
    WinWait("Diablo II", "")
    If Not WinActive("Diablo II", "") Then WinActivate("Diablo II", "")
    WinWaitActive("Diablo II", "")
    Sleep(1000)
    Send("{F1}")
    Sleep(500)
    MouseMove(452, 115)
    MouseDown("right")
    MouseUp("right")
    Sleep(2000)
    MouseMove(757, 139)
    MouseDown("right")
    MouseUp("right")
    Sleep(2000)
    MouseMove(786, 103)
    MouseDown("right")
    MouseUp("right")
    Sleep(2000)
    MouseMove(464, 233)
    MouseDown("right")
    MouseUp("right")
    MouseMove(464, 233)
    MouseDown("right")
    MouseUp("right")
    Sleep(50)
    Send("{F3}")
;PixelSearch Monsters
    MonsterFinding()
    Sleep(50)
    Send("{F1}")
    Sleep(500)
    MouseMove(713, 146)
    MouseDown("right")
    MouseUp("right")
    EndGame()
EndFunc  ;==>Pindle

Func MonsterFinding()
    Do
        Sleep(25)
        $MonsterFind = PixelSearch(0, 0, 800, 600, $Monsters)
        If Not @error Then
            Send("{F3}")
            MouseClick("right", $MonsterFind[0], $MonsterFind[1])
        EndIf
    Until 1
EndFunc  ;==>MonsterFinding

OK, so my script basically justs goes into a portal inside a game, then inside Func Monsterfinding, it trys to find the monsters colors, however, if i just use monsterfinding in a script, it works fine, but when i put it into Func Pindle, it will not work, i want it to teleport to the location, which it does, then loop monster finding until all the monsters are dead.

Any ideas O.o

Posted (edited)

Well, much like your topic suggests, you need to put a loop in your Pindle function that will repeat the teleporting and MonsterFinding part... But from what you have posted it's not clear which part is important for the teleporting so it's kinda hard for me to tell you where to put it..

Further, if you're going to do such a loop, you'll have to figure out how to exit it (like what you can check for to know you're done).

*Edit: Example:

_FirstFunc()

Func _FirstFunc()
For $x = 10 to 1 Step -1
    _SecondFunc($x)
Next

MsgBox (0, "Done!", "") 
EndFunc

Func _SecondFunc($count)
    MsgBox (0, "Countdown", $count)
EndFunc
Edited by exodius

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
×
×
  • Create New...