forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Auto Check VDSworld PMs...

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Nov 24, 2002 2:00 pm    Post subject: Auto Check VDSworld PMs... Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group