Jump to content

Organize Includes in Scite for Autoit


Xenobiologist
 Share

Recommended Posts

Hi,

Posted Image

this script scans all the funcs in Autoits include files and you can easily add pathes to your udfs.

Starting the script by hitting CTRL+SHIFT+ALT+I in Scite, it shows you what include files you need and which you do not need.

Link --> old Thread : http://www.autoitscript.com/forum/index.php?showtopic=45814

It is a bit tricky to install it manually (see old thread) because of that I created a quick installer to do the configuration for you. (Installer is in the zip file)

You need Autoit v3.2.12.1 and of course SciTE for Autoit.

Thanks! (martin & Tweaky & Zedna and all the others!!!)

Added : Include pathes to your own udfs now have to be defined in the includes.ini and no in code anymore.

[uDF_Include_Pathes]

MyUDFPath1=

MyUDFPath2=

MyUDFPath3=

MyUDFPath4=

Added : OI now detects selfinclude

Changed: Release and beta includes are now readiobuttons

Changed : OI now works with Release version 3.2.12.1 and higher

Added : new Regex to differ e.g $nr_Max and _Max()

Added : ;~ comments detection

and a lot of little things inside.

NEW THREAD AND VERSION!!! NEW VERSION

So long,

Mega

4.3.zip

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

Link to comment
Share on other sites

  • Replies 116
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

what do I have to do to make this script more useable for beginners or experts?

I'd like to do a rewrite if somebody shows up a possibilty how to get this in handy.

Thanks!

So long,

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

Link to comment
Share on other sites

Hi,

what do I have to do to make this script more useable for beginners or experts?

I'd like to do a rewrite if somebody shows up a possibilty how to get this in handy.

Thanks!

So long,

Mega

Looks good so far but a couple of times it says I need guibuttons.au3 but it's wrong.

An example is this script.. (You need to comment out lots of Consts )

I also tried it on RazerM's editor which I'm using. Organize includes said that it didn't need array.au3. I commented it out and it ran fine. <_<

With 'food guide.au3' (3700 lines long) it says guicombobox.au3 needed, but that's not true as far as I can tell, and it also says #include <XSkin.au3> is needed but this is already in the script as #include ".\FoodGuide\XSkin.au3".

Present suggestions.

a progresson or something because there is a delay when you start your script running before you see anything.

It would be helpful if when you say that a certain include file is needed you could show where or why it's needed. With the false button one for example, it would help show why it tells you. Also, if it's correct it's good to be show exactly why, and this gives more confidence.

Glad you've kept working on this. I think a lot of people will have scripts with includes which aren't needed, or they won'tl know what they should include when they paste code in from somewhere and it doesn't work.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

  • 2 weeks later...

Hi,

thanks for the nice reply.

I tested you stuff.

1) guibuttons.au3 is needed - I couldn't reproduce it.

2) #include ".\FoodGuide\XSkin.au3" - I have to improve checking for includes with a path and includes in includes

3) suggenstions :

a ) Progress - ok should be possible

b ) Show why is needed - can maybe be done by adding a new column. (takes me some time)

So long,

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

Link to comment
Share on other sites

  • 2 months later...

I modified Organize Includes for the latest include files.

It produces the result shown below.

I don't know what the yellow lines with a '1' for the include file mean.

The last line is a small bug I think because dllcallback is not included in my script, but I have two lines in my script like this

$AutoMonItText = StringReplace($AutoMonItText,"#include <dllcallback.au3>","#include " & "'" & $AutoItBetaexePath & "\Include\dllcallback.au3'")
$AutoMonItText = StringReplace($AutoMonItText,"#include '#x#x#x#xx#BBAutoMonIt script goes here#x#x#x#x#x#'",$temptext)

so I think your script is finding the include even though it is enclosed in quotes.

Your script seems to ignore include files like this

#include "scrollbars.au3" ;I have 2 includes like this

or is that connected with the yellow lines?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

HI,

thanks again martin for your feedback.

I created a new little beta.

Includes in an includes file is still a ToDo.

Your suggestions:

a ) Progress - I implemented a little progress before the GUI shows up. It is just a beta to show that it works. (I'll make it looking a bit nicer later :P )

b ) Show why is needed - I made an output to the Scite console to show which func was found and so caused the needed include. After having found one func of Autoit include file e.g. _ArrayDisplay from Array.au3 I skip looking for other funcs from Array.au3, cause it is already needed. You can change that for testing by commenting out the Exitloop in line 366.

I improved the regex patterns, so that you can test the dllcallback thing again.

I also changed the patterns that way that they should look for "bla.au3" or 'bla.au3' includes from now on.

I also changed it to the new funcs from Autoit 3.2.10.0 without having the problems with the 1.

The problems you had was this --> Link BugForum

I removed the GUI stuff for adding include pathes, cause I never really needed it.

I just put all my udf includes in one or two folders and add this path to organize includes here

; **************************************************************
;   Add HERE your own pathes for udfs
; **************************************************************
  _ArrayAdd($includesPath, $betaInstallPath & '\include\UDF\')
;   _ArrayAdd($includesPath, 'C:\downloads\')
;   _ArrayAdd($includesPath, 'C:\downloads\')
;   _ArrayAdd($includesPath, 'C:\downloads\')
; **************************************************************

Thanks again!

So long,

Mega

[autoit]#include<Array.au3>

#include<File.au3>

#include<GuiListView.au3>

#include<GuiStatusBar.au3>

#include<GUIConstants.au3>

; ----------------------------------------------------------------------------

;

; AutoIt Version: 3.2.10.0

; Author: Thorsten Meger

;

; Script Function:

; Organize Includes Version 3.1

;

; ----------------------------------------------------------------------------

;Opt("TrayIconDebug", 1)

Opt("WinSearchChildren", 1)

;[includes]

Global $start_T = TimerInit()

#cs

* Pr

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

Link to comment
Share on other sites

Thanks Mega, some good improvements.

But there is still a problem with the script I sent you (AutoMonitDB.au3). OI says that I don't need GuiScrollbars.au3 but I do.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Thanks Mega, some good improvements.

But there is still a problem with the script I sent you (AutoMonitDB.au3). OI says that I don't need GuiScrollbars.au3 but I do.

Hi,

it works for me. Do you have GuiScrollbars.au3 in the folder to check for? Is the GuiScrollbars.au3 listed in the include.ini?

GUIScrollbars.au3=_GUIScrollBars_Init;MY_WM_SIZE;MY_WM_HSCROLL;MY_WM_VSCROLL;_GUIScrollBars_Enable;_

GUIScrollBars_Show;_GUIScrollBars_SetPos;_GUIScrollBars_SetRange;_GUIScrollBars_GetRange;_DebugPrint

Besides, there are functionnames in the GuiScrollbars.au3 that might be double in other udfs like MY_WM_SIZE. This might cause some trouble later on.

@icadea: Thanks, but I guess this is never going to happen. :)

So long,

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

Link to comment
Share on other sites

Why is it telling my I need ProSpeed.au3 when my program has no reason for it what so ever :)

Hi,

which version of Organize Includes did you try? Try the latest and it will output in Scite why the includes are needed.

Like this:

_GUICtrlComboBox_FindString from GuiComboBox.au3 found

_GUICtrlListView_DeleteAllItems from GuiListView.au3 found

_IsPressed from Misc.au3 found

GUICreate from GUIConstants.au3 found

_GUIScrollBars_Init from GUIScrollbars.au3 found

_MemoryOpen from NomadMemory.au3 found

So long,

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

Link to comment
Share on other sites

_ArrayDisplay from Array.au3 found

_FileCreate from File.au3 found

_GUICtrlEdit_AppendText from GuiEdit.au3 found

_GUICtrlListView_Create from GuiListView.au3 found

_GUICtrlStatusBar_Create from GuiStatusBar.au3 found

Grey from Prospeed.au3 found

GUICreate from GUIConstants.au3 found

Grey? I don't even use it in a function, its in a comment.
Link to comment
Share on other sites

Hi,

can you pm me your testscript with the needed includes please. So I can have a look at it.

Thanks!

So long,

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

Link to comment
Share on other sites

Hi,

ah okay. Thanks for feedback!!!

I fixed the pattern.

So long,

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

Link to comment
Share on other sites

Hi,

it works for me. Do you have GuiScrollbars.au3 in the folder to check for? Is the GuiScrollbars.au3 listed in the include.ini?

GUIScrollbars.au3=_GUIScrollBars_Init;MY_WM_SIZE;MY_WM_HSCROLL;MY_WM_VSCROLL;_GUIScrollBars_Enable;_

GUIScrollBars_Show;_GUIScrollBars_SetPos;_GUIScrollBars_SetRange;_GUIScrollBars_GetRange;_DebugPrint

I have GuiScrollbars in the foder with my script, but I also have a copy in my Includes folder.

In the ini file I get this

GUIScrollbars.au3=_InitScrollDimensions;MY_WM_CREATE;MY_WM_SIZE;MY_WM_VSCROLL;MY_WM_HSCROLL;_EnableS

crollBar;_ShowScrollBar;_SetScrollPos;_SetScrollRange;_GetScrollRange;_DebugPrint

I don't think there can be other places where there is MY_WM_SIZE or I would get errors when I ran the script.

If I rename MY_WM_SIZE to XMY_WM_SIZE in my script and in the GuiScrollBar.au3 file I still get told the file isn't needed.

ANy ideas?

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I have GuiScrollbars in the foder with my script, but I also have a copy in my Includes folder.

In the ini file I get this

GUIScrollbars.au3=_InitScrollDimensions;MY_WM_CREATE;MY_WM_SIZE;MY_WM_VSCROLL;MY_WM_HSCROLL;_EnableS

crollBar;_ShowScrollBar;_SetScrollPos;_SetScrollRange;_GetScrollRange;_DebugPrint

I don't think there can be other places where there is MY_WM_SIZE or I would get errors when I ran the script.

If I rename MY_WM_SIZE to XMY_WM_SIZE in my script and in the GuiScrollBar.au3 file I still get told the file isn't needed.

ANy ideas?

HI,

yes I got an idea and I think it is also the solution. :P

Your two GuiScrollBar.au3 files are different. Look at the found funcs.

Wrong (I think old version)

GUIScrollbars.au3=_InitScrollDimensions;MY_WM_CREATE;MY_WM_SIZE;MY_WM_VSCROLL;MY_WM_HSCROLL;_EnableS

crollBar;_ShowScrollBar;_SetScrollPos;_SetScrollRange;_GetScrollRange;_DebugPrint

Right version (The file you gave me)

GUIScrollbars.au3=_GUIScrollBars_Init;MY_WM_SIZE;MY_WM_HSCROLL;MY_WM_VSCROLL;_GUIScrollBars_Enable;_

GUIScrollBars_Show;_GUIScrollBars_SetPos;_GUIScrollBars_SetRange;_GUIScrollBars_GetRange;_DebugPrint

You are using _GUIScrollBars_Init which is only in one of your GuiScrollBar.au3 files.

The other point MY_WM_SIZE to XMY_WM_SIZE

You do not need to rename the func. What I meant was that e.g. Gary adds to his udfs often the func _DebugPrint. When there are many different udfs in your include folder which OI investigates and all of them contain the func _DebugPrint then this is listed in includes.ini. If you now use the func _DebugPrint then OI would think you need all the includes files which contain this function. Clear??? :)

So long,

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

Link to comment
Share on other sites

HI,

yes I got an idea and I think it is also the solution. :P

Your two GuiScrollBar.au3 files are different. Look at the found funcs.

Wrong (I think old version)

GUIScrollbars.au3=_InitScrollDimensions;MY_WM_CREATE;MY_WM_SIZE;MY_WM_VSCROLL;MY_WM_HSCROLL;_EnableS

crollBar;_ShowScrollBar;_SetScrollPos;_SetScrollRange;_GetScrollRange;_DebugPrint

Right version (The file you gave me)

GUIScrollbars.au3=_GUIScrollBars_Init;MY_WM_SIZE;MY_WM_HSCROLL;MY_WM_VSCROLL;_GUIScrollBars_Enable;_

GUIScrollBars_Show;_GUIScrollBars_SetPos;_GUIScrollBars_SetRange;_GUIScrollBars_GetRange;_DebugPrint

You are using _GUIScrollBars_Init which is only in one of your GuiScrollBar.au3 files.

The other point MY_WM_SIZE to XMY_WM_SIZE

You do not need to rename the func. What I meant was that e.g. Gary adds to his udfs often the func _DebugPrint. When there are many different udfs in your include folder which OI investigates and all of them contain the func _DebugPrint then this is listed in includes.ini. If you now use the func _DebugPrint then OI would think you need all the includes files which contain this function. Clear??? :)

So long,

Mega

I don't think you are quite right.

The GuiScrollbars I sent you is the one I use and it is in my script directory. In my script I have

#include "GUIScrollBars.au3"

so I expect that the one in my script directory will be used, but it looks like OI is looking at the one in my includes folder.

Actaully it is the one used or my script wouldn't work. OI looks at the include file (the wrong one in this case) and says none of the functions in this include file are used in the script so the include file is not needed.

I understand what you are saying about MY_WM_SIZE. I only renamed it as a temporary test to see if it made any difference to the OI result, because that way there would only be one file where the function would be found, i.e. in the guiscrollbars.au3 in the script dir. But OI still said it wasn't needed even though there was a function referred to which only occurs in that file.

Is it because OI misses references to functions in GuiRegisterMsg? There are 2 of these in my script-

GUIRegisterMsg($WM_VSCROLL, "MY_WM_VSCROLL");< is OI missing these functions??

GUIRegisterMsg($WM_HSCROLL, "MY_WM_HSCROLL")

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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...