Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Full Throttle
Wanderer


Joined: 07 Dec 2004
Posts: 65

PostPosted: 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.
Reply with quote
Full Throttle
Wanderer


Joined: 07 Dec 2004
Posts: 65

PostPosted: Mon Jan 31, 2005 4:21 am   
 
Okay, I got it to work Razz

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.
Reply with quote
FiendishX
Wanderer


Joined: 19 Nov 2005
Posts: 53

PostPosted: Sat Apr 12, 2008 8:45 pm   
 
Use the ServerXMLHTTP object instead of just XMLHTTP.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion 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

© 2009 Zugg Software. Hosted by Wolfpaw.net