NoobieAutoitUser Posted April 25, 2017 Share Posted April 25, 2017 Hi. I am currently writing a script for Pidgin (chatting/messaging) program. I am using OTR (off the record - encrypts the text/chat) with Pidgin on XMPP (Jabber). The goal is so when people login I can send them messages. Basically offline messaging. When you first send a message you need to wait for a second or two (sometime longer) for the message 'Successfully refreshed the' text to appear before the receiver gets the message. I have everything working great up to this point. I figured out how to 'copy and paste text' into an Array. The Array pops up a message box, so I see the text has been copied. How do i serach for the text in the Array, and have it loop as it waits for the text to appear? With a time out of 60 seconds. #include <Array.au3> Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) WinWait("Untitled - Notepad","") If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","") WinWaitActive("Untitled - Notepad","") Send("{CTRLDOWN}a{CTRLUP}") Send("{CTRLDOWN}c{CTRLUP}") $txt = ClipGet() StringSplit( $txt, @CRLF, 1) ;MsgBox(0,"test", $txt, 0) Local $ClipTxtArray[5] Local $avLines = StringSplit( $txt, @CRLF, 1) _ArrayDisplay($avLines) Link to comment Share on other sites More sharing options...
spudw2k Posted April 25, 2017 Share Posted April 25, 2017 _ArraySearch is a function included in the AutoIT Array UDF. There are a couple of examples in the help file. You can employ a While or Do loop and use sleep (delays) and/or a timer to allot/track 60 seconds worth of time. Personally, I would use a minimal sleep and a timer (TimerInit). I'd suggest looking for the items in bold in the help file for some examples and seeing what you can piece together. Let us know if you get stuck or don't understand how to accomplish what you want. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
NoobieAutoitUser Posted April 25, 2017 Author Share Posted April 25, 2017 $txt is what is copied 'clip get'? Local $ClipTxtArray[5] <-- that is the array? Local $avLines = StringSplit( $txt, @CRLF, 1) <-- not sure I need that. _ArraySearch($ClipTxtArray, "g6g6g6g sf hgfhf") <--- searches Array for 'g6g6g6g sf hgfhf'? Their is a lot I am not sure of with this. I have read of this in the Help and the forums. I looked at the Bold stuff. Still is as clear as mud I don't want to do a file to do the search, as it will need to loop, until it finds the text. That will be many writes. Faster to do Array. Thanks for any pointers. Some I grasp, some I need to learn. 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