Jump to content

Use new instructions once number is reached?


Recommended Posts

Hello all,

I'm trying to make a script that drags stuff around for me. My question is, is there a way to make the script start dragging from a different location after it's made a certain number of grabs from the first spot? I assume that I'll need to use a variable to determine when the number is reached, but I'm not sure how to make it switch when it hits that number. Any help would be appreciated :)

Link to comment
Share on other sites

Maybe something like this:

(sorry if my syntax is wrong, been doing alot of lua lately.

Global $YourVariable = 0 ;Lets pretend we do the first event up until this $Variable reaches 10

While True
    If Not $YourVariable = 10 Then
        ;Put the code here that you want to do while your $Variable ISNT 10 (for example remember) and add 1 to the $Variable to show we have done 1 loop
        $YourVariable += 1
    Else
        ;And put the code here that you want to do when the $Variable reaches 10
        ;Also if you want to you can reset the $Variable back to 0 if you want to go back to doing the first event another 10 times
        $YourVariable = 0
    EndIF
Wend
Click here for the best AutoIt help possible.Currently Working on: Autoit RAT
Link to comment
Share on other sites

Hmm, That didn't seem to work... Maybe I implemented it wrong... Here is a sample of my script:

Global $mat1 = 0        
While True
            If Not $mat1 = 2 then
                switch $maxhp
                Case $nMsg = $Button1
                For $a = 1 To GUICtrlRead($maxhp)
                Next
                Case $GUI_EVENT_CLOSE
                EndSwitch
                Exit
                MouseClickDrag ( "left", 3289, 92, 2989, 99 )
                sleep(1000)
                MouseClickDrag ( "left", 2989, 99, 3289, 92 )
                $mat1 += 1
                sleep(1000)
       Else
                switch $maxhp
                Case $nMsg = $Button1
                For $a = 1 To GUICtrlRead($maxhp)
                Next
                Case $GUI_EVENT_CLOSE
                EndSwitch
                Exit
                MouseClickDrag ( "left", 3292, 167, 2910, 164 )
                sleep(1000)
                MouseClickDrag ( "left", 2910, 164, 3292, 167 )
            EndIf
WEnd

This is the part of the code that I tried adding the code Marlo posted into (Nice avatar btw Marlo, I love that song, or rather flash loop, haha). Below is an example of what my other sections look like.

Switch $maxmp
        Case $nMsg = $Button1
For $b = 1 To GUICtrlRead($maxmp)
                MouseClickDrag ( "left", 3292, 167, 2910, 164 )
                sleep(1000)
                MouseClickDrag ( "left", 2910, 164, 3292, 167 )
            Next
        Case $GUI_EVENT_CLOSE
            Exit
        EndSwitch

I should say that at the moment, neither of these code snippets generates any results at all :) Any help would be appreciated.

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...