Alexcont Posted January 22, 2016 Share Posted January 22, 2016 Hi Everybody, and thanks in advance for any help ... but most of all for being patient with a total newbie (i'm a doctor... this is TOTALLY not my field) I tried to find the answer in old posts ... so i beg my pardon if this is an already solved problem! I realized this script (it's a part of it): MouseClick("left", 419, 809, 1, 25) MouseClick("left", 230, 720, 1, 30) MouseClick("left", 566, 536, 2, 30) Send("{NUMPAD1}") Send("{NUMPAD0}") Send("{NUMPAD0}") Send("{NUMPAD0}") MouseClick("left", 806, 534, 1, 25) MouseClick("left", 673, 641, 1, 8) It actually click on some buttons, double clicks on a field and insert four digits. Pressing enter afterwards. Is there any chance to ask the user when starting up the EXE what digits to insert, and change automatically the script according to user'selection? THANK YOU!!!! Alessandro DEFINITIVO.au3 Link to comment Share on other sites More sharing options...
Danyfirex Posted January 22, 2016 Share Posted January 22, 2016 Hi. use an inputbox Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Skysnake Posted January 26, 2016 Share Posted January 26, 2016 Try this? It could probably be a lot simpler, but it works. expandcollapse popup#include <Array.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> Global $sTyped='' GetInput() Func GetInput() GUICreate(" Get user input ", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1, $WS_EX_ACCEPTFILES) $sTyped = GUICtrlCreateInput("1,2,3,4", 10, 5, 300, 20) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Local $idBtn = GUICtrlCreateButton("Okay", 40, 75, 60, 20) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idBtn ExitLoop EndSwitch WEnd MsgBox($MB_SYSTEMMODAL, "drag drop file", GUICtrlRead($sTyped)) ; just shows whats in the input EndFunc ;==>Example Local $nUsrNums = GUICtrlRead($sTyped) ; put input into a variable Local $aNumbers = StringSplit($nUsrNums,",",2) ; split text in variable into array _ArrayDisplay($aNumbers) Local $i = UBound($aNumbers) ConsoleWrite("$i " & $i & @CRLF) For $j = 0 to $i -1 ConsoleWrite("$j " & $j & @CRLF) Local $ToSend = '"{NUMPAD' & $aNumbers[$j]&'}"' Send($ToSend) ;-- was: Send("{NUMPAD1}") ConsoleWrite("Sent! " & $ToSend & @CRLF) Next Skysnake Why is the snake in the sky? Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted January 26, 2016 Share Posted January 26, 2016 $sInput = InputBox("Startup Script", "Enter your numaric code") MouseClick("left", 419, 809, 1, 25) MouseClick("left", 230, 720, 1, 30) MouseClick("left", 566, 536, 2, 30) Send($sInput) MouseClick("left", 806, 534, 1, 25) MouseClick("left", 673, 641, 1, 8) You can send your numbers in a single send, no need to break them apart. This is the most simple way I can think to take what you have and prep it for user input. A GUI would definitely be the "more professional" way IMO but before I would bother going that road I would probably get rid of all the MouseClicks() as well because that would be your first point of failure (changing resolution, position, etc) Skysnake 1 Link to comment Share on other sites More sharing options...
Skysnake Posted January 28, 2016 Share Posted January 28, 2016 (edited) @ViciousXUSMC - thanks for the tip, I was not aware that one could send multiple keys in a single Send(). Edited January 28, 2016 by Skysnake Skysnake Why is the snake in the sky? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now