Mosquitos Posted January 11, 2006 Share Posted January 11, 2006 You can try hitmanpro to see what it does so you can make your own program.Its also written in autoit.http://www.hitmanpro.nl/ Sapiente vince, rex, noli vincere ferro! Link to comment Share on other sites More sharing options...
setirich Posted January 11, 2006 Share Posted January 11, 2006 Scripting AdAware Thoughts: 1.) AdAware (the free version) is written to make automatic scripting or programatic operation very difficult. They want you to buy the scriptable or automated version. 2.) RunWait is probably the command most folks are talking about that would work best BUT (see #3) 3.) You probably will have to use the Run command, and then react to various events within the hidden window area of AdAware. It will take a lot of effort and experimentation to make this work. 4.) Become familiar with the AutoIt Windows Information Tool, and maybe some other spy tools like Winspector Spy to find out what's going on inside this program. 5.) Have a lot of patience and try a bunch of different machines for testing. Good Luck! Good intentions will always be pleaded for every assumption of authority. It is hardly too strong to say that the Constitution was made to guard the people against the dangers of good intentions. There are men in all ages who mean to govern well, but they mean to govern. They promise to be good masters, but they mean to be masters.-Daniel Webster Link to comment Share on other sites More sharing options...
PcExpert Posted January 11, 2006 Author Share Posted January 11, 2006 Thanks for your help. I've already tried to decompile hitman pro to a au3 file. But is asks for a password. So I can't get to know what hitman pro does to let the program take a break. Link to comment Share on other sites More sharing options...
PcExpert Posted January 11, 2006 Author Share Posted January 11, 2006 Thank you for you fast reply. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 11, 2006 Moderators Share Posted January 11, 2006 (edited) Ok, I must be REEEEEEEEEEEEEEEEAAAAAAAAALLLLY BORED, and I shouldn't be because I've got 17,000 more lines to code of my own program... I have never used Adaware before, so I went ahead and downloaded it because I've heard some talk on here for it. Talk about a pain in the Ass!! I'm not sure this will work on every computer, I've found that the Standard Font for Europe OS(s) are different than that of US OS(s) and I don't know how to compensate or even change that (Up for ideas if anyone has any). Anyway... I think I did all the 'Hard Work'. Just run the code as is... I didn't comment the lines, but I tried to use Variable names that you or anyone could understand. CODEOpt('MouseCoordMode', 2) Opt('PixelCoordMode', 2) Global $AdAwareTitle = 'Ad-Aware SE Personal' Global $AdStart = 4058524881 Global $AdNext = 704396283 Global $AdCancel = 181093911 Global $AdFinished = 2663204375 Dim $ScanChoice = '' Dim $Click = 0 Local $ScanMsgBox = MsgBox(36, 'Scan Type', 'Click Yes for Full Scan' & @CRLF & 'Click No for Smart Scan') If $ScanMsgBox = 6 Then $ScanChoice = 'TRadioButton1' Else $ScanChoice = 'TRadioButton2' EndIf If Not ProcessExists('Ad-Aware.exe') Then Run(@ProgramFilesDir & '\Lavasoft\Ad-Aware SE Personal\Ad-Aware.exe') EndIf WinWait($AdAwareTitle) While WinExists($AdAwareTitle) If Not WinActive($AdAwareTitle) Then WinActivate($AdAwareTitle) Sleep(500) Local $CheckSum = PixelChecksum(585, 346, 607, 353) If $Click = 0 Then If $CheckSum = $AdStart Then ControlClick($AdAwareTitle, '', 'TACimage16') $Click = 1 ContinueLoop EndIf EndIf If $Click = 1 Then ControlClick($AdAwareTitle, '', $ScanChoice) $Click = 2 ContinueLoop EndIf If $Click = 2 Then If $CheckSum = $AdNext Then ControlClick($AdAwareTitle, '', 'TACimage16') $Click = 3 ContinueLoop EndIf EndIf If $Click = 3 Then If $CheckSum = $AdCancel Then Do Sleep(1000) Until PixelChecksum(585, 346, 607, 353) <> $AdCancel $Click = 4 ContinueLoop EndIf EndIf If $Click = 4 Then If $CheckSum = $AdFinished Then ProcessClose('Ad-Aware.exe') Do Sleep(100) Until ProcessExists('Ad-Aware.exe') = 0 Exit Else ControlClick($AdAwareTitle, '', 'TACimage16') $Click = 5 ContinueLoop EndIf EndIf If $Click = 5 Then MouseClick('Right', 461, 162, 1, 1) MouseClick('Left', 471, 199, 1, 1) Sleep(250) ControlClick($AdAwareTitle, '', 'TACimage16') $Click = 6 ContinueLoop EndIf If $Click = 6 Then ControlClick('Ad-Aware SE', '', 853582) $Click = 7 ContinueLoop EndIf If $Click = 7 Then If $CheckSum = $AdStart Then ProcessClose('Ad-Aware.exe') Do Sleep(100) Until ProcessExists('Ad-Aware.exe') = 0 Exit EndIf EndIf ;ToolTip($Click, 0, 0) WEnd Edit: Updated a few check orders... I think there is a flaw with one of the cases if a spyware if found... But I can't duplicate (Because ADAWARE took away my spyware!! ) Edited January 11, 2006 by SmOke_N 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 More sharing options...
JSThePatriot Posted January 11, 2006 Share Posted January 11, 2006 Okay... I have automated Ad-Aware, and Spybot Search & Destroy. I cannot seem to find the script now. I will have to check a few other places. It wasnt easy, but I took care of most issues that could arise. SmOke_N seems to have a good example. Just keep in mind they did make it a pain to automate on purpose for the reason of resalability. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
ACalcutt Posted January 11, 2006 Share Posted January 11, 2006 (edited) i made a script that runs adaware...unfortunatly i dont know what i did with it, if i find it i will post it i also had trouble with adaware...bacause like you said the controls dont seem to have names. i know when it was scanning i had it try to press a button every 10 seconds..when it finished it was able to be pressed, then the script continued i know the other thing i had rouble with was waiting for the update to finish...i think i ended up matching colors in the progress bar *edit* had autoit on the mind i guess...fixed that typo Edited January 11, 2006 by ACalcutt Andrew Calcutt Http://www.Vistumbler.net Http://www.TechIdiots.net Its not an error, its a undocumented feature Link to comment Share on other sites More sharing options...
seandisanti Posted January 11, 2006 Share Posted January 11, 2006 i made a script that runs autoit...unfortunatly i dont know what i did with it, if i find it i will post itoh yeah? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 11, 2006 Moderators Share Posted January 11, 2006 i made a script that runs autoit...unfortunatly i dont know what i did with it, if i find it i will post iti also had trouble with adaware...bacause like you said the controls dont seem to have names. i know when it was scanning i had it try to press a button every 10 seconds..when it finished it was able to be pressed, then the script continuedi know the other thing i had rouble with was waiting for the update to finish...i think i ended up matching colors in the progress barI updated it... again... I used only 2 mouseclicks, those were for selecting all the files to quaranteen... those could even be avoided probably... Everthing else is done with checksum and controlclicks(). 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 More sharing options...
PcExpert Posted January 11, 2006 Author Share Posted January 11, 2006 JSThePatriot, woul'd you please search for the script. I woul'd be really happy with it. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 11, 2006 Moderators Share Posted January 11, 2006 JSThePatriot, woul'd you please search for the script. I woul'd be really happy with it.Wow.. what a smack in the face 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 More sharing options...
JSThePatriot Posted January 11, 2006 Share Posted January 11, 2006 I just got the color of the pixels that changes from when it is started to finished. That way I didnt have to click every so often. I wish I could find that script. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 11, 2006 Moderators Share Posted January 11, 2006 Did anyone even try the script I posted as stand alone? It only clicks once for every level of the screens/tabs... With using the checksums, It's kind of like an OCR, It knows If the button says 'Start' / 'Next' / 'Finished'. That should give plenty of options for you if you want to change it up to fit in your GUI. 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 More sharing options...
JSThePatriot Posted January 11, 2006 Share Posted January 11, 2006 Did anyone even try the script I posted as stand alone? It only clicks once for every level of the screens/tabs... With using the checksums, It's kind of like an OCR, It knows If the button says 'Start' / 'Next' / 'Finished'. That should give plenty of options for you if you want to change it up to fit in your GUI.I didnt try it. I did recommend that he tried it as, I know your coding abilities. Not to mention I looked over the code and it looked similiar.JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 11, 2006 Moderators Share Posted January 11, 2006 I didnt try it. I did recommend that he tried it as, I know your coding abilities. Not to mention I looked over the code and it looked similiar.JSThanks JS, that wasn't directed to you at all, I was just confused that if the code wasn't working for him (works on all 4 of my computers), on why he wouldn't state that. 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 More sharing options...
JSThePatriot Posted January 11, 2006 Share Posted January 11, 2006 Thanks JS, that wasn't directed to you at all, I was just confused that if the code wasn't working for him (works on all 4 of my computers), on why he wouldn't state that.Oh, I know, but I felt the need to re-inforce the fact that you had very good working code. (Although I hadnt tested it from everything I could see it was quite similiar to mine).JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
herewasplato Posted January 12, 2006 Share Posted January 12, 2006 Did anyone even try the script I posted as stand alone?...Maybe you could re-post your code without using the codebox tags. That tends to mess up the copy paste operation for those using IE. All of the code is on one line (no CR for each line). I went to this post via Firefox and got the code with CR but lacking any other formatting. SciTE/Tidy cleaned that up a bit.I ran the script from within SciTE and got these errors:>Running AU3Check...C:\Temp\ada-temp.au3(13,7) : ERROR: 'Local' specifier in global scope.Local $ScanMsgBox~~~~~~^C:\Temp\ada-temp.au3(29,11) : ERROR: 'Local' specifier in global scope. Local $CheckSum~~~~~~~~~~^C:\Temp\ada-temp.au3 - 2 error(s), 0 warning(s)>AU3Check Ended.I selected "Continue anyway" in the AU3Check MsgBox.I selected "Yes" from your script's first MsgBox. (Full Scan)AdAware loaded and just sat there (the script was looping).I added a MsgBox after your first PixelChecksum line.$CheckSum = 3589209702 after Ad-Aware completed loading.I'm using AutoIt 3.1.1 and Ad-Aware SE Personal Build 1.06r1 on XP SP2 with 1024x768 screen res.There is no good way to summarize my custom theme settings....but I don't want a script that automates these scansAd-Aware never finds anything "bad" on my systems.I just wanted to test IE and FF on a codebox info....but nice code layout [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
JSThePatriot Posted January 12, 2006 Share Posted January 12, 2006 Maybe you could re-post your code without using the codebox tags. That tends to mess up the copy paste operation for those using IE. All of the code is on one line (no CR for each line). I went to this post via Firefox and got the code with CR but lacking any other formatting. SciTE/Tidy cleaned that up a bit.I ran the script from within SciTE and got these errors:I selected "Continue anyway" in the AU3Check MsgBox.I selected "Yes" from your script's first MsgBox. (Full Scan)AdAware loaded and just sat there (the script was looping).I added a MsgBox after your first PixelChecksum line.$CheckSum = 3589209702 after Ad-Aware completed loading.I'm using AutoIt 3.1.1 and Ad-Aware SE Personal Build 1.06r1 on XP SP2 with 1024x768 screen res.There is no good way to summarize my custom theme settings....but I don't want a script that automates these scansAd-Aware never finds anything "bad" on my systems.I just wanted to test IE and FF on a codebox info....but nice code layoutI am glad to know that about the codebox. I have been wondering how to do that with code, but now it seems its not as good as it would have been.JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 12, 2006 Moderators Share Posted January 12, 2006 (edited) Maybe you could re-post your code without using the codebox tags. That tends to mess up the copy paste operation for those using IE. All of the code is on one line (no CR for each line). I went to this post via Firefox and got the code with CR but lacking any other formatting. SciTE/Tidy cleaned that up a bit. Yeh, I didn't know about CodeBox making it one line: expandcollapse popupOpt('MouseCoordMode', 2) Opt('PixelCoordMode', 2) Global $AdAwareTitle = 'Ad-Aware SE Personal' Global $AdStart = 4058524881 Global $AdNext = 704396283 Global $AdCancel = 181093911 Global $AdFinished = 2663204375 Dim $ScanChoice = '' Dim $Click = 0 Dim $ScanMsgBox = _MsgBox(2, 'Scan Type', 'What type of scan would you like to do?') If $ScanMsgBox = 6 Then $ScanChoice = 'TRadioButton1' Else $ScanChoice = 'TRadioButton2' EndIf If Not ProcessExists('Ad-Aware.exe') Then Run(@ProgramFilesDir & '\Lavasoft\Ad-Aware SE Personal\Ad-Aware.exe') EndIf WinWait($AdAwareTitle) While WinExists($AdAwareTitle) If Not WinActive($AdAwareTitle) Then WinActivate($AdAwareTitle) Sleep(500) Local $CheckSum = PixelChecksum(585, 346, 607, 353) If $Click = 0 Then If $CheckSum = $AdStart Then ControlClick($AdAwareTitle, '', 'TACimage16') $Click = 1 ContinueLoop EndIf EndIf If $Click = 1 Then ControlClick($AdAwareTitle, '', $ScanChoice) $Click = 2 ContinueLoop EndIf If $Click = 2 Then If $CheckSum = $AdNext Then ControlClick($AdAwareTitle, '', 'TACimage16') $Click = 3 ContinueLoop EndIf EndIf If $Click = 3 Then If $CheckSum = $AdCancel Then Do Sleep(1000) Until PixelChecksum(585, 346, 607, 353) <> $AdCancel $Click = 4 ContinueLoop EndIf EndIf If $Click = 4 Then If $CheckSum = $AdFinished Then ProcessClose('Ad-Aware.exe') Do Sleep(100) Until ProcessExists('Ad-Aware.exe') = 0 Exit Else ControlClick($AdAwareTitle, '', 'TACimage16') $Click = 5 ContinueLoop EndIf EndIf If $Click = 5 Then ControlClick($AdAwareTitle, '', 'TVirtualStringTree1', 'Right', 1) ControlSend($AdAwareTitle, '', 'TVirtualStringTree1', '{DOWN 2}' & '{ENTER}') Sleep(250) ControlClick($AdAwareTitle, '', 'TACimage16') $Click = 6 ContinueLoop EndIf If $Click = 6 Then Local $OPT = Opt('WinTitleMatchMode', 4) ControlClick('Ad-Aware SE', '', 'TACimage1') $Click = 7 Opt('WinTitleMatchMode', $OPT) ContinueLoop EndIf If $Click = 7 Then If $CheckSum = $AdStart Then ProcessClose('Ad-Aware.exe') Do Sleep(100) Until ProcessExists('Ad-Aware.exe') = 0 Exit EndIf EndIf Local $OPT = Opt('WinTitleMatchMode', 4) If ControlCommand('Ad-Aware SE', '', 'TACimage1', 'IsVisible', '') Then ControlClick('Ad-Aware SE', '', 'TACimage1') EndIf Opt('WinTitleMatchMode', $OPT) ;ToolTip($Click, 0, 0) WEnd Func _MsgBox($mb_Icon, $mb_Title, $mb_Text, $mb_Time = '') Local $StrnLenText = MsgLongestString($mb_Text) Local $NumberOfLines = (UBound(StringSplit($mb_Text, @CRLF)) - 1) * 5 Local $Button1Txt = "Full Scan" Local $Button2Txt = "Smart Scan" Local $MsgValue = 0 Local $Timer = '' $iMsgBox = GUICreate($mb_Title, $StrnLenText + 190, 100 + $NumberOfLines, -1, -1, 0x00400000, 0x00000008) GUICtrlCreateLabel($mb_Text, 60, 10) GUICtrlCreateIcon(@SystemDir & "\User32.dll", $mb_Icon, 10, 10, 35, 35) $FullScan = GUICtrlCreateButton($Button1Txt, 30 + ($StrnLenText / 2), 45 + $NumberOfLines, 60 + StringLen($Button1Txt), 25) $SmartScan = GUICtrlCreateButton($Button2Txt, 100 + ($StrnLenText / 2), 45 + $NumberOfLines, 60 + StringLen($Button2Txt), 25) GUISetState() If $mb_Time <> '' Then $Timer = TimerInit() While 1 $imsg = GUIGetMsg() Select Case $imsg = $FullScan $MsgValue = 6 ExitLoop Case $imsg = $SmartScan $MsgValue = 7 ExitLoop Case $mb_Time <> '' If TimerDiff($Timer) / 1000 >= $mb_Time Then ExitLoop EndSelect WEnd GUIDelete($iMsgBox) Return $MsgValue EndFunc Func MsgLongestString($sText) Local $sSplit = StringSplit($sText, @CRLF) Local $Times = '' If Not @error Then ArraySortByLen($sSplit) If StringLen($sSplit[1]) <= 100 Then $Times = 2.25 If StringLen($sSplit[1]) >= 101 And StringLen($sSplit[1]) <= 150 Then $Times = 2.5 If StringLen($sSplit[1]) >= 151 And StringLen($sSplit[1]) <= 201 Then $Times = 3 If StringLen($sSplit[1]) >= 202 Then $Times = 3.25 Return Round(StringLen($sSplit[1])*$Times) Else If StringLen($sText) <= 100 Then $Times = 2.25 If StringLen($sText) >= 101 And StringLen($sText) <= 150 Then $Times = 2.5 If StringLen($sText) >= 151 And StringLen($sText) <= 201 Then $Times = 3 If StringLen($sText) >= 202 Then $Times = 3.25 Return Round(StringLen($sText)*$Times) EndIf EndFunc Func ArraySortByLen(ByRef $nArray, $Start = 1) For $i = $Start To UBound($nArray) - 2 Local $SE = $i For $x = $i To UBound($nArray) - 1 If StringLen($nArray[$SE]) < StringLen($nArray[$x]) Then $SE = $x Next Local $HLD = $nArray[$i] $nArray[$i] = $nArray[$SE] $nArray[$SE] = $HLD Next EndFunc Edit: It's Close... But I have a feeling that the ControlCommand() >> 'TACimage1' is going to cause a problem, it would be better if it was able to just use the Control ID Edit2: I think I corrected the before issue using Larry's ClickInControl: ( http://www.autoitscript.com/forum/index.ph...526entry37526 ) A bit longer, but a bit more efficient (God I really need to some of my real work ) (Probably could have just used ControlClicks with WinTitleMatchMode, 4 but what fun would that be ) Edit3: Changed it with just ControlClicks(), but I still like Larrys ClickInControl() Edited January 12, 2006 by SmOke_N 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 More sharing options...
PcExpert Posted January 12, 2006 Author Share Posted January 12, 2006 Thanks, SmOke_N Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now