Sign in to follow this  
Followers 0
oJohn

Input command help

2 posts in this topic

#include <GUIConstantsEx.au3>
$Form1 = GUICreate("Hello", 300, 30)
$input1 = GUICtrlCreateInput("", 0, 0, 300, 30)
$Waka = GUICtrlRead($Input1)

While 1
WEnd

If Stringinstr($waka, "message Hello", 2) and _Ispressed("0D") then
Hello()
Endif
If StringinStr($waka, "message Howdy", 2) and _Ispressed("0D") then
Howdy()
Endif
If StringinStr($waka, "Open Form1, 2) and _Ispressed("0D") then
GUI()
Endif

Func Hello()
Msgbox(0, "Hey", "Hello)
Endfunc

Func Howdy()
Msgbox(0, "Hey", "Howdy")
Endfunc

Func GUI()
GUICreate("GUI", 300, 300)
Endfunc
I was wondering about any other methods of doing this, rather than making an If statement for every single message command.

Im going for something command-line-ish.

Share this post


Link to post
Share on other sites



Start by testing the _IsPressed(), then you don't have to bother with the other compares until that is true.

The rest will depend on the particulars. Does $waka contain multiple matching messages? Is there a standard format for it? Are you parsing something like command line arguments?

;)


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

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