Blackstar Posted July 5, 2006 Share Posted July 5, 2006 Hi, how does one go about creating a spam filters list script for autoit? What I'm trying to do is: open a text file called SpamFilters.txt and load up all (in an array perhaps?) with each lines per filter that looks like this: Make Money! sell stocks now iamspamming@you.com Not satified with your manhood? Then I have a script to open the email message (from email website that doesnt offer spam filtering) via IE.au3 but how to copy all the text message into clipboard and do match with the SpamFilters.txt list and raise flag? Can this be done? Thanks! Blackstar Link to comment Share on other sites More sharing options...
marfdaman Posted July 5, 2006 Share Posted July 5, 2006 I made a quick function you could use to see if the specified text contains any of the spammesages you put in the array. Hope this helpsFunc _CheckSpam($text) For $i= 1 To UBound($spamarray); Or UBound($spamarray)-1, if the first element [0] contains the amount of spammessages to search for If StringInStr($text, $spamarray[$i] Then Return 1 Next Return 0 EndFuncAlzo Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link to comment Share on other sites More sharing options...
Blackstar Posted July 5, 2006 Author Share Posted July 5, 2006 I made a quick function you could use to see if the specified text contains any of the spammesages you put in the array. Hope this helps Func _CheckSpam($text) For $i= 1 To UBound($spamarray); Or UBound($spamarray)-1, if the first element [0] contains the amount of spammessages to search for If StringInStr($text, $spamarray[$i] Then Return 1 Next Return 0 EndFunc Alzo Ok, how do I open SpamFilter.txt file AND load it up on each line to array? Thanks. Blackstar Link to comment Share on other sites More sharing options...
Blackstar Posted July 5, 2006 Author Share Posted July 5, 2006 Oh and forgot to add for my previous post: How to get it all the filter words to clipboard and do matching via array? I do not know how to get texts in clipboard to work with array in autoit....what is the correct way to do it? Link to comment Share on other sites More sharing options...
marfdaman Posted July 5, 2006 Share Posted July 5, 2006 Presuming all different spammessages are on a seperate line, look at FileReadLine and the For...Next loop. Alzo Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link to comment Share on other sites More sharing options...
Blackstar Posted July 5, 2006 Author Share Posted July 5, 2006 FileReadLine, got it but *how* do u get it to array...can u give me an example please?Presuming all different spammessages are on a seperate line, look at FileReadLine and the For...Next loop.Alzo Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 5, 2006 Moderators Share Posted July 5, 2006 FileReadLine, got it but *how* do u get it to array...can u give me an example please?Beta = _FileReadToArray() 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...
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