Sign in to follow this  
Followers 0
Cars0n66

just a little help is all

5 posts in this topic

#1 ·  Posted (edited)

Hello everyone I'm a noob but would appreciate your help.

What I'm doing is setting up for a auto scan with SuperAntiSpyware free edition.

There is only an option to auto scan when you start up your computer and I like to leave my computer on for days & or weeks so thats why i'm making this script.

The issue I am running into is I can scan and it finds threats, but when threats are detected or not detected there will be a message box that is different for both of them.

There is a total of 2 different message boxes that popup. What I am looking for is some code that can have all 2 options for the message boxes but if one is not present just skip it and go on to the next part of my script.

So for example when I scan my computer and find 100 threats a message box will popup and say found 100 threats push ok.

but then when it scans again it doesn't find any threats a message box will popup and say no threats detected push ok. but AutoIt is hung up waiting for the threats detected message box with my current script. I need to have it be able to skip the threats detected box and move on to the next part of the script.so it needs to do one popup box or the other and never both its one or the other.

how should I script it to just move on if the popup is not there?

here is what i need to skip or run.

; mesage boxe says no harmfull threats detected
if MsgBox("SUPERAntiSpyware","Quarantine and Removal Complet") then
ControlClick("SUPERAntiSpyware","Quarantine and Removal Complet","Button1")
sleep(100)
EndIf

This one needs to skip to this one only if no threats are detected and vise versa one or the other.

;mesage box says found threats push ok... to go to main screen (click ok to remove msgbox)
If MsgBox("SUPERAntiSpyware","Quarantine and Removal Complet") Then
ControlClick("SUPERAntiSpyware","Quarantine and Removal Complet","Button1")
sleep(100)
Edited by Cars0n66

Share this post


Link to post
Share on other sites



You need to use WinExists() instead of MsgBox() and put both options inside a loop:

While 1
    ; mesage boxe says no harmfull threats detected
    If WinExists("SUPERAntiSpyware", "Quarantine and Removal Complet") Then
        ControlClick("SUPERAntiSpyware", "Quarantine and Removal Complet", "Button1")
    EndIf
    ;mesage box says found threats push ok... to go to main screen (click ok to remove msgbox)
    If WinExists("SUPERAntiSpyware", "Quarantine and Removal Complet") Then
        ControlClick("SUPERAntiSpyware", "Quarantine and Removal Complet", "Button1")
    EndIf
    Sleep(100)
WEnd

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

;message box says no harmful threats detected
if MsgBox("SUPERAntiSpyware","Quarantine and Removal Complete") then
    ControlClick("SUPERAntiSpyware","Quarantine and Removal Complet","Button1")
    sleep(100)

;message box says found threats push ok... to go to main screen (click ok to remove msgbox)
ElseIf MsgBox("SUPERAntiSpyware","Quarantine and Removal Complete") Then
    ControlClick("SUPERAntiSpyware","Quarantine and Removal Complete","Button1")
    sleep(100)

Else
    
EndIf

That should do it :x

Just put in whatever you require if needed to do so.

However, IMHO you should NEVER automate Virus Scanning.

shanet

Edited by shanet

[font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

Share this post


Link to post
Share on other sites

Thank you very much Mass Spammer, and shanet! :P your the man I mean women. :x

I was totally looking in the wrong places I was looking at the ,variables, do, & functions.

This is what exactly I was looking for and I do commend you both on your speedy responses!

However, IMHO you should NEVER automate Virus Scanning

If I can ask Shanet what is your professional reason for condoning the automation of virus scanning?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

If I can ask Shanet what is your professional reason for condoning the automation of virus scanning?

Your welcome :x

I wouldnt really say 'professional' as such, rather more common sense (which is not that common).

Basically, if there is a virus alert, you should know about it. That way, you have a better knowledge of what is happening on your system.

shanet

Edited by shanet

[font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

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