Sign in to follow this  
Followers 0
marcianopro

How to use Autoit UDF in vbscript

7 posts in this topic

Hi,

I am writing a script in Amibroker to do automated stock trading . Amibroker supports only vbscript and Jscript.

I have written a script in Autoit to automatically login the trading web page and place Orders. However This Autoit script uses UDFs.

I am using the AutoitX3.Control in vbscript to use the Autoit script. But my problem is that with AutoitX3, The UDFs are not working.

Is there any way I can use autoit in vbscript and also use autoit UDFs.

Needless to mention I am new to autoit as well as vbscript, but thanks to the excellent forum help, I am able to work with autoit.

Marcianopro

Share this post


Link to post
Share on other sites



You'll have to translate the UDFs to your new language. UDF sources are in your "include" folder.

Share this post


Link to post
Share on other sites

You could try compiling each UDF as an standalone executable and using arguments to call them :P


I can do signature me.

Share this post


Link to post
Share on other sites

Ivan, how is that supposed to work when using things like web page interactions? That's usually through some COM object and COM objects can't be sent through command line parameters.

Not to mention, you can't get return values from functions.

Share this post


Link to post
Share on other sites

Ivan, how is that supposed to work when using things like web page interactions? That's usually through some COM object and COM objects can't be sent through command line parameters.

Not to mention, you can't get return values from functions.

*coughs*

Ok, let's try with this.

Try to declare your functions using VB where they will use AutoIt3X

Like

Function HelloWorld()
Set oAutoIt = WScript.CreateObject("AutoItX3.Control")

oAutoIt.ToolTip("This is a tooltip", 0, 0)
oAutoIt.Sleep(2000)
oAutoIt = Nothing
End Function

I can do signature me.

Share this post


Link to post
Share on other sites

*coughs*

Ok, let's try with this.

Try to declare your functions using VB where they will use AutoIt3X

Like

Function HelloWorld()
Set oAutoIt = WScript.CreateObject("AutoItX3.Control")

oAutoIt.ToolTip("This is a tooltip", 0, 0)
oAutoIt.Sleep(2000)
oAutoIt = Nothing
End Function
*coughs*? You should be... you missed the entire point of the OP ... UDF = "User Defined Function".

@OP, The only other option you'd have other than what Richard proposed with translating them to your other language is a 2 executable communication technique. Having autoit exe communicate with your other language exe by means of maybe tcp/reading and writing to files or registry/gui communication etc...

I know that martin and I believe others have examples in the example script forum on how they do this in autoit... maybe you can apply these means to both languages to suit your needs if you don't feel like writing the autoit UDFs in this other language.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Hi,

I am writing a script in Amibroker to do automated stock trading . Amibroker supports only vbscript and Jscript.

I have written a script in Autoit to automatically login the trading web page and place Orders. However This Autoit script uses UDFs.

I am using the AutoitX3.Control in vbscript to use the Autoit script. But my problem is that with AutoitX3, The UDFs are not working.

Is there any way I can use autoit in vbscript and also use autoit UDFs.

Needless to mention I am new to autoit as well as vbscript, but thanks to the excellent forum help, I am able to work with autoit.

Marcianopro

Here is my blog with good practicle samples of AutoIt script. But I have mostly developed using INI file or SQLITE as my datasource.

http://technologyyogi.blogspot.com/

I have developed one script for automated trading as well - take a look

Let me know if you need further help. I have interest in developing script for automated trading.


------------------------------SQL DBA - AutoIt hobbyisthttp://gvphubli.blogspot.com/

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  
Followers 0