Jump to content

AutoIt3 Interpreter.


Mat
 Share

Recommended Posts

NP. I'm gonna put it on my memory stick. It would be a nice shell for working with settings and stuff. Is there a feature to udfs into the program so I can call them from the prompt?

Yes... Sort of... Wraithdu mentioned the same thing back here and gave a solution a few posts later which is now in the helpfile.

If you open the helpfile or type "?" into the console then look under

Au3Int -> AutoIt3 Interpreter -> Modifying -> Includes

that gives detailed instructions, but since the latest release (1.0.2.3) you can run the interpreter without compiling, so adding includes is easy. Just make sure you don't get yourself caught in infinite loops by trying to use internal variables.

Mat

Link to comment
Share on other sites

Yes... Sort of... Wraithdu mentioned the same thing back here and gave a solution a few posts later which is now in the helpfile.

If you open the helpfile or type "?" into the console then look under

Au3Int -> AutoIt3 Interpreter -> Modifying -> Includes

that gives detailed instructions, but since the latest release (1.0.2.3) you can run the interpreter without compiling, so adding includes is easy. Just make sure you don't get yourself caught in infinite loops by trying to use internal variables.

Mat

Thanks for the info. I'm gonna look into that.
HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
Link to comment
Share on other sites

Working on a very simple include to make it easier to use as a command prompt. Transparency would be cool. Theres a nice CMD prompt aero glass script somewhere in this forum. =)

Func Dir($sArgs="")
    CMD('Dir '&$sArgs)
EndFunc

Func Color($sArgs="")
    CMD('Color '&$sArgs)
EndFunc

Func CD($sDir="")
EndFunc

Func CMD($sCMD)
    RunWait(@ComSpec&" /c " & $sCMD)
EndFunc
Edited by FuryCell
HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
Link to comment
Share on other sites

Working on a very simple include to make it easier to use as a command prompt. Transparency would be cool. Theres a nice CMD prompt aero glass script somewhere in this forum. =)

Func Dir($sArgs="")
    CMD('Dir '&$sArgs)
EndFunc

Func Color($sArgs="")
    CMD('Color '&$sArgs)
EndFunc

Func CD($sDir="")
EndFunc

Func CMD($sCMD)
    RunWait(@ComSpec&" /c " & $sCMD)
EndFunc

Did you see the other example of modifying? Well that's exactly what I was thinking of commands like that :P

However, you want args... If you look in the biggest switch (about line 110 think) you will see it is a list of commands as they appear before the first space. I will add one in there called "cmd" which does exactly what your last function does :mellow:

I was meaning to do that before anyway...

Edit: Done. From 1.0.2.4 "cmd *" will run "cmd /c *".

Edited by Mat
Link to comment
Share on other sites

Did you see the other example of modifying? Well that's exactly what I was thinking of commands like that :P

However, you want args... If you look in the biggest switch (about line 110 think) you will see it is a list of commands as they appear before the first space. I will add one in there called "cmd" which does exactly what your last function does :mellow:

I was meaning to do that before anyway...

Edit: Done. From 1.0.2.4 "cmd *" will run "cmd /c *".

Awesome. =)

Now this is shaping up to beat powershell.

Edit:BTW maybe a special charceter as an alias would be good instead of typing cmd everytime. For example to call dir you could do "cmd dir" or "!dir"

Edited by FuryCell
HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
Link to comment
Share on other sites

Awesome. =)

Now this is shaping up to beat powershell.

Edit:BTW maybe a special charceter as an alias would be good instead of typing cmd everytime. For example to call dir you could do "cmd dir" or "!dir"

Or just build dir in. Then it will be... "dir". :mellow:

I'll have a look. The one thing I'm forgetting is that this is an AutoIt Interpreter... at the rate we're going it will be a kickass-do-everything-provided-you-have-room-for-the-gigabyte-helpfile program :P

Mat

Link to comment
Share on other sites

Or just build dir in. Then it will be... "dir". :mellow:

I'll have a look. The one thing I'm forgetting is that this is an AutoIt Interpreter... at the rate we're going it will be a kickass-do-everything-provided-you-have-room-for-the-gigabyte-helpfile program :P

Mat

It's a matter of direction. Its up to you to decide weather you want to move this in the direction of a shell or just an interpreter. I personally like the idea of a shell because cmd prompt is lacking and AutoIt has commands very well suited for use as a shell. Plus Au3 users can get the usefulness of powershell without having to go all out and learn something new.

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
Link to comment
Share on other sites

It's a matter of direction. Its up to you to decide weather you want to move this in the direction of a shell or just an interpreter. I personally like the idea of a shell because cmd prompt is lacking and AutoIt has commands very well suited for use as a shell. Plus Au3 users can get the usefulness of powershell without having to go all out and learn something new.

I agree, and I think that as long as there is no chance that a non-AutoIt command will be confused with an AutoIt one then I'm happy to carry on adding :mellow:

Link to comment
Share on other sites

Version 1.0.2.4 released.

This version brings about lots of changes, thanks to Wraithdu and FuryCell.

Wraithdu fixed more bugs than I can list off the top of my head, and also came up with a solution for array initialization which works brilliantly, and so completes the interpreters array support at long last, meaning I am now going to move to more things... Functions and objects.

FuryCell added the "glass on" and "glass off" commands, as well as reporting his own list of bugs and requesting the "cmd" command.

Oh... And I finally managed to tortoiseSVN working well so the project page now has the "source" tab, which can be used to see and comment on the source code without downloading the zip.

Changes this version (1.0.2.4): [ see full changelog ]

  • Added: Array initialization support (by Wraithdu)
  • Fixed: General bug fix by Wraithdu:

    • X64 registry paths incorrect.
    • String loop starting at the wrong character offset.
    • Embedded for loops using the same variable.
    • Skipping a loop.
    • ( c ) changed to copyright symbol.
  • Added: commands:

    • "install" - Sets *.au3 files to run using the interpreter.
    • "uninstall" - Un-sets *.au3 files running with the interpreter.
    • "restart" - Restarts the interpreter.
    • "glass on" - Sets the consoles background to aero glass (Vista+) - FuryCell
    • "glass off" - Sets the consoles background back to the default (usually black) after a previous call to "glass on" - FuryCell
    • "cmd" - Runs a command prompt command.
  • Added: SVN source repository on project page.

Download

Project page

Changelog

Bug tracker

Mat

Edited by Mat
Link to comment
Share on other sites

The only problem I have found is that even if you specify the /AutoIt3ExecuteScript (not sure if thats exact) the console still shows when running it using the command line app.

I'm sure you'll be pleased to know that a lot of that array assigning etc. code will now need to be changed to add support for objects... I think we may be able to get away with it for the arrays, but the variable code? not so sure...

Link to comment
Share on other sites

I think you'll be pleased to know, that to a GREAT extent, objects are already working:

Au3Int -> $oW = ObjCreate("wscript.shell")
=>
Au3Int -> IsObj($oW)
=> 1
Au3Int -> $oW.Popup("text", 0, "title", 0)
=> 1
Au3Int -> $ret = $oW.Popup("text", 0, "title", 52)
=> 6
Au3Int -> $ret
=> 6
Au3Int -> Dim $as1[1] = [$oW.Popup("text", 0, "title", 52)]
=> Array[1]
     [0] => 6
Au3Int -> ReDim $as1[2]
=> Array[2]
     [0] => 6
     [1] => ""
Au3Int -> $as1[1] = $oW.Popup("text", 0, "title", 52)
Obscure instruction.
Do you want to re-assign 'as1[1]'? y/n y
=> 7
Au3Int -> $as1
=> Array[2]
     [0] => 6
     [1] => 7

Obviously I can't test every object possibility, but the basics seem to be there. A sign of a well written parser :mellow: Maybe just add a generic object notification in the PrintVar function, since there's no real data to display.

Edited by wraithdu
Link to comment
Share on other sites

Hmm, good point. I'm not a COM guru, so I can't even think of an object where that's necessary off the top of my head. But I see where that might be a problem. It might just be a functional limitation of the interpreter (even AutoIt has functional limitations).

Edited by wraithdu
Link to comment
Share on other sites

Hmm, good point. I'm not a COM guru, so I can't even think of an object where that's necessary off the top of my head. But I see where that might be a problem. It might just be a functional limitation of the interpreter (even AutoIt has functional limitations).

I can't either :mellow: I guess thats a good thing.

Would the AutoIt object UDF do it? I will have a look...

Link to comment
Share on other sites

AIO uses the same subsystem for objects as AutoIt. Basically it creates custom objects that AutoIt understands, so it's syntactically the same.

Ah right... Never used it :mellow:

But you can make property's with it right? Then surely that means there could be propertys in other objects...

the IE com has lots of them :P

$oIE.document.body.innerHTML = $s_html

Link to comment
Share on other sites

Yep, sure can. Same problem (maybe) with the interpreter remains. But it means we could use the AIO UDF in the interpreter to test it though. Later :mellow: Time for father's day dinner with dad.

I think the IE com in particular could be useful, and so to have some of the key things missing would not be good...

Link to comment
Share on other sites

I did some testing, and there is no way that I can come up with to assign a value to an object property. You're best bet would be to add an AutoIt feature request to have Assign() work with object properties, ie Assign("oObj.prop", "data").

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...