Yata Posted June 8, 2008 Share Posted June 8, 2008 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. Link to comment Share on other sites More sharing options...
Zedna Posted June 8, 2008 Share Posted June 8, 2008 (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 June 8, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Yata Posted June 8, 2008 Author Share Posted June 8, 2008 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. Link to comment Share on other sites More sharing options...
Zedna Posted June 8, 2008 Share Posted June 8, 2008 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!") Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Yata Posted June 8, 2008 Author Share Posted June 8, 2008 I did as you said but it does nothing. I tried running it in the command prompt and just normally executing it, but nothing. Link to comment Share on other sites More sharing options...
Zedna Posted June 8, 2008 Share Posted June 8, 2008 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) Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Yata Posted June 8, 2008 Author Share Posted June 8, 2008 (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..EditI 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 June 8, 2008 by Yata Link to comment Share on other sites More sharing options...
Zedna Posted June 8, 2008 Share Posted June 8, 2008 (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 June 8, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
TurionAltec Posted June 11, 2008 Share Posted June 11, 2008 Just an FYII haven't been able to get Consoleread() to be able to read any input in the console window. Only data that was "piped" in:http://www.autoitscript.com/forum/index.php?showtopic=72563Kind of limits using the console window as a means of input. 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