FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Feb 16, 2004 12:34 am Post subject: VDSWORLD Chat Checker Utility |
|
|
VDSWORLD Chat Checker Utility 1.0
This utility uses the VDSGUI.DLL by CodeScript to display a popup by the
tray icon which is non-intrusive. It uses the new chat DATA.PHP script,
which can be found at http://forum.vdsworld.com/chat/data.php . Please
see the script for additional details on the data.php script functions.
The script uses API code by Skit3000 to check the data.php without having
to download it to your computer first.
Please feel free to post any modifications in this thread!
NOTE: This script must be compiled to work entirely proper. I'll see if
I can get a compiled version uploaded soon.
Screenshot:
| Code: | title VDSWORLD Chat Checker
# Script by FreezingFire
# Built in part by PGWARE
# VDSGUI Extension by CodeScript
# WININET API Code by Skit3000
if @equal(%1,ShowChatWin)
%%SubFunc = True
external vdsbrw50.dll
DIALOG CREATE,VDSWORLD Chat,-1,0,450,190
DIALOG ADD,BROWSER,BROWSER1,0,0,450,190,http://forum.vdsworld.com/chat/
DIALOG SHOW
goto evloop
end
external vdsgui.dll,DEMO
#define command,gui
#define function,gui
#define function,wininet
DIALOG CREATE,ChatCheckTrayWnd,,,,,CLASS ChatCheckTrayWnd
gui subclass,#ChatCheckTrayWnd
gui option,taskicontipclick,on
gui option,taskiconcrashrecovery
:TaskIconCrashed
GUI ADD,TASKICON,TASKICON1,#ChatCheckTrayWnd,5,VDSWORLD Chat Checker
%%LastID = @wininet(http,get,http://forum.vdsworld.com/chat/data.php)
:Evloop
if %%SubFunc
wait event
else
wait event,10
end
goto @event()
:timer
%A = @wininet(http,get,http://forum.vdsworld.com/chat/data.php)
if @not(@equal(%A,%%LastID))
%%LastID = %A
gosub Notify
end
goto evloop
:Notify
%M = @wininet(http,get,http://forum.vdsworld.com/chat/data.php?request=lastmessage)
parse "%%id;%%author;%%message",%M
gui set,taskicon,taskicon1,#ChatCheckTrayWnd,balloontip,1,New chat post by %%author,%%message
exit
:TaskIcon1CLICK
if @equal(@GUI(CLICK,B),RIGHT)
DIALOG POPUP,Show Chat Window|Show Last Chat Post|-|Exit
end
goto evloop
:Show Last Chat PostMENU
gosub Notify
goto evloop
:Show Chat WindowMENU
:TaskIcon1TIPCLICK
shell open,%0,ShowChatWin
goto evloop
:ExitMENU
:Close
if %%SubFunc
exit
else
gui remove,taskicon,taskicon1,#ChatCheckTrayWnd
gui unsubclass,#ChatCheckTrayWnd
end
exit
:wininet
# Function by Skit3000
if @equal(%1,"http")
loadlib wininet.dll
if @equal(%2,"setheader")
%%HTTP_HEADER = %3
exit
end
%%Buffer =
%%INTERNET_SERVICE_FTP = 1
%%INTERNET_SERVICE_GOPHER = 2
%%INTERNET_SERVICE_HTTP = 3
%%INTERNET_PRECONFIG = 0
%%INTERNET_DIRECT = 1
%%INTERNET_PROXY = 3
%%INTERNET_FLAG_RELOAD = $80000000
%%Document =
%%ref = "VDSWORLD Chat Checker"
if @equal(%2,"GET")
%%Method = "GET"
elsif @equal(%2,"POST")
%%Method = "POST"
else
%%Method = %2
end
%%Site = %3
if @equal(@substr(%%Site,1,7),"HTTP://")
%%Site = @strdel(%%Site,1,7)
end
if @unequal(@pos(/,%%Site),0)
%%Document = @substr(%%Site,@pos(/,%%Site),@len(%%Site))
%%Site = @strdel(%%Site,@pos(/,%%Site),@len(%%Site))
end
%%HandleOpen = @lib(wininet.dll,InternetOpenA,INT:,STR:%%ref,INT:%%INTERNET_PRECONFIG,STR:,STR:,INT:0)
if @unequal(%%HandleOpen)
%%HandleConnect = @lib(wininet.dll,InternetConnectA,INT:,INT:%%HandleOpen,STR:%%Site,INT:80,STR:,STR:,INT:%%INTERNET_SERVICE_HTTP,INT:0,INT:0)
if @unequal(%%HandleConnect)
%%HandleHTTP = @lib(wininet.dll,HttpOpenRequestA,INT:,INT:%%HandleConnect,STR:%%Method,STR:%%Document,NIL:,NIL:,NIL:,%%INTERNET_FLAG_RELOAD,0)
if @unequal(%%HandleHTTP)
%B = %%HTTP_HEADER
%%TempVar = @lib(wininet.dll,HttpAddRequestHeadersA,INT:,INT:%%HandleHTTP,STR:%B,INT:@len(%B),INT:$80000000$10000000)
if @unequal(@lib(wininet.dll,HttpSendRequestA,INT:,%%HandleHTTP,NIL:,0,NIL:,0))
repeat
%x = @binary(dword,0)
%y = @fill(1,,Z)
%%TempVar = @lib(wininet.dll,InternetReadFile,INT:,INT:%%HandleHTTP,@addr("%y"),INT:1,@addr("%x"))
%%Buffer = %%Buffer%y
until @equal(@val(%x),0)
else
end
%%TempVar = @lib(wininet.dll,InternetCloseHandle,INT:,%%HandleHTTP)
else
end
%%TempVar = @lib(wininet.dll,InternetCloseHandle,INT:,%%HandleConnect)
else
end
%%TempVar = @lib(wininet.dll,InternetCloseHandle,INT:,%%HandleOpen)
else
end
freelib wininet.dll
exit @trim(%%Buffer)
end
exit |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team
Last edited by FreezingFire on Mon Feb 16, 2004 3:35 am; edited 1 time in total |
|