Jump to content
Sign in to follow this  
Xenobiologist

Little New Features For Autoit (Discussion)

Recommended Posts

Xenobiologist

Hi,

GaryFrost openend a thread how to submit udfs. I searched through my snippets and found some pieces of code which I'd like to discuss whether they can become a macro/udf ... before submitting them btw. somebody creates a nice piece of code for achieving the goal.

Before flaming me, YES I know they are not perfect. The code is just as examples, because it is better to understand what I mean when providing some code instead of just asking for something.

1. Macro for type of OS like (XP home or Professional)

2. _getDNS()

3. Macro for loggedInUser

4. StringInsertLF

1.

Global $objWMIService = objget("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")


  Global $colSettings = $objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For $objOperatingSystem in $colSettings
    $Type = StringMid($objOperatingSystem.Caption, 19)
    MsgBox(64, 'Ouput of Windows Type', "Type   : "& $Type)
NextoÝ÷ Ûc,1Ò«¨¶«¨¶­ÔºÚ"µÍ[ÈÙÙ]Ê
BØØ[  ÌÍÙ×ÐHHÝ[ÔYÑ^
ÝÝ]XY
[ÛÛTÜXÈ [È ][ÝÈØÈÛÛÚÝ  ][ÝË  ][ÝÉ][ÝËÕ×ÒQKJK  ÌÎNÊÜÊJÚJÙÉÌLËÊJÛNÌÍß    ÌLÜIÌÎNËJBYÐ^J    ÌÍÙ×ÐJH[]  ÌÍÙ×ÐVÌB]Ù]ÜJB[[oÝ÷ ÛyÉö¢è¶«§!w¬¶§óÑ9#öjëh×6  Global $loggegInUser = RegRead("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\", "AltDefaultUserName")
Msgbox(64, "Value", $loggegInUser)oÝ÷ Û®¶­sc·â&V7VÇFWBföâ·W&ÃÒgV÷C¶GG¢òöFRçv¶VFæ÷&r÷v¶ôWFôBgV÷CµÖGG¢òöFRçv¶VFæ÷&r÷v¶ôWFôE²÷W&ÅÐ  ¢ ¢b33cµ7G&ærÒgV÷C´FR6·&FRW&ßfvÆ6Vâ¢â"âF2W6oÆ&Vâföâ&öw&ÖÖVâÂF26×VÆW&VâföâF7FGW&ç66ÎFvVâ'§râÖW6¶Æ6·2âW2¿fææVâVæf6RFWFgVæ·FöæVâFW"§v66Væ&ÆvRöFW"V6væF÷w6gVæ·FöæVâvR¢â"âÖæÖW&VâÂfW'7FV6¶VâÂv'FVâVbô·FfW&VâföâfVç7FW&âVfvW'VfVâvW&FVââ6VBfW'6öâ2¿fææVâ§VFVÒw&66R&VçWG¦W&ö&W&fÎF6VâÖB¦Ç&V6Vâ6öçG&öÇ2VçGv÷&fVâvW&FVââ6öÆÂW2VÒ&Vv7G'ÖæVÆFöæVâöFW"¶ö×ÆWW&R66ÆVfVâvVVâÂ7BWFôB2ç§v66VâÖB6VæW"fW&&W76W'FVâ7çFFWWFÆ6Væf6W"§RæF&VâÇ2g/ÆW&RfW'6öæVââW27BßfvÆ6ÂWFôBÖBæFW&67&G7&6VâvRu4öFW"¶F'B§R¶öÖ&æW&VâWFôEâgV÷C° ¤×6t&÷ÂgV÷C²gV÷C²Âb33cµ7G&ær²÷&væÂÕFW@¤×6t&÷ÂgV÷C²gV÷C²Âõ7G&ætç6W'DÄbb33cµ7G&ærÂS²6ögF'&V²gFW"S¤×6t&÷ÂgV÷C²gV÷C²Âõ7G&ætç6W'DÄbb33cµ7G&ærÂS²&F'&V²gFW"S ¤gVæ2õ7G&ætç6W'DÄbb33c·7G%7G&ærÂb33c¶ä6÷VçBÂb33c¶4'&V¶ærÒ¢Æö6Âb33c·7G%&WE7G&ærÒgV÷C²gV÷C²Âb33c¶å÷0¢Fð¢b7G&ætÆVâb33c·7G%7G&ærfwC²b33c¶ä6÷VçBFVà¢b33c¶å÷2Ò7G&ætå7G"7G&ætÆVgBb33c·7G%7G&ærÂb33c¶ä6÷VçB²ÂgV÷C²gV÷C²ÂÂÓ¢bb33c¶å÷2æBb33c¶4'&V¶ærÒFVà¢b33c·7G%&WE7G&ærf׳Ò7G&ætÆVgBb33c·7G%7G&ærÂb33c¶å÷2ÒfײÄ`¢b33c·7G%7G&ærÒ7G&ætÖBb33c·7G%7G&ærÂb33c¶å÷2²¢VÇ6P¢b33c·7G%&WE7G&ærf׳Ò7G&ætÆVgBb33c·7G%7G&ærÂb33c¶ä6÷VçBfײÄ`¢b33c·7G%7G&ærÒ7G&ætÖBb33c·7G%7G&ærÂb33c¶ä6÷VçB²¢VæD`¢VæD`¢VçFÂ7G&ætÆVâb33c·7G%7G&ærfÇC²b33c¶ä6÷Vç@¢b33c·7G%&WE7G&ærf׳Òb33c·7G%7G&æp¢&WGW&âb33c·7G%&WE7G&æp¤VæDgVæ2³ÓÒfwCµõ7G&ætç6W'
Mega Edited by Xenobiologist

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
Xenobiologist

Hi,

nobody an opinion? IMO it would be nice to have a macro for the OS type like XP HOME or Proffesionell and so on, cause there are some systemtools only available on the higher class installation.

Same for script starting user differs to loggedinUser.

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
nikink

What does your OS_Type solution do that the existing OS Macros can't? (I'm just curious, by the way, not criticising)

Share this post


Link to post
Share on other sites
GEOSoft

What does your OS_Type solution do that the existing OS Macros can't? (I'm just curious, by the way, not criticising)

Returns whether it's Home or Pro

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
Xenobiologist

Returns whether it's Home or Pro

Hi,

exactly. And Vista has I believe 6 different variants. And Win 98 has a second edition and so on. Maybe a macro can show this.

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
FreeFry

A macro for such could probably be usefull, but I suspect that it's still possible to get what type of windows the user is running(Home/Pro/Server, etc.) by using com objects.

Share this post


Link to post
Share on other sites
Xenobiologist

A macro for such could probably be usefull, but I suspect that it's still possible to get what type of windows the user is running(Home/Pro/Server, etc.) by using com objects.

Sure I guess there is more than one way to get that information. All I wanted to say is, that I'd like to have a macro for that buildin in Autoit.

A dev like Jos or Valik have to say whether they like the idea and whether the got a solution which they can implement with no worries.

Mega

Edited by Xenobiologist

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
alc

@ Mega:

Hi.

I'm with you. The only but...: I'll like StringInsertCRLF

Cheers

alc

Share this post


Link to post
Share on other sites
Xenobiologist

Thanks,

@mods/devs : any comment? One sentence is enough.

Like: all crab will not be considered | or | I'll have a look and need to think about it.

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
GEOSoft

Thanks,

@mods/devs : any comment? One sentence is enough.

Like: all crab will not be considered | or | I'll have a look and need to think about it.

Mega

I don't think you will see the devs jumping in right away. Something like returning the Version type, while perhaps a nice concept, may not be of a lot of benefit to the majority of users. It can be obtained through the use of WMI which is easily scripted in AutoIt. And how many times is there a need to know whether it is XP Home or XP Pro | 98 or 98SE? We already have the important info, for example Service pack info. Btw; for 98 that info can be returned from the build information. It's been pointed out many times that the days of asking for a feature and having it included (if possible) are long past. Some of these "simple" functions are just not worth the effort that it takes to implement them. Right now I believe the emphasis is on cleaning up the AutoIt code and not on adding to it. That's not to say we won't see more features added but they will definitly be priorized.

JMHO


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
Xenobiologist

I don't think you will see the devs jumping in right away. Something like returning the Version type, while perhaps a nice concept, may not be of a lot of benefit to the majority of users. It can be obtained through the use of WMI which is easily scripted in AutoIt. And how many times is there a need to know whether it is XP Home or XP Pro | 98 or 98SE? We already have the important info, for example Service pack info. Btw; for 98 that info can be returned from the build information. It's been pointed out many times that the days of asking for a feature and having it included (if possible) are long past. Some of these "simple" functions are just not worth the effort that it takes to implement them. Right now I believe the emphasis is on cleaning up the AutoIt code and not on adding to it. That's not to say we won't see more features added but they will definitly be priorized.

JMHO

Hi,

I understand what you said, but I cannot agree with the solution. Even when the suggestions are bullshit, they are still worth a reasonable comment. How else should somebody contribute anything, if he doesn't get a clear answer. As I pointed out before, I won't be disappointed if somebody says: Thanks, but I think we do not need that. That's all!

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
GEOSoft

Hi,

I understand what you said, but I cannot agree with the solution. Even when the suggestions are bullshit, they are still worth a reasonable comment. How else should somebody contribute anything, if he doesn't get a clear answer. As I pointed out before, I won't be disappointed if somebody says: Thanks, but I think we do not need that. That's all!

Mega

I'm sure you will get several reasonable comments yet.

BTW: Doesn't this thread belong in Chat or Dev Chat? It's not a Help and Support issue.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
Xenobiologist

I'm sure you will get several reasonable comments yet.

BTW: Doesn't this thread belong in Chat or Dev Chat? It's not a Help and Support issue.

Well :P , I put it in Feature request system and it was closed without reasonable comment, only with comment it was misplaced. Then I had a discussion whether I sent a PM to somebody or post in forum. I decided to put it here, cause chat is mostly for non-autoit stuff. S&S is also not for features and I'm sure it were already closed if I put it into Devs chat. :D

So, where to put it? I don't know? Move it ....

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
GEOSoft

I put it in Feature request system and it was closed

I can see why that would happen. The feature request system is for requesting features, not discussing them. I still think Chat would have been the better place but it's not up to me :D

EDIT: Perhaps the Feature Requests forum needs another Sub >>>> Feature Discussion.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
Xenobiologist

I can see why that would happen. The feature request system is for requesting features, not discussing them. I still think Chat would have been the better place but it's not up to me ;)

EDIT: Perhaps the Feature Requests forum needs another Sub >>>> Feature Discussion.

:P okay, next time I put it again in feature request without any line of code and without the word discussion. :D Feature request : MAKE ... !!! ASAP!!! :P;)

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
Xenobiologist

Ought to be happy I said as much as I did.

Okay, thanks! I give up.

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
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
Sign in to follow this  

×