Jump to content

Success! Newbie


Recommended Posts

I've had a little success in my first expeience with scripting or anything like it and zero background. As they say I suppose, even a blind squirrel can find... Experts might find a newbie's experience and perspective interesting, and I would like to ask for a little help.

After many hours of trial & error I created a very small and simple script that solves a major problem with the way Mailwasher by Firetrust works. Mailwasher is a spam screening program that delets unwanted messages from the server before downloading what's left with a normal e-mail program. Mailwasher has options to check mail by a schedule or an interval, and to "Dialup when mail is checked". There are entries for the appropriate dialup connection, etc. which it will do if the "Check Mail" button is manually cliked. However it will not dialup and run it's mail check in response to it's schedule or interval function. It just sets there like a grinning dunce and tells you there was no internet connection. No kidding? Duh. :idiot: If you can afford only one phone line and you are away from your home or office for long periods of time when you need to be able to recieve messages with your telephone answering machine this is a major problem. If I'm away for a few days or a week I return to 3-4,000 messages %99 spam and the server kicking back messages due to lack of space. Why Firetrust hasn't simply tied thier schedule/interval function to their dialup function is beyond me. And this is a paid-for program! Request any sort of support and they refer you to a forum (CastleCops), probably because they're too cheap to hire some guy in India named "Bill" to answer the phone. Needless to say my opinion of Firetrust is that they are, to be polite, asleep at the wheel. :D Anway, that's the scenario.

So here is what I came up with: I disabled Mailwasher's option to "Load Mailwasher on Startup", removed it from the Windows "Startup" folder, and took advantage of it's option to "Perform default mail check on startup". Because it won't disconnect a dialup connection it made with the manual check I had to deal with that also to keep my phone line from being tied up. The solution, using AutoIt3 was to start Mailwasher, resulting in a mail check, put the script in Sleep long enough for the average time it takes to screen messages, use the script to close Mailwasher, do MouseClicks to close the dialup connection, and put the script back in Sleep for another two hours, all in an endless loop. Damn if it doesn't work like a charm 24/7!

Beileve it or not I asked for reccommendations/looked at reviews all over the place and tried all sorts of Task Scheduling programs to do this. Only one even came close and included a dialup/disconnect function, AutoTask2000, and even that screwed up left & right. My little script runs just fine.

There is one minor bug I can live with but would be nice to fix. While Mailwasher is screening messages it occassionaly pops up an "Error" window that halts the process. The text notifies you "...experienced an internal error. You have done nothing wrong", and waits for you to click "OK" before the process will continue. No time out, nothing, just sits there stuck in the mud till you click "OK". Smooth move Firetrust -duh! I've tried all sorts of "If-Then", variables, and "WinClose", WindGetTitle" (using the ("error-") parameter), "Send({ENTER}), etc. commands on test windows. My idea is to try to close the Error window if it should come up by inserting that between two shorter Sleep periods while Mailwasher is in "Run". With the exception of "WinClose" which refuse to work on a Notepad window, none of my efforts to come up with a little "If-Then" or variable script to close a window works including finding "error" in the text like "WinGetText". A MouseClick won't work either because I can hardly force the error window to come up so I can locate the OK button with AutoSpy. I suspect that I'm simply not writing the script correctly. I've been all over the help file but it's hardly a basic tutorial and for a new guy I guess it's just not always obvious what goes where and how to write things correctly. Please be so kind as to help if you are not bored to death by now.

My itty-bitty script the entire Firetrust corporation couldn't come up with:

$i=0

Do

Run("C:\Program Files\MailWasher Pro\MailWasher.exe")

Sleep(900000) (maybe break this into two sleep periods and insert an error window close?)

ProcessClose("MailWasher.exe")

MouseClick("left",554,584,2)

Sleep(1000)

MouseClick("left",370,405,2)

Sleep(7200000)

Until $i=1

Link to comment
Share on other sites

You can put something like that at the very beginning of your script. Adjust the information as required.

AdlibEnable("GetRidOfStupidErrorMessage", 5000);check every 5 seconds

Func GetRidOfStupidErrorMessage()
   If WinActive("TitleOfWindowGoesHere") Then Send("{ENTER}")
EndFunc
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

You can put something like that at the very beginning of your script.  Adjust the information as required.

AdlibEnable("GetRidOfStupidErrorMessage", 5000);check every 5 seconds

Func GetRidOfStupidErrorMessage()
   If WinActive("TitleOfWindowGoesHere") Then Send("{ENTER}")
EndFunc

<{POST_SNAPBACK}>

CyberSlug;

Thank you, very much. LOL! I love it- Get Rid of Stupid Error Message.

I will add it to my script right away even though I don't understand it. This is the kind of thing that confuses the **** out of me as a new guy. Is this AdLibEnable make Sleep sort of a conditional thing, like sleep with one eye open? I mean how can anything do something when it's asleep? "Sleep" had implied to me that it stopped everything until the -alarm- went off. Somehow for a new guy that just doesn't -compute. It took me a while just to figure out you aren't actually supposed to use the "[" bracket symbols the Help file uses around "options" in the samples of command explanations. That was for starters.

Is there somewhere I can go for a basic tutrial in how to write script?

Again, thank you very much.

Link to comment
Share on other sites

Is there somewhere I can go for a basic tutrial in how to write script?

<{POST_SNAPBACK}>

Currently there's no tutorial for AutoIt scripting.

1. You could browse through the threads in the Support forum and Scripts and Scraps forum.

2. In the help file are many examples.

Link to comment
Share on other sites

This question comes a lot of time.

I can understand the need but I am not sure at which level we need to start from.

Clearly it looks like for some the programming basis is unknown. It is certainly true that the current help is more a reference manual than a getting started.

can somebody point good example in other application that have help you to start? :idiot:

Link to comment
Share on other sites

Currently there's no tutorial for AutoIt scripting.

1. You could browse through the threads in the Support forum and Scripts and Scraps forum.

2. In the help file are many examples.

<{POST_SNAPBACK}>

SlimShady;

Thanks for responding.

#1: I did this extensively, in both cases, and to a degree it was helpful though it was generally obvious it would be much more so if you have a basic background in syntax, I believe is the right word.

#2: I've looked at almost every one and tried to mimick them as best I could. I had some success based on the syntax? they seemed to infer. I must say I'm impressed with AutoIt for how intuitive the Help file is without addressing basics to someone who has never even seen scripting before.

jpm;

Thank you for responding and your understanding about the Help file.

Merci de répondre et de votre arrangement au sujet du dossier d'aide.

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