Sign in to follow this  
Followers 0
hans_schwaebli

Background automation possible?

9 posts in this topic

It is a little bit hard to describe my question, although it must be the most common one.

I don't like that I cannot use any other application while an Auto-It script is running. It is because if I do, the keyboard commands are written into another application (the one which is in the foreground and has focus) and not into the one they are inteded for!

Lets assume I want to automate mIRC (no flooding). This should be automated: joining channels, writing some commands, change to another channel and so on. While it does this, I want to use another programs on the same computer without disturbing the Auto-It script.

I've seen no solution for this in the Auto-It tutorials. This is where I would expect such a documentation in the first place. The automation needs to be independend of which application is in foreground, so that I, as the user, can use any application while the script is running.

I hope you understood the problem I tried to describe and the solution I am searching for and most of all that there is a solution for this.

Share this post


Link to post
Share on other sites



It is a little bit hard to describe my question, although it must be the most common one.

I don't like that I cannot use any other application while an Auto-It script is running. It is because if I do, the keyboard commands are written into another application (the one which is in the foreground and has focus) and not into the one they are inteded for!

Lets assume I want to automate mIRC (no flooding). This should be automated: joining channels, writing some commands, change to another channel and so on. While it does this, I want to use another programs on the same computer without disturbing the Auto-It script.

I've seen no solution for this in the Auto-It tutorials. This is where I would expect such a documentation in the first place. The automation needs to be independend of which application is in foreground, so that I, as the user, can use any application while the script is running.

I hope you understood the problem I tried to describe and the solution I am searching for and most of all that there is a solution for this.

check out ControlSend() and Mirc has it's own scripting that is pretty versatile too.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Well, it's documented in the helpfile, it's just a matter of finding it. Not too hard though :

AutoIt -> Function Reference -> Window Management -> Controls -> ...

There you got ControlClick, ControlSend, ControlSetText etc etc...

Share this post


Link to post
Share on other sites

Thank you. Great that this works.

Share this post


Link to post
Share on other sites

I was happy too early.

Basically it works. But it still requires me to have that application in front. If it is in background, the ControlSend commands go into nirvana. Why?

I already tried:

Opt("SendKeyDelay", 0)

Opt("SendKeyDownDelay", 0)

And with different values. But same effect.

"ControlFocus" didn't work too for my purpose.

Any ideas?

Share this post


Link to post
Share on other sites

Show the code you used as well as the information about the window you're working with, by using "AutoIt Window Info".

Also, explain what unwanted actions which occur.... What kind application is this ? We need information to be able to help

you, and telling us that it just didn't work isn't too informing.

Share this post


Link to post
Share on other sites

; You need to start mIRC and connect it to a server first.
; Then minimize mIRC and run this script.
; Or maximize mIRC, run the script and then switch to another program while script is running.
; The script only works if mIRC is maximized and user doesn't switch program.
; Solution?

Opt("SendKeyDelay", 1)

Dim $controlID = 32921

Sleep(5000)
sendMessages()

Func sendMessages()
  sendMessageToChannels("0")
  sendMessageToChannels("1")
  sendMessageToChannels("2")
  sendMessageToChannels("3")
  sendMessageToChannels("4")
  sendMessageToChannels("5")
  sendMessageToChannels("6")
  sendMessageToChannels("7")
  sendMessageToChannels("8")
  sendMessageToChannels("9")
EndFunc

Func sendMessageToChannels($message)
  ControlFocus("", "", $controlID)
  ControlSend("", "", $controlID, "/join -x {#}alpha11{ENTER}")
  sendMessage($message)
  
  ControlFocus("", "", $controlID)
  ControlSend("", "", $controlID, "/join -x {#}beta22{ENTER}")
  sendMessage($message)
EndFunc

Func sendMessage($message)
  Sleep(100)
  ControlFocus("", "", $controlID)
  ControlSend("", "", $controlID, $message & "{ENTER}")
EndFunc

Share this post


Link to post
Share on other sites

Lets assume I want to automate mIRC (no flooding). This should be automated: joining channels, writing some commands, change to another channel and so on. While it does this, I want to use another programs on the same computer without disturbing the Auto-It script.

Out of curiosity could you explain why this is a good thing? I mean, how will other participants in the canal benefit from a bot like this?

Share this post


Link to post
Share on other sites

Out of curiosity could you explain why this is a good thing? I mean, how will other participants in the canal benefit from a bot like this?

As I said, it is for no bad things.

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