Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>Varisia Caravan Encounters</TITLE>
</HEAD>
<BODY>
<script language="JavaScript">
// Some Arrays
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
function rnd() {
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
rnd.seed = (rnd.seed*9301+49297) % 233280;
return rnd.seed/(233280.0);
}
function rand(number) {
return Math.ceil(rnd()*number);
}
function tableResults(argument, sectionIdentifier) {
var varisiaArray = [];
varisiaArray.push({"max": 15, "name": "Bad Weather", "content": "Fog, rain, high winds, or some other form of bad weather slows the caravan, reducing its overall speed by half for the day unless the caravan makes a DC 12 Security check." });
varisiaArray.push({"max": 30, "name": "Bandit Ambush (CR 2)", "content": "The caravan must make a DC 15 Security check to notice this ambush in time to react; if this check fails, the caravan takes a –2 penalty to its Armor Class and on attack rolls for the first round of combat. The ambushers could be a group of bandits, a gang of highwaymen, or even a small tribe of Nolander barbarians. Regardless of their makeup, the ambushers’ stats and aggression are identical (AC 14; hp 20; Attack +4; Damage 2d6+3). They fight to the death. If defeated, 1 cargo unit of treasure worth 250 gp can be recovered."});
varisiaArray.push({"max": 50, "name": "Goblin Raiders (CR 1/2)", "content": "A shrieking band of goblins wielding dogslicers and broken branches attacks the caravan (AC 11; hp 10; Attack +1; Damage 1d8). If the PCs have a horse train, the goblins are more timid than normal and take a –2 penalty on attack rolls. If defeated, a search of the goblins reveals a single cargo unit of treasure worth 125 gp."});
varisiaArray.push({"max": 55, "name": "Ogre Assault (CR 3)", "content": "A small band of ogres lumbers out of the surrounding foliage to attack the caravan (AC 15; hp 30; Attack +6; Damage 3d4+6). The ogres flee if reduced below 10 hit points. If they are slain, looting produces 2 cargo units of treasure worth 400 gp each."});
varisiaArray.push({"max": 65, "name": "Treacherous Road", "content": "The road conditions become hazardous. They might be muddy, partially flooded, or even blocked by a fallen tree. The caravan must make a DC 14 Security check or lose 2d6 miles of progress for the day as the situation is dealt with."});
varisiaArray.push({"max": 100,"name": "Varisian Caravan", "content": "The PCs encounter another Varisian caravan heading in the opposite direction. With a DC 12 Resolve check, the PCs can befriend the other caravan. If this encounter occurs during the day, the caravan can give the PCs advice as to what lies ahead, reducing the chance of an encounter to 5% per day for the next 1d6 days. If the encounter occurs during the evening, the caravan agrees to share their camp, allowing the PCs to trade with them. The caravan can purchase up to 2,000 gp in objects, and can offer anything worth 600 gp or less for sale."});
var allArrays = {
"varisia": varisiaArray,
};
var randomNum = rand(100) + 1;
var arrayOfChoices = allArrays[argument];
var error = "";
if (!arrayOfChoices) {
error = "no such set: " + argument;
}
var content = "";
var name = "";
for (var itemIndex in arrayOfChoices) {
var item = arrayOfChoices[itemIndex];
if (randomNum <= item.max) {
content = item.content;
name = item.name
break;
}
}
var results = [];
if (error) {
results.name = "";
results.content = error;
} else {
results.name = name;
results.content = content;
}
return results;
}
</script>
<div id="error"></div>
<form>
<input type="button" name="Button1" value="Varisia Caravan Encounters" onClick="var x = tableResults('varisia');this.form.name.value=x.name;this.form.content.value = x.content;" size="" />
<input name="name" style="font-weight:bold;"></input>
<textarea name="content" cols="40" rows="10" wrap="soft"></textarea>
</form>
Unfortunately, it appears that the RW Javascript engine is based on IE, but isnt neccesarilly the one of your IE. I know this because i wrote a more complex script, using things like document.getElementByID().getElementsByClassName()
makes sense that they would do that, though from what i imagine, it would be very surprised if it behaved as IE 6. Microsoft stopped supporting that a long time ago, and is very adamant about getting people off of it, and I doubt they would want any other software to be using it. Its probably an IE 8 or something like that.
Realm Works (likely via the .NET WebBrowser control) uses the engine from the main version of IE installed on your machine. I have IE11 and the User Agent for Realm Works is:
It'll navigate to other websites and run plugins if you want. I wouldn't recommend using external resources but you likely can. At that point, though, why not just link to a page on the Internet? The "local" page won't work without Internet access anyway.
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
Seems odd to be using a different rendering mode. But anyway, we arent talking about rendering mode, i dont think anyway, just what JS methods are available.
Im going to do a test when i get home, see if a jquery page will work. (granted that will require internet access as Parody mentions)
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
The websites I work on aren't that complicated (some server-side code but almost no interactive) so I haven't had to deal with javascript issues between browsers/versions. Another thing I'm glad I missed, for the most part.IE 7 javascript sucks. IE 8 and more are so much better. I wonder why my last script didnt work though. I wasnt doing getElementsByClassname.. just assigning multiple variables in a onclick ... i wonder if IE 7 cant deal with that. (its been over 12 months since ive had to deal with pre IE 8 issues... so glad my company no longer supports it)