Jump to content



Photo

capturing text + doing actions


  • This topic is locked This topic is locked
25 replies to this topic

#1 whatsagoodname

whatsagoodname

    Seeker

  • Active Members
  • 7 posts

Posted 13 April 2012 - 09:57 PM

i'd prefer if someone just make the script for what I want, since my understanding of this language is very small and I have no idea where to begin. You can make a list of things for me to look up in the helpfile for all that I will need but I'll probably just come back with 10x the questions after awhile.

What I want the script to do:
1) recognize certain words on a webpage using google chrome
2) perform actions based on the words it sees.

typically #2 will be doing the actions with the keyboard, not the mouse.

hope thats enough info.





#2 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,216 posts

Posted 13 April 2012 - 10:00 PM

i'd prefer if someone just make the script for what I want, since my understanding of this language is very small and I have no idea where to begin. You can make a list of things for me to look up in the helpfile for all that I will need but I'll probably just come back with 10x the questions after awhile.

What I want the script to do:
1) recognize certain words on a webpage using google chrome
2) perform actions based on the words it sees.

typically #2 will be doing the actions with the keyboard, not the mouse.

hope thats enough info.


Don't go away, stay right there, I will complete this as soon as possible master!
Spoiler
Warning: Posts by this user are subject to change or may disappear without notice.

#3 EndFunc

EndFunc

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 426 posts

Posted 13 April 2012 - 10:06 PM

i'd prefer if someone just make the script for what I want, since my understanding of this language is very small and I have no idea where to begin. You can make a list of things for me to look up in the helpfile for all that I will need but I'll probably just come back with 10x the questions after awhile.

What I want the script to do:
1) recognize certain words on a webpage using google chrome
2) perform actions based on the words it sees.

typically #2 will be doing the actions with the keyboard, not the mouse.

hope thats enough info.


I'm sorry but you are not going to get much help like that. You will first have to have more info, show an attempt that you tried to code, looked up info in the helpfile and put your efforts here. No one is just going to write it for you and just tell you what you need.

Hope that's enough info. ;)
EndFuncAutoIt is the shiznit. I love it.

#4 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,216 posts

Posted 13 April 2012 - 10:07 PM

I'm sorry but you are not going to get much help like that. You will first have to have more info, show an attempt that you tried to code, looked up info in the helpfile and put your efforts here. No one is just going to write it for you and just tell you what you need.

Hope that's enough info. ;)


That's exactly what I said, except through sarcasm...
Spoiler
Warning: Posts by this user are subject to change or may disappear without notice.

#5 Blue_Drache

Blue_Drache

    Revolutionary Flavour

  • Active Members
  • PipPipPipPipPipPip
  • 3,176 posts

Posted 13 April 2012 - 10:16 PM

What website? I might be able to help you.

Edited by Blue_Drache, 13 April 2012 - 10:16 PM.

Lofting the cyberwinds on teknoleather wings, I am...The Blue DrachePosted ImagePosted Image

#6 EndFunc

EndFunc

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 426 posts

Posted 13 April 2012 - 10:20 PM

That's exactly what I said, except through sarcasm...


I know and found it funny, but I also wanted to give more details on what he needs to do.
EndFuncAutoIt is the shiznit. I love it.

#7 whatsagoodname

whatsagoodname

    Seeker

  • Active Members
  • 7 posts

Posted 13 April 2012 - 10:32 PM

told you you could tell me where to start, things to look up.

im sure its somewhere along the gui window creating thingy

#8 Blue_Drache

Blue_Drache

    Revolutionary Flavour

  • Active Members
  • PipPipPipPipPipPip
  • 3,176 posts

Posted 13 April 2012 - 10:34 PM

Well ... I was going to help, and give a good example, if you tell me what website I would be working with?
Lofting the cyberwinds on teknoleather wings, I am...The Blue DrachePosted ImagePosted Image

#9 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,216 posts

Posted 13 April 2012 - 10:58 PM

Well ... I was going to help, and give a good example, if you tell me what website I would be working with?



Doesn't seem like it's web site specific, seems more like the user wants something along the lines of a parental control application, something that can detect particular words on a window and do certain actions depending on the word detected...


Probably somewhere along these lines...
AutoIt         
#include <Process.au3> Global $BadWords[5] = ["icarly", "porn", "sex", "fuck", "sweaty salty midgets"] AdlibRegister("Monitor", 1000) Sleep(99999999) Func Monitor()     Local $hwin = WinGetHandle("")     If (StringLower(_ProcessGetName(WinGetProcess($hwin))) <> "chrome.exe") Then Return     $WinTitle = WinGetTitle($hwin)     $winttext = WinGetText($hwin)     For $I = 0 To UBound($BadWords) - 1         $sTextWinTitle = StringInStr($WinTitle, $BadWords[$I])         $sTextWin = StringInStr($winttext, $BadWords[$I])         If $sTextWin Then             Dictate($hwin, $BadWords[$I])             Return         EndIf         If $sTextWinTitle Then             Dictate($hwin, $BadWords[$I])             Return         EndIf     Next EndFunc   ;==>Monitor Func Dictate($hwin, $BadWord) ;~   Switch $BadWord ;~       Case ;~           ProcessClose(WinGetProcess($hwin)) ;~       Case ;~           ProcessClose(WinGetProcess($hwin)) ;~   EndSwitch     MsgBox(64, "Found!", $BadWord & " found win window: " & WinGetTitle($hwin)) EndFunc   ;==>Dictate

Edit: there's just one problem with my script, it wont get the text in a chrome window, just the title, I never actually got too into this to figure it out sadly..

Maybe some one else will help the op.

Edited by ApudAngelorum, 13 April 2012 - 11:01 PM.

Spoiler
Warning: Posts by this user are subject to change or may disappear without notice.

#10 somdcomputerguy

somdcomputerguy

  • Active Members
  • PipPipPipPipPipPip
  • 2,375 posts

Posted 14 April 2012 - 12:07 AM

This function, StringInStr, can be used to check the page's source code, returned by this function - _INetGetSource, for an array of bad words.
- Bruce /* somdcomputerguy */If you change the way you look at things, the things you look at change.

#11 whatsagoodname

whatsagoodname

    Seeker

  • Active Members
  • 7 posts

Posted 16 April 2012 - 04:05 AM

yeah i dont understand what bruce is saying. also by reading Apud's script it looks like its going to close the window if it works. I dont want it to close the window, just to send text to the blank field when it sees certain text on the page.

#12 Blue_Drache

Blue_Drache

    Revolutionary Flavour

  • Active Members
  • PipPipPipPipPipPip
  • 3,176 posts

Posted 16 April 2012 - 11:41 AM

Fields contain controls. Controls have handles. Each website writes them differently. If you want the best possible help, what website are you working with so we can give you the most efficient code?
Lofting the cyberwinds on teknoleather wings, I am...The Blue DrachePosted ImagePosted Image

#13 somdcomputerguy

somdcomputerguy

  • Active Members
  • PipPipPipPipPipPip
  • 2,375 posts

Posted 16 April 2012 - 08:10 PM

Just add an URL to the $URL variable and change the array data and you should be good to go. This should get you started.
AutoIt         
#include <INet.au3> Opt('MustDeclareVars', 1) Local $BadWord_Array[4] = ["badword#1", _                            "badword#2", _                            "badword#3", _                            "badword#4"]                           Local $URL = "", $Debug = 0, $Source, $KeyWord While 1     $Source = _INetGetSource($URL)     For $a = 0 To UBound($BadWord_Array) - 1         $KeyWord = StringInStr($Source, $BadWord_Array[$a])         If $KeyWord <> 0 Or $Debug Then ;If text does exist             MsgBox(0, "", "Yay!")             ExitLoop(2) ; exits the While loop         EndIf     Next     MsgBox(0, "", "No words found..", 2)     Sleep(60 * 1000)     MsgBox(0, "", "Checking again.", 2) WEnd MsgBox(0, "", "Bye!")

Edited by somdcomputerguy, 16 April 2012 - 08:29 PM.

- Bruce /* somdcomputerguy */If you change the way you look at things, the things you look at change.

#14 kylomas

kylomas

    Want to see God laugh? Tell him you have plans!

  • Active Members
  • PipPipPipPipPipPip
  • 2,049 posts

Posted 16 April 2012 - 10:11 PM

ApudAngelorun,

"sweaty salty midgets" ?? Just seen one here http://www.autoitscript.com/forum/topic/139629-1200pm-april-18-2012/page__view__findpost__p__979461

kylomas
"Really?, How Do you know the're not random numbers?"Forum Rules

#15 ScriptMasterFlex

ScriptMasterFlex

    Seeker

  • Banned (NOT IN USE)
  • 4 posts

Posted 16 April 2012 - 11:57 PM

Kylomas,

I've added you to the list of people who are going to get whacked on April 20 fucker.

ScriptMasterFlex

#16 JLogan3o13

JLogan3o13

    Down to 98

  • MVPs
  • 2,085 posts

Posted 17 April 2012 - 12:14 PM

Kylomas,

I've added you to the list of people who are going to get whacked on April 20 fucker.

ScriptMasterFlex


How do we sign up, is there a web form? Can we automate the sign-up with AutoIt? ;)

There is nothing more amusing than someone who truly doesn't realize how pathetic an empty threat is.
  • Mikeman27294 likes this
J.I spent 10 minutes reviewing code and thinking "What kind of drugs is this guy on?" before realizing it was something I wrote.My Scripts:Include Source with Compiled Script, Disk Maintenance for Windows XP, "Deal-A-Day" Sites, SCCM 2007 Front End, Windows Firewall UDF

#17 YogiBear

YogiBear

    deFinitely not yoUr average bear!

  • MVPs
  • 9,867 posts

Posted 17 April 2012 - 06:34 PM

Kylomas,

I've added you to the list of people who are going to get whacked on April 20 fucker.

ScriptMasterFlex

Troll, he is. Intelligent, he is not. A laughing stock he will be. Checking the BS gauge I am...

Posted Image
  • exolon and Mikeman27294 like this

#18 exolon

exolon

    Seeker

  • Active Members
  • 34 posts

Posted 17 April 2012 - 07:07 PM

Global $BadWords[5] = ["icarly", ...]

;)
Brillant!

#19 whatsagoodname

whatsagoodname

    Seeker

  • Active Members
  • 7 posts

Posted 17 April 2012 - 10:25 PM

Just add an URL to the $URL variable and change the array data and you should be good to go. This should get you started.

AutoIt         
#include <INet.au3> Opt('MustDeclareVars', 1) Local $BadWord_Array[4] = ["badword#1", _                            "badword#2", _                            "badword#3", _                            "badword#4"]                           Local $URL = "", $Debug = 0, $Source, $KeyWord While 1     $Source = _INetGetSource($URL)     For $a = 0 To UBound($BadWord_Array) - 1         $KeyWord = StringInStr($Source, $BadWord_Array[$a])         If $KeyWord <> 0 Or $Debug Then ;If text does exist             MsgBox(0, "", "Yay!")             ExitLoop(2) ; exits the While loop         EndIf     Next     MsgBox(0, "", "No words found..", 2)     Sleep(60 * 1000)     MsgBox(0, "", "Checking again.", 2) WEnd MsgBox(0, "", "Bye!")

i changed badword#1 and put the URL inbetween the quotations on "Local $URL = """
it says no words found when i put words that should definitely be found.

#20 somdcomputerguy

somdcomputerguy

  • Active Members
  • PipPipPipPipPipPip
  • 2,375 posts

Posted 17 April 2012 - 11:40 PM

Did you include the protocol part (http://)?
- Bruce /* somdcomputerguy */If you change the way you look at things, the things you look at change.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users