LiveOnTheFly Posted March 29, 2009 Posted March 29, 2009 (edited) This is my first contribution to the autoit forums. It allows you to set the console color of a CUI program like some dos programs do. Example: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Change2CUI=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** $p = PluginOpen("setconsolecolor.dll") $number = InputBox("Number","Number go to: 0-enter here",255) $number = Number($number) for $i = 1 to $number setconsolecolor($i) ConsoleWrite($i & " ") sleep(10) Next MsgBox(0,"","Done!") PluginClose($p) If you put the number above 255 it will just keep repeating the colors DLL is attached in the zipfilesetconsolecolor.zipsource.zip Edited March 29, 2009 by LiveOnTheFly
UEZ Posted March 29, 2009 Posted March 29, 2009 I get an error: >"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /prod /in "C:\Coding\Scripts\AU3\Console\SetConsoleColor\SetConsoleColor.au3" /autoit3dir "C:\Program Files\AutoIt3" +>19:42:51 Starting AutoIt3Wrapper v.2.0.0.0 Environment(Language:0409 Keyboard:00000407 OS:WIN_VISTA/ CPU:X86) >Running AU3Check (1.54.14.0) from:C:\Program Files\AutoIt3 C:\Coding\Scripts\AU3\Console\SetConsoleColor\SetConsoleColor.au3(9,20) : ERROR: setconsolecolor(): undefined function. setconsolecolor($i) ~~~~~~~~~~~~~~~~~~^ C:\Coding\Scripts\AU3\Console\SetConsoleColor\SetConsoleColor.au3 - 1 error(s), 0 warning(s) !>19:42:51 AU3Check ended.rc:2 UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
LiveOnTheFly Posted March 29, 2009 Author Posted March 29, 2009 I get an error: >"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /prod /in "C:\Coding\Scripts\AU3\Console\SetConsoleColor\SetConsoleColor.au3" /autoit3dir "C:\Program Files\AutoIt3"+>19:42:51 Starting AutoIt3Wrapper v.2.0.0.0 Environment(Language:0409 Keyboard:00000407 OS:WIN_VISTA/ CPU:X86)>Running AU3Check (1.54.14.0) from:C:\Program Files\AutoIt3C:\Coding\Scripts\AU3\Console\SetConsoleColor\SetConsoleColor.au3(9,20) : ERROR: setconsolecolor(): undefined function. setconsolecolor($i) ~~~~~~~~~~~~~~~~~~^C:\Coding\Scripts\AU3\Console\SetConsoleColor\SetConsoleColor.au3 - 1 error(s), 0 warning(s)!>19:42:51 AU3Check ended.rc:2UEZDid you have the dll and the script in the same folder?
UEZ Posted March 29, 2009 Posted March 29, 2009 Did you have the dll and the script in the same folder?Yes of course!UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
LiveOnTheFly Posted March 29, 2009 Author Posted March 29, 2009 Yes of course!UEZOh wait I just reread your error. Just click Continue. AutoitWrapper cant detect plugins.
UEZ Posted March 29, 2009 Posted March 29, 2009 This way it is working but how can you save the console state before printing out the characters? Because when the loop is finished the prompt is not the initial prompt (color)? Is there any description of the DLL? UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
LiveOnTheFly Posted March 29, 2009 Author Posted March 29, 2009 (edited) This way it is working but how can you save the console state before printing out the characters? Because when the loop is finished the prompt is not the initial prompt (color)?Is there any description of the DLL?UEZdefault color is 15(white text black background)What do yuo mean by description of the DLL?(oh wait I forgot to post source silly me I'll do that in a sec)Edit: there. Source available from first post Edited March 29, 2009 by LiveOnTheFly
UEZ Posted March 29, 2009 Posted March 29, 2009 default color is 15(white text black background)What do yuo mean by description of the DLL?(oh wait I forgot to post source silly me I'll do that in a sec)Edit: there. Source available from first postI've a different default console UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
LiveOnTheFly Posted March 29, 2009 Author Posted March 29, 2009 (edited) I've a different default console UEZhmm I dont know then.Edit: oh wait. Default color is 8 not 15. 8 is grey text with black bg Edited March 29, 2009 by LiveOnTheFly
Warmonger Posted May 13, 2011 Posted May 13, 2011 (edited) Very nice, exactly what im looking for. Would be nice to see a UDF for this. Edited May 13, 2011 by Warmonger [AutoIt File Patcher]
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