Jump to content

Can AutoIt do this?


Recommended Posts

I have yet to learn AutoIt because so far I've been able to accomplish everything I need to do through VBscript and repackaging/direct .msi editing. But this one has me stumped:

I have repacked SpywareBlaster into an msi file and it has the latest updates that were available at the time I made the custom package, but obviously it would be nice to automate an update at the time of OS installation. I don't want to schedule auto updates to run regularly because I get the feeling this would violate the EULA. Just a one time update so that when my OS install is complete.. it's complete.

SpywareBlaster uses a non-standard interface. I believe it is mandatory that you use a pointing device in order to use this application. I have been unable to find any way to navigate via the keyboard. One can only assume this was done on purpose so that they can sell subscriptions to the auto update service. So can AutoIt manipulate this kind of application?

I have nothing against AutoIt, but I don't want to spend a day or two checking it out only to find it can't do this one task - which is all I would ever really need it for. So I'm just wondering if anyone knows the answer off the top of their head.

Thanks.

Link to comment
Share on other sites


hmmm.. sounds like it would be dependant upon the screen resolution maybe? Like the coordinates would be different on an 800x600 than on a 1024x768 screen. Or is it coordinates based on the open window itself? If that's the case then maybe I will break down and figure this thing out.

Link to comment
Share on other sites

It can do either.

CaretCoordMode = 0 - relative coords to the active window
CaretCoordMode = 1 - absolute screen coordinates (default)
CaretCoordMode = 2 - relative coords to the client area of the active window

AutoIt is extremely easy to learn, and the help file is excellent. I basically sat down and wrote my own program selection screen (like WPI), complete with .ini file reads, file log, and a purty, customizable interface, without ever having used this language before.

Link to comment
Share on other sites

AutoIt is extremely easy to learn, and the help file is excellent.  I basically sat down and wrote my own program selection screen (like WPI), complete with .ini file reads, file log, and a purty, customizable interface, without ever having used this language before.

Ok you've inspired me :thumbup

Now my wife :realmad: is really gonna kill me. One more thing to take up my time :whistle:

Link to comment
Share on other sites

You maybe right RogueSpear. It is a strange program to navigate. I tried some VBScript sendkeys, but kept getting mixed results. I did not have much like with AutoIt to directly operate the controls. Using the mouse, as you stated, may do this for you.

AutoIt can work by screen, window or client window coordinates. So this is could be achieved.

urie supplies a link the a customized version of Scite, which has all the onboard tools to help. Check the AU3Recorder in the tools menu.

AutoIt Download page (Scite4AutoIt3 link is also on the page, just look down the page)

You may want to look at this sometime. If you are good with VBScript, then the Com features would of some interest?

AutoIt Beta Download page (this has Com, ActiveX, and latest additions, Scite4AutoIt3 can support both release and beta versions installed, at the same time)

You can use VBScript as your primary language, but nothing wrong with a little AutoIt, to fill the gaps. ;)

Link to comment
Share on other sites

  • 1 month later...

Ok I finally decided to sit down and get comfy with AutoIt. What an id*** I am for waiting so long, but you know when you got a million other things on your plate something just has to give. Well I'm on vacation this week so what do I do? Lol, I learn a new scripting language. Still don't quite have this SpywareBlaster down yet. I'm trying the whole CaretCoord thing as mentioned above. I'll post my findings shortly..

Link to comment
Share on other sites

Ok I finally decided to sit down and get comfy with AutoIt.  What an id*** I am for waiting so long, but you know when you got a million other things on your plate something just has to give.  Well I'm on vacation this week so what do I do?  Lol, I learn a new scripting language.  Still don't quite have this SpywareBlaster down yet.  I'm trying the whole CaretCoord thing as mentioned above.  I'll post my findings shortly..

Think you'll find it to be excellent. I'm certainly sold on usin it on my tricky ua software installs.

Good Luck.

Edited by MAVERICKS CHOICE
Link to comment
Share on other sites

Well if I have any advice to give it would be to make sure you don't have WindowBlinds or any other OS skinning app running. A lot of my first scripts ended up using a lot of "Send" commands...which I think is horid and very prone to fail.

I'm still just a beginner my self...my coding style changes a lot over time...still need to go back and redo a lot of scripts...if for no other reason than to serve as better examples of how to write install scripts.

Link to comment
Share on other sites

Ok guys.. I'm not getting anywhere with this. The mouse seems to be moving relative to the screen rather than relative to the window even though I've set it for window mode. Mind you, I'm an AutoIt noob, but I've been coding for a while now. Take a look at the code and see if I'm doing something totally wrong. I'd appreciate it. I know there's a redundancy in the beginning of the script, but I was basically flailing in the wind trying anything.

AutoItSetOption ("CaretCoordMode", 0)
WinMinimizeAll()
Run("C:\Program Files\Security\SpywareBlaster\spywareblaster.exe")
WinWaitActive("SpywareBlaster")
WinActivate("SpywareBlaster")
Sleep(5000)
MouseClick("left", 65, 371)
MouseClick("left", 381, 395)
Sleep(10000)
MouseClick("left", 65, 131)
MouseClick("left", 187, 363)
Sleep(5000)
WinClose("SpywareBlaster")

Link to comment
Share on other sites

Your welcome...another tip...instead of:

MouseClick("left", 65, 371)

Use

MouseClick("left", 65, 371, 1, 1)

Hehe makes the mouse haul a**. :)

Also

WinWaitActive("SpywareBlaster")

WinActivate("SpywareBlaster")

Sleep(5000)

As you have already said...there is redundancy in the script by activating a window that is already active...so secondline there is not needed....also...if its possible get rid of the sleep statements. Do this by checking to see if there is different visable text some where on the following window thats different from the prior.

WinWait("SpywareBlaster", "Bob")

...

WinWait("SpywareBlaster", "mark")

Now the above winwaits are different windows...so long as "mark" wasn't on the winwait that was looking for "bob"

If that fails...you could test to see if it refresh's the window title per window...if so...you could rename the first window's title to some thing else, example:

WinWait("SpywareBlaster")

WinSetTitle ( "SpywareBlaster", "", "Old Window" )

....

WinWait("SpywareBlaster")

....

Or

WinWait("SpywareBlaster")

WinSetTitle ( "SpywareBlaster", "", "Old Window" )

....

WinWaitClose("Old Window" )

...

Any ways a few ideas to play with

** Update **

Also its a good idea not to hard code paths if possible.

Run("C:\Program Files\Security\SpywareBlaster\spywareblaster.exe")

Would be better written like so:

Run( @ProgramFilesDir & "\Security\SpywareBlaster\spywareblaster.exe" )

That way should "Program Files" be set else where than C:\ the script would not fail

Edited by Nologic
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...