Sign in to follow this  
Followers 0
_Kurt

Forum Notification

44 posts in this topic

#1 ·  Posted (edited)

Hello,

After realizing how annoying it was to receive a new email each New Reply in a Topic or New Personal Message, I decided to create a script that will check for that & notify me. This is real handy since sometimes I want to work on scripts and chat on the forum at the same time. I used an MSN-like GUI for the notification, if you click on it, it will navigate you to the latest reply, if you right-click on it, it will close. It seems to work fine, I've tested it out for a while and it's lookin' pretty good. You can keep updated on as many topics as you want so you can work on new projects & post in the forums! This script requires you to already be logged in, if you are receiving errors that you aren't logged in, simply re-log in and try again (this rarely happens). I've also included a Recent Notifications tray menu item incase you were away for a couple of minutes, this will keep you updated on events that have occured i.e. New Notifications, Errors, etc. ( handy when you need a bathroom break :P ).

This script uses one file located at: @TempDir & "\ForumNotification.dat". This file is used to keep track of your settings. Just thought I'd let you guys know, I hate when scripts write files that I am unaware of. To delete this file, click the "Set to Default" button.

How exactly does this work? The script records the latest reply on the topic link, and after every X seconds/minutes, it will grab the latest reply and compare it to the original reply. The script only uses _InetGetSource for the internet functions.

Please post ANY problems that you experience.

I'd also like to hear some improvements & feedback :whistle:

Kurt

For those who may receive Msgbox's saying that they are not logged in, try re-logging into the forums and make sure you are logged into IE first.

Update 3: [April 2nd]

Added Auto-Login & Some Minor fixes

Update 2: [March 26th]

Fixed "Invalid Topic" bug from topics with no replies

Update 1: [March 19th]

Added option to save your settings.

Posted Image

Go ahead and test it! Run the script, post here, and watch the notification window pop up!

Edited by _Kurt

Awaiting Diablo III..

Share this post


Link to post
Share on other sites



I get an invalid screen resolution error. Not all of us have the standard 4:3 screen ratio you know. :whistle:

(Widescreen laptop, my screen ratio is 8:5 and my standard resolution is 1280x800).

Share this post


Link to post
Share on other sites

Woops, my bad, updated attachment.

Sorry,

Kurt


Awaiting Diablo III..

Share this post


Link to post
Share on other sites

This is weird... I was going to do something like this last week but couldn't find the time. Nice.


[center]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.[/center]

Share this post


Link to post
Share on other sites

Handy tool !

could you make a save function for the url's

with autoload on startup ?

couse every time i restart the comp i have to reinsert the url's

that would be a nice future

nice done !

jpam

Share this post


Link to post
Share on other sites

It tells me "I'm not logged in." which confused me at first, but then I realized that this uses IE, and I've never used IE on this computer. So, I'd love it if you could make this ask you for your login/password.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

@jpam - Your suggestion has been added, see first post.

EDIT: Problem Fixed

@Rest - Thanks :whistle:

Kurt

Edited by _Kurt

Awaiting Diablo III..

Share this post


Link to post
Share on other sites

thanks kurt for the quick update !

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

I have just tried re logging in Firefox, and login in in IE. No success at all. Still tells me I am not logged in..

Hmm, try running this small script, don't change any lines. If you get an AU3Check error or a blank msgbox, this means that this won't be able to work. However, if you get a msgbox containing "X New Messages", I know how to fix your problem so we'd be in luck :whistle: .

EDIT: Problem solved

Hope it works,

Kurt

Edited by _Kurt

Awaiting Diablo III..

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Thanks Kurt. I appreciate it. :whistle:

C:\Documents and Settings\Administrator\Bureaublad\Nieuw - AutoIt v3 Script.au3 (10) : ==> Subscript used with non-Array variable.: 
MsgBox(0,"",$CheckPM[0]) 
MsgBox(0,"",$CheckPM^ ERROR

Edit1:By the way, I manually checked the source of the page and it was there...

&middot;&nbsp;<a href="http://www.autoitscript.com/forum/index.php?act=Msg&amp;CODE=01">-1 New Messages</a>

Edit2: This works:

#Include <Inet.au3>
#Include <String.au3>

$link = "http://www.autoitscript.com/forum/index.php?showtopic=42878"
$source2  = _INetGetSource($link)
If @error = 1 Then
    MsgBox(0,"","ERROR: Failed to retrieve source code from: " & $link)
Else
    $a = StringRegExp($source2,"[0-9]+.New Messages",3)
    If Not @error Then
        MsgBox(0, "", $a[0])
    EndIf
EndIf
Edited by Manadar

Share this post


Link to post
Share on other sites

Or with the negative posts bug: :whistle:

#Include <Inet.au3>
#Include <String.au3>

$link = "http://www.autoitscript.com/forum/index.php?showtopic=42878"
$source2  = _INetGetSource($link)
If @error = 1 Then
    MsgBox(0,"","ERROR: Failed to retrieve source code from: " & $link)
Else
    $a = StringRegExp($source2,"-?[0-9]+.New Messages",3)
    If Not @error Then
        MsgBox(0, "", $a[0])
    EndIf
EndIf

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

EDIT: Problem Solved

Kurt

Edited by _Kurt

Awaiting Diablo III..

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

You do that.. The code you gave me didn't work at all. ^^

Edit: Now we just need to fix the initial bug..

Edited by Manadar

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Problem Fixed

Kurt

Edited by _Kurt

Awaiting Diablo III..

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

That actually gives me an error... I've confirmed that I'm actually not logged in.

#include <INet.au3>

$login = _INetGetSource("http://www.autoitscript.com/forum/")
If @error = 1 Then
    MsgBox(0,"","Error getting source: " & @error)
Else
    MsgBox(0, "", StringInStr($login,"Welcome Guest"))
EndIf

Gives a message box with a number 51xx. This confirms that I am a Guest. _INetGetSource just sucks...

Edit: Upps!! IE had knocked me offline.. :whistle: for Microsoft.

I got it working, and I have no clue what I changed.. :|

Edited by Manadar

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

Problem Fixed

Kurt

EDIT: Yeepey! Had me scared for a second :whistle:

Edited by _Kurt

Awaiting Diablo III..

Share this post


Link to post
Share on other sites

Is the script working for you now? or are you still experiencing similar problems?

Kurt


Awaiting Diablo III..

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