Sign in to follow this  
Followers 0
Enno

Help with Input & Read function

7 posts in this topic

Hello all,

I am trying to make a script that sends the inputbox (the word/'s that are in the inputbox).

I have this:

#include <GUIConstantsEx.au3>

$mainwindow = GUICreate ("Ennø's Tracker",200,190)
GUISetBkColor (0x0077FF)
GUICtrlCreateLabel ("Ennø's Tracker",65,160)
GUICtrlCreateLabel ("v.01",90,175)
GUICtrlSetColor (-1, 0x000000)
$TrackButton = GUICtrlCreateButton ("Track",5,5,50)
$TrackName0 = GUICtrlCreateInput ("Track Name:",5,35,150)
$TrackName1 = GUICtrlCreateInput ("Track Name:",5,65,150)
$TrackName2 = GUICtrlCreateInput ("Track Name:",5,95,150)
$CloseButton = GUICtrlCreateButton ("Close",5,160,50)
$CreditsButton = GUICtrlCreateButton ("Credits",145,160,50)
$DaFoButton = GUICtrlCreateButton ("DaFo",80,125)
GUISetState (@SW_SHOW)

While 1
    $msg = GUIGetMsg (1)
    
Select
Case $msg = $TrackButton    
    SLeep (2000)
    GUICtrlRead ($TrackName0)
    Sleep (150)
    Send ("{ENTER}")
    Send ("/find $TrackName0")
    GuiCtrlRead ($TrackName1)
    Sleep (150)
    GUICtrlRead ($TrackName2)
    Sleep (150)
EndSelect
WEnd

Can anyone help me with this?

Share this post


Link to post
Share on other sites



I'm not sure what you are trying to do. I assume the SEND commands are going to a different application (Musick player)?

It would be best to "connect" to this application and send the data directly to the controls.

Could you please send more information about what you are trying to do and what problems you face?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I'm not sure what you are trying to do. I assume the SEND commands are going to a different application (Musick player)?

It would be best to "connect" to this application and send the data directly to the controls.

Could you please send more information about what you are trying to do and what problems you face?

Well, I am trying to make a person tracker for a game (it shows where the persons are, it is nice to have)

I want to send /zoek (which is the command for finding a person) and the name in the box (or should I just add /zoek in the box and then the name?)

Share this post


Link to post
Share on other sites

The problem with your current script is that it sends the information to the active window - which is the GUI of your script.

But you want to send the input of your GUI to another program (= your game).

So you need to get the window info and control info of the game where you want to send the info to. Please try the WindowInfo tool of AutoIt to search for the required information.

If you have any problems a screenshot of your game and the AutoIt WindowInfo tool could help.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

The problem with your current script is that it sends the information to the active window - which is the GUI of your script.

But you want to send the input of your GUI to another program (= your game).

So you need to get the window info and control info of the game where you want to send the info to. Please try the WindowInfo tool of AutoIt to search for the required information.

If you have any problems a screenshot of your game and the AutoIt WindowInfo tool could help.

I have a delay of 2000miliseconds in it, so I have enough time to change to my game window, since it has no title according to the autoit window info.

I just want to know if I can send the text that is in the input window.

like:

Send ("$inputbox") or anything?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Yes you can. Please try this:

Select
Case $msg = $TrackButton 
 SLeep (2000)
 $Track0 = GUICtrlRead ($TrackName0)
 Sleep (150)
 Send ("{ENTER}")
 Send ("/find " & $Track0)
 $Track1 = GuiCtrlRead ($TrackName1)
 Sleep (150)
 $Track2 = GUICtrlRead ($TrackName2)
 Sleep (150)
EndSelect
WEnd
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Yes you can. Please try this:

Select
Case $msg = $TrackButton 
 SLeep (2000)
 $Track0 = GUICtrlRead ($TrackName0)
 Sleep (150)
 Send ("{ENTER}")
 Send ("/find " & $Track0)
 $Track1 = GuiCtrlRead ($TrackName1)
 Sleep (150)
 $Track2 = GUICtrlRead ($TrackName2)
 Sleep (150)
EndSelect
WEnd

Tyvm :) Ill try it out in a minute.

Edit: It doesn't work ;), I also tried this:

Case $msg = $TrackButton 
 SLeep (2000)
 $Track0 = GUICtrlRead ($TrackName0)
 Sleep (150)
 Send ("{ENTER}")
 Send ("/find " & $Track0);changing this to: Send ($Track0)

hmm, I wonder why it doesnt work B)

Edited by Enno

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