Jump to content

Expand AutoIt Using VB


Matt @ MPCS
 Share

Recommended Posts

http://www.autoitscript.com/fileman/users/public/Matt%20@%20MPCS/AU3%20-%20VB%20Framework.zip

I needed client/server functionality in my AutoIt application and couldn't use the one posted on here because I couldn't find a license for it to know if it is distributable. This example can be expanded upon to include any functionality in AutoIt that you can do in VB. The current sample starts a server using the vb app on port 1524, but the vb app has the following commands:

1. "Listen"

Args: Port

Description: Open a server on the specified port.

2. "Open"

Args: Remote Server, Remote Port

Description: Opens a connection to the remote server on the remote port

3. "Get State"

Args: NONE

Description: Sets return box to the current socket state (see Winsock docs for description)

4. "Get Error"

Args: NONE

Description: Sets return box equal to the current error description

5. "Send"

Args: Text to send

Description: Sends text to remote server, requires open prior to this command

6. "Close"

Args: NONE

Description: Closes the current winsock connection (both after listen and open)

If an unrecognised command is passed it echos it. Arguments are delimited by the pipe"|" or Linefeed "@LF". The VB project used to create the sample "test.exe" is included in the "TestProj" folder. I am willing to take any suggestions about the sample, but I will not add more functionality to the test.exe... the code is provided do it yourself.

Ext.au3 contains the functions used to communicate with the external application.

Sample.au3 contains the code for starting a server.

Ext.au3 can be used to connect to virtually ANY external application you create that contains the proper textboxes. This means this works with any language you can create forms with.

I have not created any documentation regarding this so if you need help let me know and I will walk you through it (unless it is already stated in this post).

I think thats all I have to say.

*** Matt @ MPCS

EDIT: Updated link with name change.

Edited by Matt @ MPCS
Link to comment
Share on other sites

You have had a lot of good ideas as of late.

<{POST_SNAPBACK}>

What does that mean? Is it english? I recognize the words but they don't make sense in that order. I don't know if I should thank you or slap you!?!

*** Matt @ MPCS

Link to comment
Share on other sites

After some of the comments he has posted here there is no amount of uselessly complex speech that could make him sound intelligent.

BTW: thanks for the translation

*** Matt @ MPCS

Edited by Matt @ MPCS
Link to comment
Share on other sites

It is not proper english. The words make sense if you break it down, but the words stated in their current form are not in the right order and could be simplified. It would have been easier to read if you sould have just said, "You have had a lot of good ideas lately." This would be the reduced, simplified, proper way to say what you were after.

*** matt @ MPCS

Link to comment
Share on other sites

Matt, I'm afraid you are wrong... His sentence was proper English and quite frankly very easy to understand. It could be argued that a comma should appear after the word "ideas", but I don't think the absence of a comma renders the sentence unreadable. I don't know what you're on about in this case. I'm of the opinion he shouldn't be treated like a moron if he's not acting (being?) one, and in this case, he wasn't. Your "simplified, proper way" is only simplified, not proper-fied. If his was wrong, then yours is equally as wrong in less words.

Link to comment
Share on other sites

I don't believe I have ever heard anyone ever say (verbally):

You have had a lot of good ideas as of late.

that is why it doesn't make sense to me. There is no voice to that quote whatsoever, this makes it hard to read. I am not an English teacher and you may be right, but I stand by my correction as it makes more sense to me. I might be wrong, and if I am I aplogize for being a jerk.

*** Matt @ MPCS

Link to comment
Share on other sites

help?

when I click on the "find it here", I get a file "AU3- VB Framework.txt" opened in Notepad which looks like this

(first 5 lines)

PK Pqb1

)Z( » Ext.au3­UQkÛ0~/ô?Æò2ØÛ±ÍMº@C! ôq¸öµ1³¥`×<ìÇïtR,9³[ ÝwºûôÝé|ST/Ó°ëº@L{ºÁÇöÙ.רò¤Êýæ{mGR«VYë

³?§ÚÆ®gu­ëËËû]AôP¨MA%.SʶKc4Opmæ­Ê`¶§_U°k<Ûã¼(ÃFr×YÙ­

îÉnm6¿OtU¥*÷¦ÚV¨È[óH+»½oi×°p6[C ~

I also selected the link separately from another machine using the address http://www.autoitscript.com/fileman/users/public/Matt%20@%20MPCS/

(2nd link)

same results, get a file which looks like the above in Notepad

Edited by AutoIt
Link to comment
Share on other sites

The file linked is a ZIP archive. Rename the file to .ZIP and open it using an application that understands ZIP compression (e.g. WinZip, WinRAR, PKZip, 7Zip). You are viewing the garbage of a compression archive.

*** Matt @ MPCS

ALSO: If you see that garbage in the browser, Right-click the file and select SaveAs... and save the ZIP archive to a place on your disk.

Edited by Matt @ MPCS
Link to comment
Share on other sites

The file has a zip extension, I just took the extension off the "filename" field when I uploaded it to the AutoIt FTP site. When I click the link it still tries to DL it as a ZIP archive. I don't know what is wrong with it when AtoIt DL's the file. It works for me. Try it and let me know what happens to you.

*** Matt @ MPCS

Link to comment
Share on other sites

That's exactly what I mean. No browser can tell the mime type and download the file correctly if the file on the server (uploaded) does not have the correct extension. You should re-add the extension to the uploaded file.

Who else would I be?
Link to comment
Share on other sites

If the link didn't have the extension, but the file did, the link wouldn't be pointing to the file. When trying to follow the link, you would get a 404 error. The file simply doesn't have an extension. And both the file and the working link demonstrate this.

Link to comment
Share on other sites

Alright well I changed it. I still don't know why it didn't work for others but it still worked on ALL of my machines independently. When you use the IPB file uploader you choose a "Local File" (in this case it was a *.zip) and a "Filename" (which i took the '.zip' extension off). Hopefully it works better for everyone else.

*** Matt @ MPCS

Link to comment
Share on other sites

I apologize for not grasping this in all of its simplicity, but I still go back to why does it work on all of my machines but it doesn't on someone elses? When I click on the link I get the DL dialog that states the name of the LOCAL file that was specified and not the name I placed in the "filename" field? Must just be one of those anomilies.

*** Matt @ MPCS

Link to comment
Share on other sites

  • Administrators

I apologize for not grasping this in all of its simplicity, but I still go back to why does it work on all of my machines but it doesn't on someone elses? When I click on the link I get the DL dialog that states the name of the LOCAL file that was specified and not the name I placed in the "filename" field? Must just be one of those anomilies.

*** Matt @ MPCS

No idea. The file uploader isn't anything special - it calls the file on the disk whatever you tell it to. There is no database or anything that maps physical filenames to what you specified in the dialog. After it is uploaded the "filemanager" part is never used by anyone downloading it (it literally sits in a directory on the web server like any other file). No zip extension means no worky. I could download it OK but I had to manually add the zip extension back on afterwards of course.

Maybe you have a download manager or something that sees the magic bytes in the header and assumes it is a zip file?

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