It is currently Tue Jun 18, 2019 10:00 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: PureAutoIt - Complete Autoit Functions In Purebasic
PostPosted: Sat Jul 02, 2016 5:15 am 
Offline
User
User

Joined: Mon Mar 20, 2006 8:44 am
Posts: 13
The Features:
  • PureBasic version of following AutoIt functions:
    • Environment functions
    • File, Directory and Disk functions
    • Graphic and Sound functions
    • Keyboard functions
    • Message Boxes and Dialogs functions
    • Misc. functions (non-complete)
    • Mouse functions
    • Process functions (non-complete)
    • Registry functions
    • String functions
    • Timer and Delay functions
    • Window functions (include controls functions)
    • AutoIt macros
  • Window and control related functions is fully AutoIt-compatible.
    (Include options of WinTitleMatchMode, WinSearchChildren, WinDetectHiddenText,
    and full support of "Advanced Window Descriptions".)

  • Syntax for Send(), ControlSend() and HotKeySet() is fully AutoIt-compatible.
    (Include all send command, related options, and SendKeepActive() function.)

  • File read/write functions can detect different text encoding automaticly.
    Following encoding are supported: Unicode/UTF8/Ascii with or without BOM.
    (MemoryStringFormat() can detect more encoding.)

  • High speed string functions wrote in C source.
  • Easy to use StringRegExpReplace() function with PHP style back-references.
  • Thread safety. All dialog functions can create dialog from child thread.
  • OnAutoItExitRegister/OnAutoItExitUnRegister to realize atexit for PureBasic.
  • Assembly optimizer to strip unused procedures, strings, and externs.
    (Not yet ready, I will publish it in next release.)

Attention matters:
  • This is only a BETA VERSION, use on your own risk

  • The library is developed under windows 10, x86 compiler, unicode mode.
    Some functions may not work correctly in different environment.
    If you have any problems, please report it.
    I hope it finally supports all windows version and all mode what PureBasic supported.

  • Macros are PureBasic procedures with underline prefix.
    For example: _Error(), _Extended(), _MyDocumentsDir()

  • See the AutoIt document to know how to use the functions and macros, for example:
    _Error() and _Extended() will return what the document says.
    _HotKeyPressed() only works under HotKeySet() callback function.
    _ExitCode() only works under OnAutoItExitRegister() callback function.

  • FileRead(), FileWrite(), FileWriteLine() like AutoIt, accept file handle or filename.
    So FileOpen() actually return a "string" file handle.
    Don't mix it with PureBasic built-in file command.

  • FileReadBinary() And HexToMemory() return a memory buffer if *buffer = 0.
    The memory buffer must be freed with FreeMemory().

  • Some AutoIt function return an array, but PureBasic cann't.
    In PureAutoIt, it return comma separated string for position or size.
    e.g. WinGetPos(), WinGetClientSize(), etc.
    For others, it accept one extra parameter to return Array or List.
    e.g. FileReadToArray(), WinList(), etc.

  • Some AutoIt function use function name as callback parameter.
    For example, HotKeySet(), AdlibRegister(), OnAutoItExitRegister(), etc.
    In these functions, you must pass procedure address like @ProcedureName().

  • StringRegExp return different result accroding to flag.
    So I split it into 5 different procedures (StringRegExp0 ~ StringRegExp4).

  • Set #PureAutoIt_EnableRegExp to 0 can reduce to output size.
    (In this case, REGEXPTITLE and REGEXPCLASS are not supported.)

To do:
  • Check all function works under x64.
  • The document for PureAutoIt is not yet completed...

Download


Top
 Profile  
Reply with quote  
 Post subject: Re: PureAutoIt - Complete Autoit Functions In Purebasic
PostPosted: Sat Jul 02, 2016 5:36 am 
Offline
Addict
Addict
User avatar

Joined: Mon Oct 26, 2015 2:55 am
Posts: 904
Location: UA
Thanks, looks interesting and might be used to greatly power-up Purebasic as language for simple scripts on Windows.
Going to test it when will be matching case.

PS. Did you ported whole AutoIt? And what those .obj files doing?

_________________
Dreamness

Like a copyleft notify: all the source code created by me and posted on Purebasic official forums is free to use and modification in all possible (and several impossible) ways for anyone, without asking my permission


Top
 Profile  
Reply with quote  
 Post subject: Re: PureAutoIt - Complete Autoit Functions In Purebasic
PostPosted: Sat Jul 02, 2016 6:03 am 
Offline
User
User

Joined: Mon Mar 20, 2006 8:44 am
Posts: 13
Lunasole wrote:
Thanks, looks interesting and might be used to greatly power-up Purebasic as language for simple scripts on Windows.
Going to test it when will be matching case.

PS. Did you ported whole AutoIt? And what those .obj files doing?


Not yet whole AutoIt, but almost.
The obj files contain the optimized string and hash functions used in PureAutoIt (by ImportC command).


Top
 Profile  
Reply with quote  
 Post subject: Re: PureAutoIt - Complete Autoit Functions In Purebasic
PostPosted: Sat Jul 02, 2016 7:40 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Jul 09, 2007 4:47 pm
Posts: 214
Location: Courthouse
Thanks for sharing.

Process_Memory_Counters structure is unnecessary (In windows - PB5.42)

Nice utility functions.


Top
 Profile  
Reply with quote  
 Post subject: Re: PureAutoIt - Complete Autoit Functions In Purebasic
PostPosted: Sun Jul 03, 2016 7:01 am 
Offline
Addict
Addict
User avatar

Joined: Mon Oct 26, 2015 2:55 am
Posts: 904
Location: UA
ward wrote:
Not yet whole AutoIt, but almost.
The obj files contain the optimized string and hash functions used in PureAutoIt (by ImportC command).


(I've posted some stupid questions before fall asleep ^^)
From beginning I didn't look code and thought it is just a kind of bindings to autoit binaries and surprised that it is source code port. Nicely done man, thanks again.

_________________
Dreamness

Like a copyleft notify: all the source code created by me and posted on Purebasic official forums is free to use and modification in all possible (and several impossible) ways for anyone, without asking my permission


Top
 Profile  
Reply with quote  
 Post subject: Re: PureAutoIt - Complete Autoit Functions In Purebasic
PostPosted: Tue Jul 05, 2016 3:10 am 
Offline
User
User

Joined: Wed May 13, 2009 8:38 am
Posts: 84
Location: Arizona, USA
Very Nice :D
Thank You for sharing.


Top
 Profile  
Reply with quote  
 Post subject: Re: PureAutoIt - Complete Autoit Functions In Purebasic
PostPosted: Fri Sep 09, 2016 6:20 am 
Offline
User
User

Joined: Mon Dec 24, 2012 9:07 am
Posts: 33
Location: Ukraine, Donetck
Very cool work!
I can not compile all examples, it's have many bugs in PureAutoIt.pbi

Testing on Windows XP x86, PB 5.50.

_________________
Sory my bad english


Top
 Profile  
Reply with quote  
 Post subject: Re: PureAutoIt - Complete Autoit Functions In Purebasic
PostPosted: Fri Sep 09, 2016 7:04 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 06, 2005 2:35 pm
Posts: 1212
Location: germany
Sorry, I did not fully understand. Is this to run AutoIt scripts from within my PureBasic program (like a script interpreter to define Macros like VB in Office) or is this an enhancement to PB to offer AutoIt function syntax in my PB sourcecode (like a PB language extension)?


Top
 Profile  
Reply with quote  
 Post subject: Re: PureAutoIt - Complete Autoit Functions In Purebasic
PostPosted: Fri Sep 09, 2016 5:40 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Dec 21, 2015 8:12 pm
Posts: 136
Thanks a lot ward!
Wish I had this a couple year earlier, when I ported all my program from Autoit to PureBasic.

@Kukulkan
It's a collection of very many Autoit v3 functions ported to PureBasic, which makes it much easy for Autoit users to switch to PureBasic.


Top
 Profile  
Reply with quote  
 Post subject: Re: PureAutoIt - Complete Autoit Functions In Purebasic
PostPosted: Fri Sep 09, 2016 9:44 pm 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 5807
Location: Wales, UK
Huge work ward, thankyou for sharing.
Simulated keystrokes, mouse movement and COM support. Could be very useful.

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: PureAutoIt - Complete Autoit Functions In Purebasic
PostPosted: Tue Sep 13, 2016 10:29 am 
Offline
Addict
Addict
User avatar

Joined: Sun Nov 05, 2006 11:42 pm
Posts: 4453
Location: Lyon - France
I try two examples (Macros.pb and InputBox.pb) of this splendid code under W7 X86 v5.50
I don't know if it's just me, but i have the error "Already declared"
Code:
    Structure PROCESS_MEMORY_COUNTERS
      cb.l
      PageFaultCount.l
      PeakWorkingSetSize.i
      WorkingSetSize.i
      QuotaPeakPagedPoolUsage.i
      QuotaPagedPoolUsage.i
      QuotaPeakNonPagedPoolUsage.i
      QuotaNonPagedPoolUsage.i
      PagefileUsage.i
      PeakPagefileUsage.i
    EndStructure

After have commented the structure, i have the error line "UseModule PureAutoIt" :|
Debugger wrote:
The constant of module public declared "#FILE_BEGIN" is declared in global scope

And here, i don't know how fix it :oops:

_________________
ImageThe happiness is a road...
Not a destination


Top
 Profile  
Reply with quote  
 Post subject: Re: PureAutoIt - Complete Autoit Functions In Purebasic
PostPosted: Tue Sep 13, 2016 10:43 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Dec 21, 2015 8:12 pm
Posts: 136
Hi KCC,

used Defined() to solve these problems.

Code:
CompilerIf Defined(PROCESS_MEMORY_COUNTERS, #PB_Structure) = #False
 
  Structure PROCESS_MEMORY_COUNTERS
    cb.l
    PageFaultCount.l
    PeakWorkingSetSize.i
    WorkingSetSize.i
    QuotaPeakPagedPoolUsage.i
    QuotaPagedPoolUsage.i
    QuotaPeakNonPagedPoolUsage.i
    QuotaNonPagedPoolUsage.i
    PagefileUsage.i
    PeakPagefileUsage.i
  EndStructure
 
CompilerEndIf


CompilerIf Defined(FILE_BEGIN, #PB_Constant) = #False
 
  Enumeration ; for FileSetPos
    #FILE_BEGIN   = 0
    #FILE_CURRENT = 1
    #FILE_END     = 2
  EndEnumeration
 
CompilerEndIf


Top
 Profile  
Reply with quote  
 Post subject: Re: PureAutoIt - Complete Autoit Functions In Purebasic
PostPosted: Thu Sep 15, 2016 9:57 pm 
Offline
User
User

Joined: Mon Mar 20, 2006 8:44 am
Posts: 13
Thanks fryquez, I will add these fix for PB 5.5 in next release.
These code were developed under PB5.4, so some constant conflict.


Top
 Profile  
Reply with quote  
 Post subject: Re: PureAutoIt - Complete Autoit Functions In Purebasic
PostPosted: Mon Sep 19, 2016 3:23 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Nov 05, 2006 11:42 pm
Posts: 4453
Location: Lyon - France
Thanks FRYQUEZ for your code 8)

Thanks too WARD for this great code 8)
After adding the Fryquez code, i have a last error line 4643 in "PureAutoIt.pbi"
PokeL(*flag, #KEY_WOW64_64KEY)
I have commented it, and that's works :wink:
W7 X86 v5.40

_________________
ImageThe happiness is a road...
Not a destination


Top
 Profile  
Reply with quote  
 Post subject: Re: PureAutoIt - Complete Autoit Functions In Purebasic
PostPosted: Thu Sep 29, 2016 10:31 am 
Offline
Enthusiast
Enthusiast

Joined: Tue Oct 14, 2014 12:09 pm
Posts: 233
Thanks WARD for this great code


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: PercivalOgg and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye