Sign in to follow this  
Followers 0
Yata

AutoIt and the command prompt usability?

9 posts in this topic

I've been wanting to make a text-based rpg like game from the command prompt, but have failed at finding a language I'm fairly familiar with to do so. Is it at all possible to use AutoIt for such a thing? Meaning having the command prompt as the GUI and still be able to have all of the programming accessories available (Variables, functions, la-de-da). If so, how do I approach this so the script is connected to a command prompt and when opened opens the said prompt?

Thank you.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Yes this is possible.

You can use ConsoleRead() and ConsoleWrite()

in conjuction with new compile option for make console output application instead of GUI one.

I don't remember exact name of this option so look into documentation of latest Scite4AutoIt3.

EDIT: It's

#AutoIt3Wrapper_Change2CUI=y

(Y/N) Change output program to CUI in stead of GUI. Default=N

Edited by Zedna

Share this post


Link to post
Share on other sites

Whilst looking in the help file at ConsoleWrite, it says the following:

The purpose for this function is to write to a console which many popular text editors can read.

This does not write to a DOS console.

I'm not quite sure I understand now. How do I send information to the console if "the console" isn't the DOS console. I'm a bit lost.

Also, do I simply include the #Wrapper statement at the beginning of my script? I've never used them before.

Share this post


Link to post
Share on other sites

Try this (compile this script by F7 from Scite4AutoIt3 and run compiled EXE from DOS box command prompt):

#AutoIt3Wrapper_Change2CUI=y

#include <string.au3>

For $i = 1 to 79
    $part1 = _StringRepeat(Chr(219), $i)
    $part2 = _StringRepeat(Chr(177), 79 - $i)
    ConsoleWrite(@CR & $part1 & $part2)
    Sleep(50)
Next

; uncomment this if you want to preserve finished progressbar
;~ ConsoleWrite(@CRLF & "DONE!")

; comment this if you want to preserve finished progressbar
ConsoleWrite(@CR & _StringRepeat(' ', 79))
ConsoleWrite(@CR & "DONE!")

Share this post


Link to post
Share on other sites

I did as you said but it does nothing. I tried running it in the command prompt and just normally executing it, but nothing.

Share this post


Link to post
Share on other sites

I did as you said but it does nothing. I tried running it in the command prompt and just normally executing it, but nothing.

- for me it's working fine.

- you must use at least AutoIt 3.2.10 version

- you must use latest Scite4Autoit3 version

- you must run COMPILED EXE (not directly from Scite)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I'm running AutoIt version 3.2.12.0 and Scite4AutoIt version 1.76.

How do you want me to run it from the command prompt? I've been dragging and dropping the file on it and pressing enter, but that dosen't do the trick..

Edit

I downloaded the full editor and it works now. I presume the problem was caused by using the lite version that comes with AutoIt.

One question: How do I ensure the command prompt dosen't close at the end? Use a loop?

Edited by Yata

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

copy full path to EXE into clipboard and inside command box pres Ctrl+V and Enter.

EDIT: instead of Ctrl+V press Paste button.

Edited by Zedna

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