Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Nov 24, 2002 2:00 pm Post subject: Auto Check VDSworld PMs... |
|
|
Here's a simple program that checks your private message
(PM) inbox (or you can use it to check your outbox, etc.) for
new messages. It requires VDSIPP.DLL (which is free).
The first time you run it, it downloads the page and saves
it to your computer. The next time you run it, it compares
the current page to the saved one for differences, and pops
up a message window if anything has changed.
The PM page doesn't show the current time or date, so
there's nothing to allow for. It only changes when you
get a PM or delete messages, etc. The code can be used
to monitor any page that doesn't display the current date
or time.
There is no timer on this example, it runs once and exits.
You can either add timer code and the proper adjustments
(clearing vars, etc.), or use a program tasker (as I do) to
run it periodically.
You must get the direct link to your PM box as shown below,
and put it in the %%inbox var. You must also put a valid
path to a WAV file in the %%sound var if you want one.
__________________________________________________________________________________________________________________________
| Code: |
rem -- To get a direct link to your PM inbox:
rem -- Login with cookies disabled, and auto-login unchecked.
rem -- Go to the PM page (check messages) and copy the URL.
rem -- The direct link to your inbox goes here --
%%inbox = ???
rem -- Used for Window title and saved files --
%%program = "VDSworld_PMcheck"
rem -- Sound to play when window pops up (optional) --
%%sound = @path(%0)ding.wav
rem -- Make sure we see any previous popup, and allow only one --
if @winexists(%%program)
WINDOW ACTIVATE, %%program
if @file(%%sound)
PLAY %%sound
WAIT
end
EXIT
end
TITLE %%program
EXTERNAL @path(%0)VDSIPP.DLL
INTERNET HTTP, CREATE, 1
INTERNET HTTP, THREADS, 1, OFF
INTERNET HTTP, PROTOCOL, 1, 1
LIST CREATE, 1
LIST CREATE, 2
rem -- Load last file --
if @file(@path(%0)%%program.dat)
LIST LOADFILE, 1, @path(%0)%%program.dat
end
rem -- Retrieve VDSworld PM inbox page --
INTERNET HTTP, GET, 1, %%inbox
rem -- Load in list 2 --
LIST ASSIGN, 2, @trim(@internet(HTTP, CONTENT, 1))
rem -- Close Connection --
INTERNET HTTP, DESTROY, 1
rem -- If no file, nothing to compare --
if @greater(1, @count(1))
LIST SAVEFILE, 2, @path(%0)%%program.dat
EXIT
end
:Compare
if @greater(1, @count(1))@greater(1, @count(2))
INFO Not enough info to compare...@tab()
EXIT
end
%%idx1 = 0
%%idx2 = 0
rem -- Max count to use for checking differences --
if @greater(@count(1), @count(2))@equal(@count(1), @count(2))
%%max = @count(1)
else
%%max = @count(2)
end
REPEAT
if @not(@equal(@item(1, %%idx1), @item(2, %%idx2), EXACT))
rem -- Bail if we find a difference --
%%found = 1
end
%%idx1 = @succ(%%idx1)
%%idx2 = @succ(%%idx2)
UNTIL %%found @equal(%%idx1,%%max)@equal(%%idx2,%%max)
if %%found
if @file(%%sound)
PLAY %%sound
WAIT
end
rem -- Save current data now (or not) --
if @not(@ask("New PM at VDSworld..."@tab()@cr()@cr()"Remind again later?"))
LIST SAVEFILE, 2, @path(%0)%%program.dat
end
end
:CLOSE
EXIT
|
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|