Jump to content

AutoIt Send


Net
 Share

Recommended Posts

I'm very new to coding in general and was wondering if anyone could help me. I have written this (don't laugh) to help me with a project, which it currently does fine. Anyways, I need help understanding how to send a command to an alt-tabbed or hidden window. From the little I understand I would use a ControlSend command?

CODE
#NoTrayIcon

AutoItWinSetTitle ("Firefox")

HotKeySet("{ESC}", "esc")

HotKeySet("{F4}", "mfe")

While 1

Sleep ("500")

WEnd

Func mfe()

$o = 1

Do

$sec = Random ("7000", "10000", "1")

Sleep ($sec)

Send ("5")

$o = $o + 1

Until $o = 100

EndFunc

Func esc()

WinKill ("Firefox")

EndFunc

Link to comment
Share on other sites

1st of all.

Does the script reads:

$sec = Random ("7000", "10000", "1")oÝ÷ Øhºméz»Ùíçj«¨µ*ºÚ"µÍÌÍÜÙXÈH[ÛJ
ÌLL

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

ControlSend ("omgsekretzlawl", "", "", "5")

Is what I was using to replace Send(). I used "AutoIt Window Info" to figure out the rest of the code for ControlSend() but it only has a title.

Does removing the quotations do anything such as minimally optimize the code or something?

Edited by Net
Link to comment
Share on other sites

Where required the the built-in AutoIt functions do a Number() or String() conversion to match variable types on parameters.

$sec = Random("7000", "10000", "1")
ConsoleWrite("Debug: $sec = " & $sec & @LF)

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

ControlSend ("omgsekretzlawl", "", "", "5")

Is what I was using to replace Send(). I used "AutoIt Window Info" to figure out the rest of the code for ControlSend() but it only has a title.

Does removing the quotations do anything such as minimally optimize the code or something?

That should work fine. What happens when you try it?

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...