Sign in to follow this  
Followers 0
Anon

Script wont run properly once the second loop starts

3 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I think you have to release the key:

Send ("{DOWN up}")
Edited by foster74

Share this post


Link to post
Share on other sites

I think you have to release the key:

Send ("{DOWN up}")
I love you man, Thanks.

Problem Fixed

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