RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Display an HTML file to the player

Alari

Wanderer
Display an HTML file to the player

This is what I came up with to display an HTML file to the player on command. It's set up as a [beginner command which displays Data\Beginner.html (included) but the script can be easily modified to be triggered by any command and read any file.

Once the script is installed, the HTML file it links to can be updated without a restart of the server.


Simple, I know, but I didn't see any other way to do this, nor any way provided by the default scripts already.


Installation:
Move the Beginner.html file to your server's Data directory and the BeginnerCommand.cs script to the appropriate scripts directory. (Mine is in "_Custom\Alari - Public\BeginnerCommand" =) {0} in the HTML is replaced with your server command prefix.

Usage:
Type [beginner in-game to view the beginner text. (This really is 'beginner' text in the sense of "How do I move around?" "How do I interact with objects?" etc) Please note that some of the text may be specific to my shard, for example, I'm setting agressive monsters to AlwaysMurderer so they show up red to players, and 'helpmenu' and 'helpinfo' are custom scripts on my shard. Some editing may be required.


If you think of anything else a beginner to UO may need to know, please post it here. =)


Known issues: I had to use "( ? )" instead of "< ? >" in the Beginner.html because the latter didn't show up right in UO. Not even doing &lt; and &gt; worked in UO.
 

Attachments

  • BeginnerCommand.zip
    3.9 KB · Views: 102

ArteGordon

Wanderer
yeah, I was never able to get the '<' ( &lt; ) to display although '>' displays as a normal char (dont need to use &gt; )

You might also consider using the Mobile class 'LaunchBrowser( url )' method to display the html, although it would not be in a nice in-game gump.
 

Alari

Wanderer
Yeah, true, I could have it just load up a remote HTML file, though I wanted something that could be displayed to the player in-game and didn't rely on another server being up and up-to-date.

(Having it do auto-replace on {0} for the server's local command prefix is just a bonus. =)


I swear when I first saw you replied to this I thought you were about to tell me that XMLSpawner could do it. :>
 

ArteGordon

Wanderer
Alari said:
Yeah, true, I could have it just load up a remote HTML file, though I wanted something that could be displayed to the player in-game and didn't rely on another server being up and up-to-date.

(Having it do auto-replace on {0} for the server's local command prefix is just a bonus. =)


I swear when I first saw you replied to this I thought you were about to tell me that XMLSpawner could do it. :>
well.... that's actually a really nice idea :)
The gump stuff is already there allowing you to bring up the html window, but reading in string content directly from a file is missing.
I know you were just kidding around, but that's a really great idea :)
 
This is a wanderfull script!
I used it many time in may RunUO1.0 Shard.

I tried to use it on my new RunUO2.1 Shard, but don't work. Exist a specific script for it?


Tnx ^^
 
Top