Jump to content
Sign in to follow this  
Net

AutoIt Send

Recommended Posts

Net

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

Share this post


Link to post
Share on other sites
AlmarM

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.

Share this post


Link to post
Share on other sites
Net

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

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
Net

It's supposed to press a hot key in the game but it doesn't so it just idles.

(I want to thank you a lot in advance for at least taking the time to reply :P)

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  

×