 |
Full Throttle Wanderer
Joined: 07 Dec 2004 Posts: 65
|
Posted: Sat Jan 29, 2005 1:49 pm
clearing VBScript object |
I am writing a VBScript based on "Darker's Directions" in the Finished Scripts Forum.
"Darker's Directions (Realms Of Despair)"
http://forums.zuggsoft.com/phpbb/viewtopic.php?t=12092
Example Script:
Code: |
#alias {showfile} {
#script {strHTML = ~"~"}
#script {Sub getHTML:Set objHTTP = CreateObject~(~"MSXML2.XMLHTTP~"):objHTTP.Open ~"GET~", ~"http:~/~/www.mymudsite.com~/file.html~", ~"FALSE~":objHTTP.Send:strHTML = objHTTP.ResponseText:Set objHTTP = Nothing:End Sub}
#mss {getHTML}
#show %mss(strHTML)} |
If the contents of file.html is "Hello World", then the alias downloads the file from the server and shows "Hello World".
Problem:
If the server changes the contents of the file, then the alias still shows "Hello World".
I want to download the file from the server each time I call the alias.
How do you clear an object from memory? (without re-starting zMUD)
Thanks, F.T. |
|
|
 |
Full Throttle Wanderer
Joined: 07 Dec 2004 Posts: 65
|
Posted: Mon Jan 31, 2005 4:21 am |
Okay, I got it to work
Solution:
Code: |
#alias {showfile} {
#script {strHTML = ~"~"}
#script {Sub getHTML:Set objHTTP = CreateObject~(~"MSXML2.XMLHTTP~"):objHTTP.Open ~"GET~", ~"http:~/~/www.mymudsite.com~/file.html?%time(hhnnss)~", ~"FALSE~":objHTTP.Send:strHTML = objHTTP.ResponseText:Set objHTTP = Nothing:End Sub}
#mss {getHTML}
#show %mss(strHTML)} |
This will download the file from the server each time I call the alias.
Thanks to Darker for posting his script. |
|
|
 |
FiendishX Wanderer
Joined: 19 Nov 2005 Posts: 53
|
Posted: Sat Apr 12, 2008 8:45 pm |
Use the ServerXMLHTTP object instead of just XMLHTTP.
|
|
|
 |
|
|