Luigi Posted June 2, 2019 Share Posted June 2, 2019 (edited) Greetings, How build a script interactive by command line... In prompt MS-DOS, you type: host.exe (this is a AutoIt script compiled), and they show: Something like this... C:\host.exe<ENTER> host> Greeting, what is your name? host< Luigi<ENTER> host> Hi "Luigi" host< exit<ENTER> host> bye C:\ Best regards. Edited June 2, 2019 by Luigi Visit my repository Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted June 2, 2019 Share Posted June 2, 2019 @Luigi Compile your script as CUI and use Console* functions to interact with the user Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Luigi Posted June 2, 2019 Author Share Posted June 2, 2019 (edited) @FrancescoDiMuro Thank you! expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_UseUpx=y #AutoIt3Wrapper_Change2CUI=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include-once #include <Array.au3> Global $self = "Jarvis" Global $read Global $name = 0 Say($self, "Greetings!") Say($self, "Whats your name?") While Sleep(10) $read = ConsoleRead() If @extended Then $read = StringRegExpReplace($read, "[\r\n]", "") If $name Then Say("You", $read) Else $name = $read Say($self, "Hello " & $name & "!") EndIf If StringInStr($read, "exit") Then Say($self, "bye bye") Exit EndIf $read = "" EndIf WEnd Func Say($who, $var) ConsoleWrite($who & " say: " & $var & @CRLF) EndFunc Edited June 2, 2019 by Luigi Visit my repository Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted June 2, 2019 Share Posted June 2, 2019 @Luigi Happy to have helped :) Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette 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