Sign in to follow this  
Followers 0
Koil

Why does this error?

8 posts in this topic

I want to send SPACE bar to my diablo window every 1.2 seconds but it errors!

AutoItSetOption("WinTitleMatchMode", 4)
$handle = WinGetHandle("Classname=DIAWIN", "Diablo II")

While 1

If @error Then
    MsgBox(4096, "Error", "Could not find the correct window")
Else
   ; Send some text directly to this window's edit control
    ControlSend("$Handle", "", "", "{Space}" )
    Sleep(1200)
EndIf

Wend

Fix it for a cookie..

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Whats the exact ERROR?

AlmarM

EDIT:

ControlSend("$Handle", "", "", "{Space}" )

ControlSend($Handle, "", "", "{SPACE}")

Does this help?

Edited by AlmarM

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

MsgBox(4096, "Error", "Could not find the correct window")

that error, not finding the right window..

Share this post


Link to post
Share on other sites

Well, you've got a couple of problems.

First, you aren't closing the program if you get an error.

Second, you put $handle in quotes, which is wrong.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

try : WinActive($Handle,"")

:)

Edited by Gee

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

the window needs to be active for it to go thru or something?.. i want this to send to a window in the background while im surfing the net or something, possible?

Edited by Koil

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