IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Matrix Profile Template
CraftZero
post Jun 16 2009, 07:31 PM
Post #1


Target
*

Group: Members
Posts: 7
Joined: 28-May 09
Member No.: 17,217



I did a search, but I wasn't able to find exactly what I want (please, point it out if you know of a good example).

I'm writing up a wiki for my upcoming campaign, and I wanted to detail all the NPC's that the players meet, as if each entry was something culled from the Matrix. Obviously, these entries would contain technical gobbledy-gook mixed in with pertinent info. The following is an example of what I'm looking for, does anyone know of anything like this that's out there?


//Name: Johnathan Riley
//SIN: 43829-64839-2E45G (Criminal)
//Known Aliases: Johnathan Rook; Johnny Six
//Last Known Commcode: 1-Y7-2T-56U7
// ETC ETC
Go to the top of the page
 
+Quote Post
Pyrius
post Jun 16 2009, 08:21 PM
Post #2


Target
*

Group: Members
Posts: 12
Joined: 7-September 05
From: near Cologne
Member No.: 7,705



I found a cool free Javascript file that was used when the Shdaowrun-Online site (http://shadowrunmmo.com/sro/) had to go offline.
I embedded it in some HTML and created a background image to use it for my Shadowrun group.

Here´s the HTML part: NewsTicker.htm
(replace the red part with the text you need)

********************

<html>
<head>
<title>NewsTicker</title>
<script type="text/javascript" src="TypingText.js">
/****************************************************
* Typing Text script- By Twey @ Dynamic Drive Forums
* Visit Dynamic Drive for this script and more: http://www.dynamicdrive.com
* This notice MUST stay intact for legal use
****************************************************/
</script>
</head>
<body background="bg.gif" leftmargin="34" topmargin="60">
<table bgcolor="#000000" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<table>
<tr>
<td width=537 valign=top>
<p id="example2">
<font color=#00FF00 face="Times New Roman">
>>>>>CODE: FILE EXECUTE-ID [Johnathan Riley]<br>
>>>>>BEGIN? [Y/N]> Y <br>
<br>
>>>>>Name: Johnathan Riley<br>
>>>>>SIN: 43829-64839-2E45G (Criminal)<br>
>>>>>Known Aliases: Johnathan Rook; Johnny Six<br>
>>>>>Last Known Commcode: 1-Y7-2T-56U7<br>
>>>>>ETC<br>
>>>>>ETC<br>
>>>>>ETC<br>
>>>>>ETC<br>
>>>>>ETC<br>
>>>>>ETC<br>
>>>>>ETC<br>
>>>>>ETC<br>
>>>>>ETC

<p>
<script type="text/javascript">
//Define second typing example (use "slashing" cursor at the end):
new TypingText(document.getElementById("example2"), 100, function(i){ var ar = new Array("\\", "|", "/", "-"); return " " + ar[i.length % ar.length]; });
//Type out examples:
TypingText.runAll();
</script>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>


********************


Here´s the Javascript part: TypingText.js


********************


/*
An object-oriented Typing Text script, to allow for multiple instances.
A script that causes any text inside any text element to be "typed out", one letter at a time. Note that any HTML tags will not be included in the typed output, to prevent them from causing problems. Tested in Firefox v1.5.0.1, Opera v8.52, Konqueror v3.5.1, and IE v6.
Browsers that do not support this script will simply see the text fully displayed from the start, including any HTML tags.

Functions defined:
TypingText(element, [interval = 100,] [cursor = "",] [finishedCallback = function(){return}]):
Create a new TypingText object around the given element. Optionally
specify a delay between characters of interval milliseconds.
cursor allows users to specify some HTML to be appended to the end of
the string whilst typing. Optionally, can also be a function which
accepts the current text as an argument. This allows the user to
create a "dynamic cursor" which changes depending on the latest character
or the current length of the string.
finishedCallback allows advanced scripters to supply a function
to be executed on finishing. The function must accept no arguments.

TypingText.run():
Run the effect.

static TypingText.runAll():
Run all TypingText-enabled objects on the page.
*/

TypingText = function(element, interval, cursor, finishedCallback) {
if((typeof document.getElementById == "undefined") || (typeof element.innerHTML == "undefined")) {
this.running = true; // Never run.
return;
}
this.element = element;
this.finishedCallback = (finishedCallback ? finishedCallback : function() { return; });
this.interval = (typeof interval == "undefined" ? 100 : interval);
this.origText = this.element.innerHTML;
this.unparsedOrigText = this.origText;
this.cursor = (cursor ? cursor : "");
this.currentText = "";
this.currentChar = 0;
this.element.typingText = this;
if(this.element.id == "") this.element.id = "typingtext" + TypingText.currentIndex++;
TypingText.all.push(this);
this.running = false;
this.inTag = false;
this.tagBuffer = "";
this.inHTMLEntity = false;
this.HTMLEntityBuffer = "";
}
TypingText.all = new Array();
TypingText.currentIndex = 0;
TypingText.runAll = function() {
for(var i = 0; i < TypingText.all.length; i++) TypingText.all[i].run();
}
TypingText.prototype.run = function() {
if(this.running) return;
if(typeof this.origText == "undefined") {
setTimeout("document.getElementById('" + this.element.id + "').typingText.run()", this.interval); // We haven't finished loading yet. Have patience.
return;
}
if(this.currentText == "") this.element.innerHTML = "";
// this.origText = this.origText.replace(/<([^<])*>/, ""); // Strip HTML from text.
if(this.currentChar < this.origText.length) {
if(this.origText.charAt(this.currentChar) == "<" && !this.inTag) {
this.tagBuffer = "<";
this.inTag = true;
this.currentChar++;
this.run();
return;
} else if(this.origText.charAt(this.currentChar) == ">" && this.inTag) {
this.tagBuffer += ">";
this.inTag = false;
this.currentText += this.tagBuffer;
this.currentChar++;
this.run();
return;
} else if(this.inTag) {
this.tagBuffer += this.origText.charAt(this.currentChar);
this.currentChar++;
this.run();
return;
} else if(this.origText.charAt(this.currentChar) == "&" && !this.inHTMLEntity) {
this.HTMLEntityBuffer = "&";
this.inHTMLEntity = true;
this.currentChar++;
this.run();
return;
} else if(this.origText.charAt(this.currentChar) == ";" && this.inHTMLEntity) {
this.HTMLEntityBuffer += ";";
this.inHTMLEntity = false;
this.currentText += this.HTMLEntityBuffer;
this.currentChar++;
this.run();
return;
} else if(this.inHTMLEntity) {
this.HTMLEntityBuffer += this.origText.charAt(this.currentChar);
this.currentChar++;
this.run();
return;
} else {
this.currentText += this.origText.charAt(this.currentChar);
}
this.element.innerHTML = this.currentText;
this.element.innerHTML += (this.currentChar < this.origText.length - 1 ? (typeof this.cursor == "function" ? this.cursor(this.currentText) : this.cursor) : "");
this.currentChar++;
setTimeout("document.getElementById('" + this.element.id + "').typingText.run()", this.interval);
} else {
this.currentText = "";
this.currentChar = 0;
this.running = false;
this.finishedCallback();
}
}



********************

And finaly the background image:

http://2.bp.blogspot.com/_X22K3SUuxHg/Sjf7.../s1600-h/bg.GIF

Just save the HTML part, the Javascript part and the image in the same folder and open the HTML file in your browser.

Don´t ask my how it works exactly; my Java-foo is not that good (IMG:style_emoticons/default/wink.gif)
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

 



RSS Lo-Fi Version Time is now: 20th June 2024 - 09:47 AM

Topps, Inc has sole ownership of the names, logo, artwork, marks, photographs, sounds, audio, video and/or any proprietary material used in connection with the game Shadowrun. Topps, Inc has granted permission to the Dumpshock Forums to use such names, logos, artwork, marks and/or any proprietary materials for promotional and informational purposes on its website but does not endorse, and is not affiliated with the Dumpshock Forums in any official capacity whatsoever.