Jump to content

How to use Autoit UDF in vbscript


marcianopro
 Share

Recommended Posts

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

Link to comment
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.

Link to comment
Share on other sites

  • Moderators

*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.

Link to comment
Share on other sites

  • 3 months later...

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/

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...