Jump to content

Func ; Not working


Recommended Posts

K heres my code

Func Pindle()
    Send("{F1}")
    Sleep(250)
    MouseMove(444, 128)
    MouseDown("right")
    MouseUp("right")
    Sleep(250)
    MouseMove(700, 141)
    MouseDown("right")
    MouseUp("right")
    Sleep(250)
    MouseMove(728, 157)
    MouseDown("right")
    MouseUp("right")
    Sleep(250)
    MouseMove(687, 110)
    MouseDown("right")
    MouseUp("right")
    Sleep(250)
    Send("{F3}")
    Sleep(50)
    Do
        Sleep(20)
        $MonsterFind = PixelSearch(0, 0, 800, 600, $Monsters)
        If Not @error Then
            MouseClick("right", $MonsterFind[0], $MonsterFind[1])
        EndIf
    Until 1
    Send("{F1}")
    Sleep(250)
    MouseMove(673, 197)
    MouseDown("right")
    MouseUp("right")
; Pickit
    Sleep(250)
    MouseMove(673, 198)
    MouseDown("right")
    MouseUp("right")
    Sleep(250)
; Walk to halls of anguish so we dont get raped by the xtras
    MouseMove(536, 199)
    MouseDown("left")
    MouseUp("left")
    Sleep(250)
    EndGame()

All this does is teleport to an area.

Then it kills all the modded monsters which are orange, and it is supposed to kill all of them. Hence the loop

Unfortunatly, it doesnt even perform the loop.

Does anyone know why?

Link to comment
Share on other sites

don't play the game personally but

MouseMove(444, 128)
    MouseDown("right")
    MouseUp("right")

??

mouseclick surely as there is no gap between?

3 lines into 1!

also:

sleep (20)

don't bother, thats 1/500 th of a second.

until 1?

try until @error = 1 ??

I can't run it I don't have the game, but try it!

Edit: code! - Much neater!

Send("{F1}")
    Sleep(250)
    MouseClick ("Right", 444, 128, 1)
    Sleep(250)
    MouseClick ("Right", 700, 141, 1)
    Sleep(250)
    MouseClick ("Right", 728, 157, 1)
    Sleep(250)
    MouseClick ("Right", 687, 110, 1)
    Sleep(250)
    Send("{F3}")
    Do
        $MonsterFind = PixelSearch(0, 0, 800, 600, $Monsters)
        If Not @error Then
            MouseClick("right", $MonsterFind[0], $MonsterFind[1])
        EndIf
    Until @Error <> 0
    Send("{F1}")
    Sleep(250)
    MouseClick ("Right", 673, 197, 1)
; Pickit
    Sleep(250)
    MouseClick ("Right", 673, 198, 1)
    Sleep(250)
; Walk to halls of anguish so we dont get raped by the xtras
    MouseClick ("Left", 536, 199, 1)
    Sleep(250)
    EndGame()
Edited by mdiesel
Link to comment
Share on other sites

don't play the game personally but

MouseMove(444, 128)
    MouseDown("right")
    MouseUp("right")

??

mouseclick surely as there is no gap between?

3 lines into 1!

also:

sleep (20)

don't bother, thats 1/500 th of a second.

until 1?

try until @error = 1 ??

I can't run it I don't have the game, but try it!

Edit: code! - Much neater!

Send("{F1}")
    Sleep(250)
    MouseClick ("Right", 444, 128, 1)
    Sleep(250)
    MouseClick ("Right", 700, 141, 1)
    Sleep(250)
    MouseClick ("Right", 728, 157, 1)
    Sleep(250)
    MouseClick ("Right", 687, 110, 1)
    Sleep(250)
    Send("{F3}")
    Do
        $MonsterFind = PixelSearch(0, 0, 800, 600, $Monsters)
        If Not @error Then
            MouseClick("right", $MonsterFind[0], $MonsterFind[1])
        EndIf
    Until @Error <> 0
    Send("{F1}")
    Sleep(250)
    MouseClick ("Right", 673, 197, 1)
; Pickit
    Sleep(250)
    MouseClick ("Right", 673, 198, 1)
    Sleep(250)
; Walk to halls of anguish so we dont get raped by the xtras
    MouseClick ("Left", 536, 199, 1)
    Sleep(250)
    EndGame()
Heh the 3 lines were from a copy-tool.

One novice question.

Do

$MonsterFind = PixelSearch(0, 0, 800, 600, $Monsters)

If Not @error Then

MouseClick("right", $MonsterFind[0], $MonsterFind[1])

EndIf

Until @Error <> 0

Whats the <> Mean.

Link to comment
Share on other sites

is not equal to. in maths terms, would be similar to:

----------//--

---------//---

--------//----

===========

------//------

===========

----//--------

---//---------

--//----------

(couldn't help it sorry)

@error = 0 means success

@error <> 0 means failure

Edited by mdiesel
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...