Sign in to follow this  
Followers 0
Zeerti

Pidgin MOTD Script Help

8 posts in this topic

#1 ·  Posted (edited)

I am working on creating a script that will check every few seconds what the MOTD (Message of the day) is and then parse that through a regular expression. However I'm not really all that sure what the best way to get the current message of the day using Pidgin. As it stands the script is designed to check if there is VTO (Volunteered Time Off) and to notify me of it so I can take it.

If you take a look at the screenshot I included the AutoIt Window Info plus an example of what it looks like in Pidgin for those who are not familiar with the software.

http://imgur.com/bM007R5

The way I figure at the moment is the last way I want to do it, but if you double click within that area it will highlight it and then I could copy it to the clipboard and have it parse it that way. However I would like to avoid doing it this way because it would be disruptive to working. Another thing is that when the MOTD is changed it does announce it in the chat and this is logged to the log file. It might also be possible to parse the log file as well. Anyone have any ideas on how to best tackle this?

-edit-

While I'm at it, I figure I might also ask if anyone knows how to have the script message specific people.

Edited by Zeerti

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Maybe with the UDF's _INetGetSource() and _StringBetween()..

edit: BTW, the link you posted yields a (nicely customized) 404.

Edited by somdcomputerguy

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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I'll look into UDF's _INetGetSource() and _StringBetween()

Link should be fixed put in a space on accident

-Edit-

A quick glace at _INetGetSource and I don't think this is going to help me as Pidgin is a standalone instant message application and not something in a web browser.

Edited by Zeerti

Share this post


Link to post
Share on other sites

You're right, the _INetGetSource() function most probably won't work in this case. See if the Info Tool's Visible and Hidden Text tabs have anything you can use.


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

Share this post


Link to post
Share on other sites

the hidden and visible text just say 'Pidgin' about 20 times each. So not a whole lot of help there. 

is it possible to use ControlSend( ) to have it copy it to the clipboard? I don't care how it works so long as it doesn't move my mouse or interfere with work somehow.

Share this post


Link to post
Share on other sites

is it possible to use ControlSend( ) to have it copy it to the clipboard?

I'm pretty sure it doesn't. What about Visible text if you point the Info Tool to main window? You (your script, I mean) might just have to read the log and parse data from that. Check out the TCP, UCP, and other network functions in the Help file. There might be a UDF in the 'Example Scripts' forum that may help.

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

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

What my current code looks like, not sure if the reg expression is working correctly.

;Array of files in log folder
$FileList = _FileListtoArrayEx('C:\Users\Zoidberg\AppData\Roaming\.purple\logs\jabber\***', '*.*', 1)
$File = $FileList[$FileList[0]] ;get newest log file

_ArrayDisplay($FileList, "$avArrayTarget BEFORE _ArrayPush()")

$FileHandle = FileOpen($File)
$LineRead = FileReadLine($FileHandle, -1)
FileClose($FileHandle)
;Check if VTO found
$RegExArray = StringRegExp($LineRead, ".*?((?i)COMMAND).*?(\d+).*?((?i)VTO)", 3)


if Ubound($RegExArray) == 2 Then
  MsgBox($MB_OK, "VTO FOUND", $LineRead)
endif
Edited by Zeerti

Share this post


Link to post
Share on other sites

Oops, I forgot to mention earlier, have you tried WinGetText() and ControlGetText()?


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

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