Mat Posted June 23, 2010 Author Share Posted June 23, 2010 What does this do? http://msdn.microsoft.com/en-us/library/ms687215(v=VS.85).aspx I have no idea but it sounds promising... AutoIt Project Listing Link to comment Share on other sites More sharing options...
wraithdu Posted June 23, 2010 Share Posted June 23, 2010 (edited) I don't think you want to go down that road... Either way, it's over my head and I have no desire to learn about COM that deeply. You would basically be re-implementing AutoIt's COM implementation. Sound like fun? Edited June 23, 2010 by wraithdu Link to comment Share on other sites More sharing options...
Mat Posted June 23, 2010 Author Share Posted June 23, 2010 I don't think you want to go down that road... Either way, it's over my head and I have no desire to learn about COM that deeply. You would basically be re-implementing AutoIt's COM implementation. Sound like fun?No... Functions then? I'll add a notice saying functions are working except setting property values. AutoIt Project Listing Link to comment Share on other sites More sharing options...
Mat Posted September 7, 2010 Author Share Posted September 7, 2010 Version 1.0.2.5 releasedYou can now use Chr(26) without having any fear of it messing up. Although I'm not entirely sure how you got a non-printing character into the console it's still a morale victory for doing the job properly. Thats about it for this release... The helpfile is not updated, but there are a few bits that may be of interest to you if you want to help out: I've added (commented out at the moment) the basic code for getting functions off the user. You will also notice the "now what?" at the bottom of the function. Feel free to try out solutions There is also my attempt to detect when someone tries to close the console and to backup the settings. As you can probably guess this is not working either (it just doesn't do anything).DownloadProject pageChangelogBug trackerMat AutoIt Project Listing Link to comment Share on other sites More sharing options...
Hellooopsforgotsendcommand Posted September 9, 2010 Share Posted September 9, 2010 (edited) Brilliant idea, this is what has been missing and I cant understand why! Im not very good at using AutoIt - I just tinker with it a bit, never really got to grips with it. for a Novice this is a great help and has re-kindled my interest in AutoIt. THANKS! ps I think it should be included in the AutoIt install by default - as its a great help to beginners. Edited September 9, 2010 by Hellooopsforgotsendcommand Link to comment Share on other sites More sharing options...
Mat Posted September 9, 2010 Author Share Posted September 9, 2010 Brilliant idea, this is what has been missing and I cant understand why!Im not very good at using AutoIt - I just tinker with it a bit, never really got to grips with it. for a Novice this is a great help and has re-kindled my interest in AutoIt. THANKS! ps I think it should be included in theAutoIt install by default - as its a great help to beginners.Thats what ists here for Tinkering.It has WAY too many limitations to be anywhere near being included in the AutoIt installation, I think the only way thats going to happen is to use the AutoIt source code itself, and use the current interpreters logic instead of my own (and in many places Wraithdu's) attempt to simulate it.The other good news is that I am now fixing a few more problems I have found Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
Hellooopsforgotsendcommand Posted September 11, 2010 Share Posted September 11, 2010 Thats what ists here for Tinkering.It has WAY too many limitations to be anywhere near being included in the AutoIt installation, I think the only way thats going to happen is to use the AutoIt source code itself, and use the current interpreters logic instead of my own (and in many places Wraithdu's) attempt to simulate it.The other good news is that I am now fixing a few more problems I have found MatI still think it should be easier to "come across" for an aid to beginners. Maybe mentioned on a tutorials page or something. I just come across it by accident a few days ago! would have been great to have had this from the start. keep up the good work! Link to comment Share on other sites More sharing options...
Revolter Posted December 3, 2010 Share Posted December 3, 2010 (edited) IGNORE THIS IF YOU DON' T WANT TO RESPOND INSTEAD OF RESPONDING AND SAYING ANYTHING ELSEdumb questionhow does this works? :|how do i debug my sciprt using this? Edited December 3, 2010 by Revolter [center]Sorry for my bad english. Trying my best :Dhttp://iulianonofrei.comhttp://www.last.fm/user/Revolt666 [/center] Link to comment Share on other sites More sharing options...
James Posted December 3, 2010 Share Posted December 3, 2010 dumb questionhow does this works? :|how do i debug my sciprt using this?Have you even tried to understand what it does?I can see you becoming a big annoyance. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Revolter Posted December 3, 2010 Share Posted December 3, 2010 Have you even tried to understand what it does?I can see you becoming a big annoyance.:| Of course ... i read all the replies ... you don' t have to respond just to ask me another dumb question :| [center]Sorry for my bad english. Trying my best :Dhttp://iulianonofrei.comhttp://www.last.fm/user/Revolt666 [/center] Link to comment Share on other sites More sharing options...
Mat Posted December 3, 2010 Author Share Posted December 3, 2010 When you run it... You should get a command prompt like this: AutoIt3 Interpreter version: 1.0.2.5 Copyright (c) Matt Diesel (Mat) 2010 Au3Int -> You can then type in lines of AutoIt code and see what happens in real time. In it's simplest form, you can use it for maths: Au3Int -> 5 * 6 - 2 ^ 4 => 14 But if you want to know how to use MouseGetPos... Try it: Au3Int -> MouseGetPos() => Array[2] [0] => 897 [1] => 285 Au3Int -> MouseGetPos(0) => 897 Au3Int -> MouseGetPos(1) => 285 Arrays were a pain to get working (read the code to see hard it was). But try this: Au3Int -> Local $aMyArray[5][2] = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]] => Array[5][2] [0][0] => 1 [0][1] => 2 [1][0] => 3 [1][1] => 4 [2][0] => 5 [2][1] => 6 [3][0] => 7 [3][1] => 8 [4][0] => 9 [4][1] => 10 Au3Int -> ReDim $aMyArray[4][2] => Array[4][2] [0][0] => 1 [0][1] => 2 [1][0] => 3 [1][1] => 4 [2][0] => 5 [2][1] => 6 [3][0] => 7 [3][1] => 8 Au3Int -> ReDim $aMyArray[4][1] => Array[4][1] [0][0] => 1 [1][0] => 3 [2][0] => 5 [3][0] => 7 Basically, if you want to test out how a line of code will work, then this is the best way to do it. To debug scripts... Run Au3Int.exe with the file as the first parameter to read all the output... But thats not really needed when you have scite, it's just there for when you need to read the output on computers where there is no AutoIt. Does that explain it? AutoIt Project Listing Link to comment Share on other sites More sharing options...
Revolter Posted December 3, 2010 Share Posted December 3, 2010 When you run it... You should get a command prompt like this: AutoIt3 Interpreter version: 1.0.2.5 Copyright (c) Matt Diesel (Mat) 2010 Au3Int -> You can then type in lines of AutoIt code and see what happens in real time. In it's simplest form, you can use it for maths: Au3Int -> 5 * 6 - 2 ^ 4 => 14 But if you want to know how to use MouseGetPos... Try it: Au3Int -> MouseGetPos() => Array[2] [0] => 897 [1] => 285 Au3Int -> MouseGetPos(0) => 897 Au3Int -> MouseGetPos(1) => 285 Arrays were a pain to get working (read the code to see hard it was). But try this: Au3Int -> Local $aMyArray[5][2] = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]] => Array[5][2] [0][0] => 1 [0][1] => 2 [1][0] => 3 [1][1] => 4 [2][0] => 5 [2][1] => 6 [3][0] => 7 [3][1] => 8 [4][0] => 9 [4][1] => 10 Au3Int -> ReDim $aMyArray[4][2] => Array[4][2] [0][0] => 1 [0][1] => 2 [1][0] => 3 [1][1] => 4 [2][0] => 5 [2][1] => 6 [3][0] => 7 [3][1] => 8 Au3Int -> ReDim $aMyArray[4][1] => Array[4][1] [0][0] => 1 [1][0] => 3 [2][0] => 5 [3][0] => 7 Basically, if you want to test out how a line of code will work, then this is the best way to do it. To debug scripts... Run Au3Int.exe with the file as the first parameter to read all the output... But thats not really needed when you have scite, it's just there for when you need to read the output on computers where there is no AutoIt. Does that explain it? sure ... thanks; i thought that it will run a line then pause to see what that line did ... or something like this ... [center]Sorry for my bad english. Trying my best :Dhttp://iulianonofrei.comhttp://www.last.fm/user/Revolt666 [/center] Link to comment Share on other sites More sharing options...
jvanegmond Posted December 3, 2010 Share Posted December 3, 2010 (edited) This seems strange. Bug?AutoIt3 Interpreter version: 1.0.2.5 Copyright ® Matt Diesel (Mat) 2010 Au3Int -> ConsoleWrite("roflkek") => 7 Au3Int ->I was expecting output: roflkek. What happen?Edit: Oh nvm, I'm supposed to put "roflkek" in there, instead of using ConsoleWrite. My bad.Edit2: Then why not this:AutoIt3 Interpreter version: 1.0.2.5 Copyright ® Matt Diesel (Mat) 2010 Au3Int -> FileRead("au3int.chm") Au3Int -> $file = FileRead("au3int.chm") Au3Int -> $file Au3Int ->Too big? I'd like a notice if that's the case.Edit3:AutoIt3 Interpreter version: 1.0.2.5 Copyright ® Matt Diesel (Mat) 2010 Au3Int -> Exit = > Error: Missing separator character after keyword.: Axit Axit^ ERROR Au3Int ->Edit4: Software and alcohol do not mix. Don't let anyone else tell you otherwise. Edited December 3, 2010 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
Mat Posted December 3, 2010 Author Share Posted December 3, 2010 (edited) The first one doesn't work, for the simple reason that it doesn't. Try: Au3Int -> $hKERNEL32 = 'Kernel32.dll' => "Kernel32.dll" Au3Int -> $hConsole = DllCall($hKERNEL32, "handle", "GetStdHandle", "dword", -11) => Array[2] [0] => 0x00000007 [1] => 4294967285 Au3Int -> $hConsole = $hConsole[0] Obscure instruction. Do you want to re-assign 'hConsole'? y/n y => 0x00000007 Au3Int -> $sText = 'test' => "test" Au3Int -> DllCall($hKERNEL32, "bool", "WriteConsoleA", "handle", $hConsole, "str", $sText, "dword", StringLen($sText), "dword*", 0, "ptr", 0) test=> Array[6] [0] => 1 [1] => 0x00000007 [2] => "test" [3] => 4 [4] => 4 [5] => 0x00000000Not sure about the next one, there is no internal check (though it was considered). Must be a windows limitation, I'll do some reading. Other files read fine btw. I think a limit should be placed on the output though... Any suggestions on length etc? Certainly my current method for printing arrays is way off being able to predict the output size (the function simply calls itself as many times as needs be). Possibly related to this item on the issue tracker: http://code.google.com/p/au3int/issues/detail?id=10That last one can't be right. But testing it did find a few other bugs, not least the fact that I haven't actually released the latest version. So here it is. 1.0.2.6.MatEdit: Lets do this properly:Changes this version (1.0.2.6): [ see full changelog ]NB: This version is no longer the latest.Settings saved on exit for the console (needs to be tested more thoroughly)Source code tidy up.Updated console functions. The full library is work in progress here.A few bugs fixed. It's been sitting around for a while, so I needed to run a diff to find out what id done!The svn repository has not been updated (yet).DownloadProject pageChangelogBug tracker Edited December 3, 2010 by Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
James Posted December 3, 2010 Share Posted December 3, 2010 Mat,I have some very strange problems when using the compiled latest release 1.0.2.61. When I first run the interpreter, type "help" for example, then straight after, "clear", the "help" command is left in the first buffer position.2. Try doing the following:$var = trueif $var then msgbox(0, "", "Hai durrr")"= > Error: Variable used without being declared."local $var = true"Blah blah, variable is already declared blah bah"Food. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Mat Posted December 3, 2010 Author Share Posted December 3, 2010 (edited) I can explain that, and hopefully fix it. Step 1) Execute fails as it can't deal with full IF tests. Step 2) The interpreter tries to get more error information, by executing the line using the command line parameter and reading stderr. BUT this is not good as it finds that $var is not declared. It wouldn't have found an error anyhow. Solution: Custom IF test parsing. Will do I have also uploaded a proof of concept for version 2. Still a bit dodgy, and you guys are finding enough bugs in the current version anyway. Try it, you can use includes and functions, but no nested statements yet, they are a little tricky. I think it could work though. Anything else I should know about Edit: I fixed it, and re built + uploaded the new version. The If tests work beautifully. Edited December 3, 2010 by Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
wraithdu Posted December 3, 2010 Share Posted December 3, 2010 That's odd, I don't have any of Manadar's weird errors with my compiled version of 1.0.2.5. And 'Exit' works just fine. @Manadar Did you compile your own version of Au3Int and not obfuscate the source code? That could cause some internal variable collisions or something... I also get the odd behavior of FileRead, but if you do a VarGetType() on the var, it is a string. Could be there are some non-printable chars or nuls which would mess up the display. AutoIt3 Interpreter version: 1.0.2.5 Copyright c Matt Diesel (Mat) 2010 Au3Int -> $file = FileRead("au3int.chm") Au3Int -> VarGetType($file) => "String" Au3Int -> StringLen($file) => 229959 Au3Int -> BinaryLen($file) => 229959 Link to comment Share on other sites More sharing options...
Mat Posted December 3, 2010 Author Share Posted December 3, 2010 (edited) Manadars error with the exit was so weird I ignored it. How he got himself that is unknown to me. I'm assuming the strings too large for the console. Maybe it's a good thing it doesn't print it. However, this page does not have any mention of it: http://msdn.microsoft.com/en-us/library/ms687401.aspx Edit: I would have thought non printing characters would be fine... And nuls would just act as the end of the string... (Maybe not) WTF!! I'm guessing error No. 1 is that it's trying to print a unicode string as ascii. Error No 2 is that isn't what it should be at all. AutoIt3 Interpreter version: 1.0.2.7 Copyright (c) Matt Diesel (Mat) 2010 Au3Int -> $file = FileRead('au3int.chm') Au3Int -> StringLeft($file, 1) => "I" Au3Int -> StringLeft($file, 200) > "ITSF♥ ♥ I n t e r p r e t e r v e r s i o n : 1 . 0 . 2 . 7 C o p y r i g h t ( c ) M a t t D i e s e l ( M a t ) 2 0 1 0 F i l e V e r s i o n 1 . 0 . 2 . 7 b % ☺ CAu3Int -> Edited December 3, 2010 by Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
wraithdu Posted December 3, 2010 Share Posted December 3, 2010 (edited) So I downloaded and compiled 1026. Changes look fine to me, except I wouldn't ever delete 'HKCR\.au3'. You need to backup and restore the system's original file type settings if you ever use 'install' / 'uninstall' otherwise you risk blowing away someone's file types from an installation of AutoIt. You also need to consider the scenarios where someone issues 'install' or 'uninstall' twice in a row as well (ie installing when it's already installed, uninstalling after it's already uninstalled), and gracefully handle that. EDIT: Oh, and I kind of liked that issuing ConsoleWrite("hello") would actually print "hello", now it just shows the function's return value. Edited December 3, 2010 by wraithdu Link to comment Share on other sites More sharing options...
Mat Posted December 3, 2010 Author Share Posted December 3, 2010 It won't let you install if there's already something there, thats why. I figured the only time it was of use was when you are on a computer with no AutoIt. You can't install if it's already installed, and you can't uninstall unless it was installed using au3Int (it uses a different registry key: Au3IntTempScript)ConsoleWrite has not printed "hello" since the early days. I never worked out why, although I assume it is related to the fact that I use the WinApi AllocConsole rather than compiling it as a normal console app. It should still be using the standard api to write to the console anyway. It's a long standing thing, and a pain in the arse. For my Console.au3 (here) you can't use ConsoleWrite with _Console_Alloc...Next version will now only use _Console_Alloc for the non compiled versions. It will also remove AINTERNALARRAYWAT I also fixed the bug that James pointed out about it not clearing the console properly. AutoIt Project Listing 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