cnodnarb Professional Member
Joined: 11 Sep 2002 Posts: 762 Location: Rockeledge, GA
|
Posted: Wed Jan 01, 2003 7:00 pm Post subject: Checkup.dsc 3.x compatible |
|
|
VDS 3.x Checkup.dsc
Code: |
rem NodNarb Modified version 2.3 to be 3.x compatible
rem Original by Tommy
rem big thanks to Protected Programs for plenty of help
rem works in VDS 3.x
title VDSWORLD Check-Up
option scale,96
option decimalsep,.
directory change,@path(%0)
external vdsipp.dll
internet http,create,1
internet http,threads,1,off
internet http,protocol,1,1
internet http,useragent,1,"VDSWORLD Forum Check-Up"
%%maxmessage = 150
%%maxmessagelines = 4
%%maxsubject = 24
%%maxuser = 26
%%launch = @regread(default,,launch,)
%%interval = @regread(default,,interval,5)
%%lastpost = @regread(default,,lastpost,)
%%lastfile = @regread(default,,lastfile,)
%%lastdevpost = @regread(default,,lastdevpost,)
%%forumnotify = @regread(default,,forumnotify,1)
%%filenotify = @regread(default,,filenotify,1)
%%devforumnotify = @regread(default,,devforumnotify,1)
%%icon = %0
if @equal(@ext(%%icon),dsc)
%%icon =
end
DIALOG CREATE,VDSWORLD Check-Up,-1,0,313,209
DIALOG ADD,TASKICON,taIcon,%%icon,VDSWORLD Check-Up
DIALOG ADD,GROUP,gSettings,4,0,304,160,Settings
DIALOG ADD,CHECK,chAutoLaunch,24,16,280,16,&Launch with Windows
DIALOG ADD,CHECK,chForumNotify,48,16,280,16,Notify on &forum updates
DIALOG ADD,CHECK,chFileNotify,72,16,280,16,Notify on f&ile updates
DIALOG ADD,CHECK,chDevForumNotify,96,16,280,16,Notify on DLL &developer forum updates
DIALOG ADD,TEXT,tInterval,120,16,,,Update interval:
DIALOG ADD,COMBO,cInterval,136,16,56,21,cInterval,,LIST
DIALOG ADD,TEXT,tMinutes,140,88,,,minutes
DIALOG ADD,BUTTON,bOK,176,120,80,24,&OK,,DEFAULT
DIALOG ADD,BUTTON,CANCEL,176,216,80,24,&Cancel
list add,cInterval,2
list add,cInterval,5
list add,cInterval,10
list add,cInterval,30
:evloop
wait event,@fmul(%%interval,60)
goto @event()
:View Last Postmenu
%%index =
gosub getdata
if %%topic
%%new =
gosub getpost
end
goto evloop
:View Last Filemenu
%%index =
gosub getdata
if %%topic
%%new =
gosub getfile
end
goto evloop
:View Last Developer Postmenu
%%index = 1
gosub getdata
if %%topic
%%new =
gosub getpost
end
goto evloop
:Check Nowmenu
:timer
%%index =
gosub getdata
if %%topic
%%update =
if %%lastpost
if @not(@equal(%%post,%%lastpost))
if %%forumnotify
%%new = 1
gosub getpost
end
%%update = 1
end
else
%%update = 1
end
if %%update
%%lastpost = %%post
registry write,default,,lastpost,%%lastpost
end
%%update =
if %%lastfile
if @not(@equal(%%file,%%lastfile))
if %%filenotify
%%new = 1
gosub getfile
end
%%update = 1
end
else
%%update = 1
end
if %%update
%%lastfile = %%file
registry write,default,,lastfile,%%lastfile
end
%%index = 1
gosub getdata
if %%topic
%%update =
if %%lastdevpost
if @not(@equal(%%post,%%lastdevpost))
if %%devforumnotify
%%new = 1
gosub getpost
end
%%update = 1
end
else
%%update = 1
end
if %%update
%%lastdevpost = %%post
registry write,default,,lastdevpost,%%lastdevpost
end
end
end
goto evloop
:taIconclick
if @equal(@click(B),left)
goto timer
else
dialog popup,&Check Now|-|View Last &Post|View Last &Developer Post|View Last &File|-|Open &Forum|Open &Developer Forum|Open &VDSWORLD|-|&Settings|-|C&lose
goto evloop
end
:Open Forummenu
%%link = http://forum.vdsworld.com/
gosub newbrowserwindow
goto evloop
:Open Developer Forummenu
%%link = http://developer.vdsworld.com/
gosub newbrowserwindow
goto evloop
:Open VDSWORLDmenu
%%link = http://www.vdsworld.com/
gosub newbrowserwindow
goto evloop
:Settingsmenu
dialog set,chAutoLaunch,%%launch
dialog set,chForumNotify,%%forumnotify
dialog set,chFileNotify,%%filenotify
dialog set,chDevForumNotify,%%devforumnotify
%x = @match(cInterval,%%interval)
dialog showmodal
%e = @event()
if @equal(%e,bOKbutton)
goto %e
else
goto evloop
end
:bOKbutton
%%launch = @dlgtext(chAutoLaunch)
%%forumnotify = @dlgtext(chForumNotify)
%%filenotify = @dlgtext(chFileNotify)
%%devforumnotify = @dlgtext(chDevForumNotify)
%%interval = @dlgtext(cInterval)
registry write,default,,launch,%%launch
registry write,default,,forumnotify,%%forumnotify
registry write,default,,filenotify,%%filenotify
registry write,default,,devforumnotify,%%devforumnotify
registry write,default,,interval,%%interval
if %%launch
if @not(@equal(@ext(%0),dsc))
registry write,local,SOFTWARE\Microsoft\Windows\CurrentVersion\Run,VCheckUp,%0
end
else
registry delete,local,SOFTWARE\Microsoft\Windows\CurrentVersion\Run,VCheckUp
end
goto evloop
:getdata
if @equal(%%index,1)
internet http,get,1,http://www.vdsworld.com/~developer/data.php
parse "%%topic;%%post",@trim(@internet(http,content,1))
else
internet http,get,1,http://www.vdsworld.com/data.php
parse "%%topic;%%post;%%file;%%filetitle;%%fileauthor",@trim(@internet(http,content,1))
end
exit
:getpost
if @equal(%%index,1)
%%parturl = http://www.vdsworld.com/~developer/data.php
%%developer = "developer "
else
%%parturl = http://www.vdsworld.com/data.php
%%developer =
end
internet http,get,1,%%parturl?request=text&id=%%post&count=%%maxmessage
list create,7
list assign,7,@internet(http,content,1)
list delete,7
%%lastuser = @item(7,0)
list delete,7
%%lasttopic = @item(7,0)
list delete,7
%%lastsubject = @item(7,0)
list delete,7
if @greater(@count(7),%%maxmessagelines)
list seek,7,%%maxmessagelines
repeat
list delete,7
until @greater(@succ(%%maxmessagelines),@count(7))
end
%%lastmessage = @text(7)
if @greater(@len(%%lastmessage),%%maxmessage)
%%lastmessage = @substr(%%lastmessage,1,%%maxmessage)...
end
list close,7
if @not(%%lastsubject)
%%lastsubject = Reply to %%lasttopic
end
if @greater(@len(%%lastsubject),%%maxsubject)
%%lastsubject = @substr(%%lastsubject,1,%%maxsubject)...
end
if @greater(@len(%%lastuser),%%maxuser)
%%lastuser = @substr(%%lastuser,1,%%maxuser)...
end
if %%new
%%message = There's a new post on the VDSWORLD %%developer""forum:
else
%%message = This is the last post on the VDSWORLD %%developer""forum:
end
%%message = %%message@cr()@chr(10)@cr()@chr(10)By: %%lastuser@cr()@chr(10)Subj: %%lastsubject@cr()@chr(10)@cr()@chr(10)%%lastmessage
if @equal(%%index,1)
%%link = "http://www.vdsworld.com/~developer/viewtopic.php?t="%%topic"#"%%post
else
%%link = "http://www.vdsworld.com/forum/viewtopic.php?t="%%topic"#"%%post
end
%%download =
gosub message
exit
:getfile
if %%new
%%message = There's a new file posted at VDSWORLD.
else
%%message = This is the last file posted at VDSWORLD.
end
%%message = %%message Click here to download:@cr()@chr(10)@cr()@chr(10)%%filetitle@cr()@chr(10)@cr()@chr(10)by %%fileauthor
%%download = "http://www.vdsworld.com/index.php?page=download&fileid="%%file
%%link =
gosub message
exit
:parsefilename
%i = 0
%q =
repeat
%i = @succ(%i)
%c = @substr(%%filename,%i)
if @equal(%c,@chr(34))
if %q
%q = 2
else
%q = 1
end
else
if @not(%q)
if @equal(%c," ")
%q = 3
end
end
end
until @equal(%i,@len(%%filename))@equal(%q,2)@equal(%q,3)
if @equal(%q,3)
%%filename1 = @substr(%%filename,1,@pred(%i))
else
if @equal(%q,2)
%%filename1 = @substr(%%filename,2,@pred(%i))
else
%%filename1 = %%filename
end
end
exit
:message
DIALOG CREATE,Check-Up Message Window,300,300,220,148,CLASS VDSMESSAGE,NOTITLE,ONTOP
DIALOG ADD,STYLE,STYLE1,,6,,16777185,FOREGROUND
DIALOG ADD,STYLE,sMessage,,8,BL,,10485760
DIALOG ADD,STYLE,sMessage2,,8,BL,10485760
rem DIALOG ADD,SHAPE,sBackground,0,0,216,148,E1FFFF,0000A0,,RECTANGLE
DIALOG ADD,text,sBackground2,0,0,216,148,,smessage2
DIALOG ADD,text,sBackground,1,1,214,146,,style1
DIALOG ADD,TEXT,tMessage,8,8,208,132,%%message,smessage,TRANSPARENT,CLICK,HAND
DIALOG SHOW
%T = @winpos(#Shell_TrayWnd,T)
%L = @winpos(#Shell_TrayWnd,L)
%H = @winpos(#Shell_TrayWnd,H)
%W = @winpos(#Shell_TrayWnd,W)
%%screenheight = @sysinfo(screenheight)
%%upperT = @diff(%%screenheight,@dlgpos(,H))
%L = @diff(@sysinfo(screenwidth),@dlgpos(,W))
if @equal(%T,0)
rem taskbar is positioned at top, left or right
if @equal(%L,0)
rem taskbar is positioned at left; no problem
else
rem taskbar is positioned at top or right
if @equal(%H,%%screenheight)
rem taskbar is positioned at right
%L = @diff(%L,%W)
else
rem taskbar is positioned at top; no problem
end
end
else
rem taskbar is positioned at bottom
%%upperT = @diff(%%upperT,%H)
end
%%lowerT = %%screenheight
DIALOG SETPOS,,%%lowerT,%L
DIALOG SHOW
:nodcheckuploop
if @not(@equal(@dlgpos(,T),%%upperT))
dialog setpos,,@pred(@dlgpos(,T))
gosub sleep
goto nodcheckuploop
end
repeat
wait event,10
%e = @event()
until @equal(%e,timer)@equal(%e,tMessageclick)@equal(%e,taIconclick)
if @equal(%e,tMessageclick)
if %%link
gosub newbrowserwindow
else
shell open,%%download
end
else
:nodloop2
if @not(@equal(@dlgpos(,T),%%lowerT))
dialog setpos,,@succ(@dlgpos(,T))
gosub sleep
goto nodloop2
end
end
dialog close
rem clear the "CLOSE" event from the event buffer
%x = @event()
exit
:sleep
%i = 0
repeat
%i = @succ(%i)
until @equal(%i,10)
exit
:newbrowserwindow
%%filename = @regread(root,http\shell\open\command,)
if %%filename
gosub parsefilename
run @shortname(%%filename1) %%link
end
exit
:Closemenu
:close
internet http,destroy,1
exit
|
NodNarb |
|