Jump to content
Sign in to follow this  
ctwolf

Help The Newbie

Recommended Posts

ctwolf

Hey,

im trying to get a script to run on a single window such as Mozilla Fire Fox and not interfere with other programs or what im doing, so that it can just run in the back ground.

i know this is possible cause i found some one else's script that works in a similiar manner for a game, if some one could explain it to me i would be very grateful, im trying to learn.

here is the script that runs in a specified window but i dont know how it works or how to change it or any of the details....

WinActivate("Tales of Pirates - P")

While 1 
 ControlSend("Tales of Pirates - P", "", "", "{2}") 
 Sleep(15000) 
 ControlSend("Tales of Pirates - P", "", "", "{k}") 
 Sleep(15100) 
Wend

i can understand all the other functions from reading tutorials and such but the "WinActivate" and then the specification of the same window in the "ControlSend" function have me confused.

Share this post


Link to post
Share on other sites
ctwolf

The WinActivate brings the focus of the monitor to the window. The ControlSend function sends a string of characters to a certain control. From your example, that is the best I can give you.

i can understand that much however i dont know how to change the focus and the script runs on the program happily in the background while not interfering with anything else id like to mimic this affect if possible.

Share this post


Link to post
Share on other sites
ctwolf

~Bump, please help

Share this post


Link to post
Share on other sites
Richard Robertson

This is the wrong forum.

ControlSend sends a message to the window you select. In this case it is sending to some pirate game. What is it exactly that you don't understand?

Share this post


Link to post
Share on other sites
ctwolf

This is the wrong forum.

ControlSend sends a message to the window you select. In this case it is sending to some pirate game. What is it exactly that you don't understand?

ah, wrong forum... that might be why... just maybe haha, i don't understand how to target a certain process because i've tried naming the window and the process, and it doesn't work, i tried to see if it was just the program i was trying that didn't work, so i tried it on Mozilla fire fox, however to no avail... it still wont target Mozilla.

ill delete this thread, if i am capable of such, and move to the correct location, thank you.

Share this post


Link to post
Share on other sites
oMBRa

try this

WinActivate("Tales of Pirates - P")

While 1
    $a = ControlSend("Tales of Pirates - P", "", "", "{2}")
    If $a = 0 Then
        MsgBox(0, '', 'window/control not found')
    EndIf
    Sleep(15000)
    ControlSend("Tales of Pirates - P", "", "", "{k}")
    Sleep(15100)
WEnd
Edited by oMBra

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  

×