[Class] Console - Standardized Console GUI with Methods

Post your working scripts, libraries and tools
ahk7
Posts: 291
Joined: 06 Nov 2013, 16:35

Re: [Class] Console - Standardized Console GUI with Methods

07 Mar 2014, 15:02

So you like color as well :-)
If I .prepend or .log an array nothing happens (with .log it prints the date line).
Is it done on purpose these can't display arrays?
User avatar
AfterLemon
Posts: 83
Joined: 30 Sep 2013, 14:27
Location: Arizona, USA

Re: [Class] Console - Standardized Console GUI with Methods

07 Mar 2014, 15:44

Actually it should be printing the array. I will look at it as soon as possible. Will update this post when I know more.

This works for me:

Code: Select all

a:=Class_Console("a",100,100,800,500)
array:=[1,2,3,4,5,[1,2,3,4,5],7,8,[1,[1,2],2],10]
a.append(array)
array:={"a":1,"b":2,"c":3,"d":4,"e":5,"f":{"fa":1,"fb":2,"fc":3,"fd":4,"fe":5},"g":7,"h":8,"i":{"ia":1,"ib":{"iba":1,"ibb":2},"ic":3},"j":10}
a.append(array)
a.show()
return
Can you give me an example of an array that does NOT work for you?
Last edited by AfterLemon on 07 Mar 2014, 17:31, edited 2 times in total.
HOME: Windows 7 x64 SP1 Ultimate | AMD FX 8350 8-Core @ 4.00GHZ | 16GB Ram
WORK: Windows 7 x64 SP1 Home Premium | AMD Athlon II X4 640 @ 3.00GHz | 8GB Ram
MOBILE: Samsung Galaxy Note 3 | 2012 Asus Nexus 7 | Zune 80Gb
ahk7
Posts: 291
Joined: 06 Nov 2013, 16:35

Re: [Class] Console - Standardized Console GUI with Methods

07 Mar 2014, 16:14

if I have this

Code: Select all

a:=new console("a",100,100,800,400)
a.append("text")
a.show()
return
typing help shows the help but if I have this

Code: Select all

a:=new console("ab",100,100,800,400)
a.append("text")
a.show()
return
typing help shows nothing.
Is the Name parameter of the new console limited to 1 character?
User avatar
AfterLemon
Posts: 83
Joined: 30 Sep 2013, 14:27
Location: Arizona, USA

Re: [Class] Console - Standardized Console GUI with Methods

07 Mar 2014, 17:33

The name parameter (for the purpose of the GUI Command Bar) must match the name of the object in which it resides.
See here:

Code: Select all

ab:=new console("ab",100,100,800,400)
ab.append("text")
ab.show()
return
This is detailed in the newest documentation, but I am looking in to how to relieve this strange behavior.
This behavior is caused by the "this" reference to be referring to the object named in ab:=, while the handling of the Gui input is using %Gui%. %Gui% contains the name that is supplied as the first parameter. Thus our "this" and our "Gui" technically have different names. The "name" parameter is essentially a literal 'pointer' to the name of the object as it is now. We've been working towards getting a GetObjHost() function or something of the sort.

We'll see if, once again, we can make history with the abuse this thing is doling out to AHK and tidbit and I.
Last edited by AfterLemon on 07 Mar 2014, 17:39, edited 1 time in total.
HOME: Windows 7 x64 SP1 Ultimate | AMD FX 8350 8-Core @ 4.00GHZ | 16GB Ram
WORK: Windows 7 x64 SP1 Home Premium | AMD Athlon II X4 640 @ 3.00GHz | 8GB Ram
MOBILE: Samsung Galaxy Note 3 | 2012 Asus Nexus 7 | Zune 80Gb
ahk7
Posts: 291
Joined: 06 Nov 2013, 16:35

Re: [Class] Console - Standardized Console GUI with Methods

07 Mar 2014, 17:38

.append works but .log and .prepend don't see

Code: Select all

array:={a:"b",c: {d:"e",f:"g"},h:"i"}

a:=new console("a",100,100,800,400)
a.show()
a.append("appending some text") ; works
a.log("logging some text") ; works
a.append(array) ; works
sleep 500
a.append("appending some text") ; works
a.log(array) ; doesn't work
sleep 500
a.prepend("prepending some text") ; works
sleep 500
a.prepend(array) ; doesn't work
return
Esc::
    critical
    exitapp
return
User avatar
joedf
Posts: 7694
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: [Class] Console - Standardized Console GUI with Methods

07 Mar 2014, 18:35

AfterLemon is right...
how i see it :
-> [Class] Console is a simple practical way used for debugging scripts.
-> LibCon Is actually a "wrapper" / support for an actual console, like autoIt has, but that autohotkey lacks. it was not made with debugging in mind.
it fails to start due to VarSetCapacity not implemented
where is the bug? i ll fix it... because it seems to work fine... :P thx
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x8GB G.Skill RipJaws V - DDR4 3280 MHz | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
User avatar
AfterLemon
Posts: 83
Joined: 30 Sep 2013, 14:27
Location: Arizona, USA

Re: [Class] Console - Standardized Console GUI with Methods

11 Mar 2014, 17:16

New Update! V1.8 Available

Features:
[Class] Console can now be used as an #Include or as a Lib. (using Class_Console())

Methods/Commands:
No new methods/commands.

Fixes:
.pull() is working correctly
Specifying the object name as "Name" parameter allows CommandBar to function correctly.
Documentation is fixed/updated for Help, Desc, Methods, About

Current Status:
All known bugs are squashed
HOME: Windows 7 x64 SP1 Ultimate | AMD FX 8350 8-Core @ 4.00GHZ | 16GB Ram
WORK: Windows 7 x64 SP1 Home Premium | AMD Athlon II X4 640 @ 3.00GHz | 8GB Ram
MOBILE: Samsung Galaxy Note 3 | 2012 Asus Nexus 7 | Zune 80Gb
ahk7
Posts: 291
Joined: 06 Nov 2013, 16:35

Re: [Class] Console - Standardized Console GUI with Methods

12 Mar 2014, 14:56

Have you tested the demo scripts? None of them work for me with after the new update, my old test scripts no longer work either. The consoles are never visible. 64bit, v1.1.14.03.

Edit: yes of course I did #include :-) In demo2 I get an error "illegal char in variable list" as well... very odd.
Last edited by ahk7 on 12 Mar 2014, 15:14, edited 2 times in total.
User avatar
joedf
Posts: 7694
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: [Class] Console - Standardized Console GUI with Methods

12 Mar 2014, 14:59

Oh yeah for me too... Just a #include in the files... It will work then.
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x8GB G.Skill RipJaws V - DDR4 3280 MHz | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
User avatar
AfterLemon
Posts: 83
Joined: 30 Sep 2013, 14:27
Location: Arizona, USA

Re: [Class] Console - Standardized Console GUI with Methods

12 Mar 2014, 16:32

Sorry, I hadn't updated the demo scripts since there is one included in the file, but I'll check them and modify them as well.

GitHub was being rude yesterday and not really letting me edit anything until 10 minutes before I had to go.

Updated Demos
They're fixed!
Last edited by AfterLemon on 12 Mar 2014, 16:40, edited 1 time in total.
HOME: Windows 7 x64 SP1 Ultimate | AMD FX 8350 8-Core @ 4.00GHZ | 16GB Ram
WORK: Windows 7 x64 SP1 Home Premium | AMD Athlon II X4 640 @ 3.00GHz | 8GB Ram
MOBILE: Samsung Galaxy Note 3 | 2012 Asus Nexus 7 | Zune 80Gb
User avatar
joedf
Posts: 7694
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: [Class] Console - Standardized Console GUI with Methods

12 Mar 2014, 16:33

wow... :O
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x8GB G.Skill RipJaws V - DDR4 3280 MHz | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
User avatar
AfterLemon
Posts: 83
Joined: 30 Sep 2013, 14:27
Location: Arizona, USA

Re: [Class] Console - Standardized Console GUI with Methods

12 Mar 2014, 16:41

Demos are updated and working. We hadn't used them, instead including the demo in the file.

Run the file standalone for a few examples and a testbed.

Also work as an #Include and Lib still. Sorry for the problem!

When defining a new console, do not use Var:=new console(name) unless calling it from an #Include or specifically included.
The "Name" parameter is the internal name for the Gui/Object, assigning it returns 1 on completion. Var:=Class_Console(Name,x,y,w,h) returns Var=1
The "Name" parameter creates a global object to be used to call the methods. Name.Show(), while parameter 6, GuiTitle, specifies the name of the Gui ("Console %GuiTitle%" essentially).

These changes are documented in the Class_Console Documentation file on GitHub.
Last edited by AfterLemon on 12 Mar 2014, 16:46, edited 1 time in total.
HOME: Windows 7 x64 SP1 Ultimate | AMD FX 8350 8-Core @ 4.00GHZ | 16GB Ram
WORK: Windows 7 x64 SP1 Home Premium | AMD Athlon II X4 640 @ 3.00GHz | 8GB Ram
MOBILE: Samsung Galaxy Note 3 | 2012 Asus Nexus 7 | Zune 80Gb
ahk7
Posts: 291
Joined: 06 Nov 2013, 16:35

Re: [Class] Console - Standardized Console GUI with Methods

12 Mar 2014, 16:46

Works now, looks good.
User avatar
AfterLemon
Posts: 83
Joined: 30 Sep 2013, 14:27
Location: Arizona, USA

Re: [Class] Console - Standardized Console GUI with Methods

12 Mar 2014, 16:50

Useful CommandBar commands to check the script functionality are Help, About, Desc, Methods.

They all use color, css formatting, and describe the script and give some helpful information.
HOME: Windows 7 x64 SP1 Ultimate | AMD FX 8350 8-Core @ 4.00GHZ | 16GB Ram
WORK: Windows 7 x64 SP1 Home Premium | AMD Athlon II X4 640 @ 3.00GHz | 8GB Ram
MOBILE: Samsung Galaxy Note 3 | 2012 Asus Nexus 7 | Zune 80Gb
User avatar
joedf
Posts: 7694
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: [Class] Console - Standardized Console GUI with Methods

12 Mar 2014, 16:57

AfterLemon wrote:(Not much experience with LibCon, it fails to start due to VarSetCapacity not implemented)
wheres the bug? tell me, so i can fix it.. :O
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x8GB G.Skill RipJaws V - DDR4 3280 MHz | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
User avatar
AfterLemon
Posts: 83
Joined: 30 Sep 2013, 14:27
Location: Arizona, USA

Re: [Class] Console - Standardized Console GUI with Methods

12 Mar 2014, 17:08

joedf wrote:
AfterLemon wrote:(Not much experience with LibCon, it fails to start due to VarSetCapacity not implemented)
wheres the bug? tell me, so i can fix it.. :O
Hey, try not to offtopic the thread. :]

It wasn't working at first, it is now. Idk what happened before.

I had probably tried to use it as a Lib (the name LibCon is misleading) or include it specifically in the example code.

EDIT: It is because I included it in the example code instead of #Include.
HOME: Windows 7 x64 SP1 Ultimate | AMD FX 8350 8-Core @ 4.00GHZ | 16GB Ram
WORK: Windows 7 x64 SP1 Home Premium | AMD Athlon II X4 640 @ 3.00GHz | 8GB Ram
MOBILE: Samsung Galaxy Note 3 | 2012 Asus Nexus 7 | Zune 80Gb
ahk7
Posts: 291
Joined: 06 Nov 2013, 16:35

Re: [Class] Console - Standardized Console GUI with Methods

14 Mar 2014, 17:02

bug #1:

Code: Select all

array:={a:"b"}
Class_Console("a",100,100,800,400)
a.show()
a.append(array) ; only shows arr["a"]= instead of arr["a"]=b
Return
bug #2:

Code: Select all

array:={a:"b",c: {d:"e",f:"g"},h:"i"}
Class_Console("a",100,100,800,400)
a.show()
loop 10
	a.prepend("prepending some text") 
sleep 1500
a.prepend(array)
return
Notice the incorrect indentation of the following lines, they have one space to many between line number and the text:

11. prepending some text
12. prepending some text
13. prepending some text
14. prepending some text

(Yes, using the latest version which you've just updated on GH)
User avatar
AfterLemon
Posts: 83
Joined: 30 Sep 2013, 14:27
Location: Arizona, USA

Re: [Class] Console - Standardized Console GUI with Methods

14 Mar 2014, 17:14

Thanks for not badgering me about updating on GH and not posting anything about it. :]

Will get working on a fix for the second one hopefully before the next 2 hours are up.

The first issue MIGHT be very simple, and I'll look into it, but can't promise a fix today.
HOME: Windows 7 x64 SP1 Ultimate | AMD FX 8350 8-Core @ 4.00GHZ | 16GB Ram
WORK: Windows 7 x64 SP1 Home Premium | AMD Athlon II X4 640 @ 3.00GHz | 8GB Ram
MOBILE: Samsung Galaxy Note 3 | 2012 Asus Nexus 7 | Zune 80Gb
User avatar
AfterLemon
Posts: 83
Joined: 30 Sep 2013, 14:27
Location: Arizona, USA

Re: [Class] Console - Standardized Console GUI with Methods

14 Mar 2014, 19:11

Both issues are fixed!
HOME: Windows 7 x64 SP1 Ultimate | AMD FX 8350 8-Core @ 4.00GHZ | 16GB Ram
WORK: Windows 7 x64 SP1 Home Premium | AMD Athlon II X4 640 @ 3.00GHz | 8GB Ram
MOBILE: Samsung Galaxy Note 3 | 2012 Asus Nexus 7 | Zune 80Gb
User avatar
Sjc1000
Posts: 39
Joined: 02 Oct 2013, 02:07

Re: [Class] Console - Standardized Console GUI with Methods

15 Mar 2014, 03:57

Nice use of MSHTML guys. Top script. :D

EDIT:

Just noticed something, you guys didn't disable the right click on the html.
If you don't want the right click menu change your html body to

<body id="bod" oncontextmenu="return false">
Please find me on the IRC if you have any questions, I'm never on the forum anymore.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: baesi, Sam_ and 20 guests