Jump to content

Script wont run properly once the second loop starts


Anon
 Share

Recommended Posts

First of all, i have no experience what so ever with this program, but i do have some experience in programming, so i kinda know what i am doing. This script is for a game called Darkfall. What i do with this script is select the windows i want to execute it in, press the button "down" so it looks down, and execute what ever i want it to do. So after that is done, and the loop starts again, for some reason, it wont look down again. It just executes what is after i press "down". Can anyone help me understand and fix the problem with it not pressing down the second time it runs again.

WinActivate ("Darkfall Online")
Sleep (2000)
$i = 0
While $i <= 25
    Sleep (3000)
    Send ("{DOWN down}")
   Harvest()
   Sleep (1000)
   Rest()
   Sleep (1000)
   $i = $i + 1
Wend

Func Harvest()
    $m = 0
    Sleep (5000)
    Send ("4")
    Sleep (1000)
    Send ("R")
    Sleep (1000)
    Send ("2")
    Sleep (1000)
    While $m <= 20
        MouseClick ("Left")
        Sleep (3000)
        $m = $m + 1 
    WEnd
    Send ("R")
    Sleep (1000)
    Send ("4")
    Sleep (1000)
EndFunc

Func Rest()
    Send ("3")
    Sleep (1000)
    MouseClick ("left")
    Sleep (150000)
    Send ("w")
EndFunc
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...