Sign in to follow this  
Followers 0
mattdallama

Newbie needs help with input boxes.

12 posts in this topic

First off, hi.

I've been reading these forums for about a week and me, who knows basically nothing about scripting, have made some autoit scripts to do basic config settings for NIB dells that i have to set for my company... well now for the question.

I'm trying to make two things:

1, a password for prompt when you start the program... i actually have the gui set up and everything but i dont know how to make it check to see if its valid, right now its just an input box that accepts any value... not a specific one that i set.

2, an input box where a user can input a value, and the script will copy it and paste it at a later time.

I have never programed anything before and I do not know what 90% of the remarks that you guys make on these forums that ive been reading up on mean... so when i couldnt really navigate the faq or my searches results, i figured id make a post here.

Any help would be appreciated, and please noob it down for me.

Share this post


Link to post
Share on other sites



Here is a start

$passwd = InputBox("Security Check", "Enter your password.", "", "*")
if $passwd = "password" Then
    MsgBox(0,""," You entered the correct password")
EndIf


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

As for the input box that saves something, that is what I am working on extensively right now, for just about the same reason: to set up the new dell computers that our company is getting.

The way I do it is to tell AutoIt that the input box is a variable. then I tell it to save that variable and put it into a .ini file.

;creating the inpot box for the user.
$savethis = InputBox("Save this text", "Type something here.", "TYPE HERE")
;tells AI to write to OR create a "saves.ini" file in the same directory as the script.
;it saves it under the "saved texxt" section, the key=save1 and the value is what the user inputted.
IniWrite("saves.ini", "saved text", "save 1", $savethis)
;this line reads from the .ini file.
$checking = IniRead("saves.ini", "saved text", "save 1", "error")
;just to make sure it worked, this messagebox will read out what the user has typed.  it is not necissary.
MsgBox(0, "", $checking)

:P


Amp Energy Drink: the official sponsor of me scripting at 2AM.

Share this post


Link to post
Share on other sites

As for the input box that saves something, that is what I am working on extensively right now, for just about the same reason: to set up the new dell computers that our company is getting.

The way I do it is to tell AutoIt that the input box is a variable. then I tell it to save that variable and put it into a .ini file.

;creating the inpot box for the user.
$savethis = InputBox("Save this text", "Type something here.", "TYPE HERE")
;tells AI to write to OR create a "saves.ini" file in the same directory as the script.
;it saves it under the "saved texxt" section, the key=save1 and the value is what the user inputted.
IniWrite("saves.ini", "saved text", "save 1", $savethis)
;this line reads from the .ini file.
$checking = IniRead("saves.ini", "saved text", "save 1", "error")
;just to make sure it worked, this messagebox will read out what the user has typed.  it is not necissary.
MsgBox(0, "", $checking)

:P

Share this post


Link to post
Share on other sites

wow, the way you guys i actually understand it. thank you. know i see how the password code works, and im going to try the ini file but ill use a delete command at the end to get rid of it, because these dells are for my corp. so im not allowed to install any files onto the hd's. i guess i could make the ini save on a floppy or usb drive that i run the scripts from. im going to implement this into my script and turn it into a gui later on... right now this is what i got:

MouseClick ( "left" , 45, 750 , 1 , 1 )

MouseMove (80,680,20)

Sleep ("1000")

MouseMove (200,680)

MouseMove (200,425)

;Hovers and waits for utility in all programs to highlight

Sleep ("1000")

MouseMove (400,425)

MouseClick ("left", 400, 625)

;This code is not working, using noob sleep timer.

;If WinExists("Set Default Regional Locale") Then

;

; Send ("{TAB}")

; Send ("{TAB}")

; Send ("5")

; Send ("5")

; Send ("6")

; Send ("6")

; MouseClick ("left", 320, 590)

;

; EndIf

;noob sleep timer below

Sleep ("8000")

Send ("{TAB}")

Send ("{TAB}")

Send ("5")

Send ("5")

Send ("6")

Send ("6")

MouseClick ("left", 320, 590)

Sleep ("16000")

Send ("{ENTER}")

MouseClick ( "left" , 45, 750 , 1 , 1 )

MouseMove (80,680,20)

Sleep ("1000")

MouseMove (200,680)

MouseMove (200,425)

;Hovers again for start menu

Sleep ("1000")

MouseMove (400,425)

MouseClick ("left", 400, 570)

Sleep ("2000")

Send ("username")

Send ("{TAB}")

Send ("domain")

Send ("{TAB}")

Send ("password")

Send ("{TAB}")

Send ("{ENT}")

Sleep ("2000")

Send ("6")

Send ("{TAB}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

Send ("{Del}")

;then paste the info in the ini file, the delete's are to clear the line first. this sets up the hostname for the machine on the domain.

Share this post


Link to post
Share on other sites

As for the input box that saves something, that is what I am working on extensively right now, for just about the same reason: to set up the new dell computers that our company is getting.

The way I do it is to tell AutoIt that the input box is a variable. then I tell it to save that variable and put it into a .ini file.

;creating the inpot box for the user.
$savethis = InputBox("Save this text", "Type something here.", "TYPE HERE")
;tells AI to write to OR create a "saves.ini" file in the same directory as the script.
;it saves it under the "saved texxt" section, the key=save1 and the value is what the user inputted.
IniWrite("saves.ini", "saved text", "save 1", $savethis)
;this line reads from the .ini file.
$checking = IniRead("saves.ini", "saved text", "save 1", "error")
;just to make sure it worked, this messagebox will read out what the user has typed.  it is not necissary.
MsgBox(0, "", $checking)

:P

If he is storing a password, this is definatly not the way you want to do it. Try taking a look at _StringEncrypt in String.au3.

Share this post


Link to post
Share on other sites

What part of the Dell setup are you trying to automate? Are you using Norton Ghost to completely automate the setup of the entire computer? With Ghost you can rubber stamp machines ad nauseum...

For more help with Dell management, be sure to search this forum for "dell" and "dellrelatedfunctions.au3"


...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

im not ghosting. the dells are preimaged with software that our engineers developed and i need to set the config for certain machines to this building. the mouse moves and mouse clicks simply launch some of the programs that i have to use to configure the dells specific for this building.

Share this post


Link to post
Share on other sites

Instead of using mouse moves and click for launching programs the Run command is a MUCH more reliable way. Search the help file for the Run command if you haven't already.


- Dan [Website]

Share this post


Link to post
Share on other sites

Instead of using mouse moves and click for launching programs the Run command is a MUCH more reliable way. Search the help file for the Run command if you haven't already.

when i try using the run command nothing works. i tried pointing autoit to go to the shortcut in the start menu which shouldnt work anyway, and it didnt. then i told auto it where it is, file name then directory format:
Run ("C:\Documents and Settings\All Users\Start Menu\Programs\xxxx\xxxx.exe")

that did not work.

i also cannot use:

Run ("xxxx.exe", "C:\Documents and Settings\All Users\Start Menu\Programs\xxxx")

and that didnt work either.

a co-worker of mine couldn't get any variations on the run command working either, and i dont know why. this is why im using the mouse click in the first place, they get to the programs with no problem.

one more thing, whenever i use WinWait or WinWaitActive the script just... never pauses it just acts like it skips the line of code WinWait is on and continues.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

when i try using the run command nothing works. i tried pointing autoit to go to the shortcut in the start menu which shouldnt work anyway, and it didnt. then i told auto it where it is, file name then directory format:

Run ("C:\Documents and Settings\All Users\Start Menu\Programs\xxxx\xxxx.exe")

that did not work.

i also cannot use:

Run ("xxxx.exe", "C:\Documents and Settings\All Users\Start Menu\Programs\xxxx")

and that didnt work either.

a co-worker of mine couldn't get any variations on the run command working either, and i dont know why. this is why im using the mouse click in the first place, they get to the programs with no problem.

one more thing, whenever i use WinWait or WinWaitActive the script just... never pauses it just acts like it skips the line of code WinWait is on and continues.

If that's really an .exe file, try:

$ExtDir = "C:\Documents and Settings\All Users\Start Menu\Programs\xxxx"
$ExtCmd = $ExtDir & "\xxxx.exe"
Run($ExtCmd, $ExtDir, @SW_Minimize)oÝ÷ Ù*&z趦±ªÞ­æ¥¦'$ɦèºØZ½è§Ø^µé©v*ì¥ç"~'ëmêÞßÛr§qè­ßÛrÛy,írëey-¢Ø^{W±ëay$ÀE7(f§vÚ$É(}ö¬írëeF®¶­sbb33c´WD6ÖBÒgV÷C´3¢b3#´Fö7VÖVçG2æB6WGFæw2b3#´ÆÂW6W'2b3#µ7F'BÖVçRb3#µ&öw&×2b3#·b3#·æWRæÆæ²gV÷C°¥'Vâ6öÕ7V2fײgV÷C²ö25D%BgV÷C²fײb33c´WD6ÖBÂFV×F"Â5uôÖæÖ¦RoÝ÷ Øw«{ljz-êïz»"¢xÙÞyÛ*º^±ªèºwb´hm­çXÝý²wzÆ«É«­¢+ØÀÌØíáÑ
µôÅÕ½ÐíèÀäÈí½Õµ¹Ñ̹MÑÑ¥¹ÌÀäÈí±°UÍÉÌÀäÈíMÑÉÐ5¹ÔÀäÈíAɽɵÌÀäÈíáááàÀäÈíáááà¹á¹±¹¬ÅÕ½Ðì)IÕ¸¡
½µMÁµÀìÌäì½MQIPÅÕ½ÐìÌäìµÀìÀÌØíáÑ
µµÀìÌäìÅÕ½ÐìÌäì°QµÁ¥È°M]}5¥¹¥µ¥é

:P

Edited by PsaltyDS

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

Well anytime I've ever used the run command, I didn't even need to type out the entire address. I usually leave it as:

Run ("Name.exe")

This has always worked fine for me, but I'm not real experienced with this stuff so sorry if this doesn't always work.


- Dan [Website]

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