RuneScape Advanced Forum

By Freeze Last update Oct 28, 2007 — Installed 621 times. Daily Installs: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 3, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0
// ==UserScript==
// @name           RuneScape Advanced Forum
// @namespace      frostedfreeze@gmail.com
// @description    This script adds various features to the RuneScape forums that help you while you use them.
// @include        *forum.runescape.com/*
// @include        *runescape.com/loginapplet/loginapplet.ws*
// @include        *runescape.com/logininvalid.ws*
// ==/UserScript==
if(window.location.href.substring(window.location.href.length -7)=="/raf.ws") {
//document.write('');
body = document.getElementsByTagName('body');
document.getElementsByTagName('head')[0].innerHTML = document.getElementsByTagName('head')[0].innerHTML+'<link href="http://www.runescape.com/css/basic-3.css" rel="stylesheet" type="text/css" media="all"><link href="http://www.runescape.com/css/forum/forum-3.css" rel="stylesheet" type="text/css" media="all">';
body[0].style.color="white";
body[0].style.background="black url(http://www.runescape.com/img/bg2.jpg) repeat-y scroll center top";
var releasenumber = '6';
var content = 'Thank you for using RuneScape Advanced Forum. You are running release #'+releasenumber+'. Go <A href="http://userscripts.org/scripts/show/13002">here</A> to check for updates on this script.';
var updates = '<ul><h1 style="font-size:150%">Release #1</h1><li>"Click here if you see a gray window" message appears on page load</li><li>Real link to page is displayed at bottom of each topic</li><li>Adds a period to "You are not logged in"</li><li>Adds a quick log in bar</li><li>Adds "Forum User" as the modtype for normal users</li><li>Makes your posts appear in blue (by using the redirected CSS)</li><li>Makes your highlighted posts appear in blue and highlighted (by using the redirected CSS)</li><li>Adds a show posts option</li><li>Adds a view stats option</li><li>Adds a view profile option</li><li>Moves the edit link</li><li>Changes "The contents of this message has been hidden" to red</li><li>Adds an option to view the page while logged off if your session becomes invalid</li><li>Adds an option to view the page while logged off if invalid password is entered</li><br /><h1 style="font-size:150%">Release #2</h1><li>Typing "Quick find code: #" will create a link to take you to the topic with that same # (Try the forum emergencies pinned thread for example)</li><li>Add gold crown to Jagex mods\' name on thread list if they made topic or posted last (Doesn\'t work for Andrew or Paul ATM)</li><li>Make topics started by Jagex mods appear in gold on the thread list (mod prefix + Andrew/Paul/etc.)</li><li>Make it so "This thread has been moved to the # forum" appears in blue</li><li>Change background color for moved topics in thread list</li><li>Change the locked image in topics that have been moved</li><li>Change hidden threads\' background color to red</li><li>Change hidden posts\' background color to red</li><br /><h1 style="font-size:150%">Release #3</h1><li>Fixed cloning of pages to display it on</li><br /><h1 style="font-size:150%">Release #4</h1><li>Edited text from moved thread name to show (moved) as separated text, not a part of link</li><li>Added option to go to the forum page where a moved topic is located, so you are not only given the option to view the new topic</li><li>Fixed problem of spaces being in quick find code link when typing "Quick find code: #"</li><li>Fixed ,bump page</li><li>Add a "Show your posts" in this thread link on all pages</li><li>Highlight topics when thd leads to them from url</li><li>Improved quick find code links (not limited to 1 link per post, searches for more names that stand for quick find code)</li><li>Fixed a &showuser bug with moderators.</li><li>Fixed view in thread page</li><br /><h1 style="font-size:150%">Release #5</h1><li>Added a page on the RuneScape forums to show update history.</li><br /><h1 style="font-size:150%">Release #6</h1><li>Textarea when posting or making a new thread now matches the font and size of an actual post. Forum signature makers unite!</li><li>Added shoutbox! Hooray!</li></ul>';
body[0].innerHTML = '<DIV id=body><DIV class="frame wide_e"><SPAN style="float: right;"><A href="http://userscripts.org/scripts/show/13002">Check for Updates</A> &nbsp; <A href="forums.ws">Forums</A></SPAN><DIV>RuneScape Advanced Forum :: <SPAN style="color: rgb(255, 187, 34);">Release #'+releasenumber+'</SPAN></DIV></DIV><BR><BR><DIV id=breadcrumb>> <A href="forums.ws">RuneScape Forums</A> > <A href="raf.ws">RuneScape Advanced Forum</A></DIV><DIV id="infotitle">RuneScape Advanced Forum</DIV><DIV id="info"><DIV class="bk"></DIV><DIV class="cont"><BR><p>'+content+'</p><BR><div align="center"><img src="http://www.runescape.com/img/newsletter/smstones.jpg"><img src="http://www.runescape.com/img/newsletter/smstones.jpg"><img src="http://www.runescape.com/img/newsletter/smstones.jpg"><img src="http://www.runescape.com/img/newsletter/smstones.jpg"><img src="http://www.runescape.com/img/newsletter/smstones.jpg"><img src="http://www.runescape.com/img/newsletter/smstones.jpg"><img src="http://www.runescape.com/img/newsletter/smstones.jpg"><h3>Update History</h3></DIV>'+updates+'</DIV></DIV><DIV id="menu"><A href="forums.ws">Back to forum list</A></DIV><DIV class="tandc">RuneScape Advanced Forum by <A href="http://www.xfire.com/profile/frostedfreeze/">FrostedFreeze</A><BR>This website and its contents are copyright © 1999 - 2007 Jagex Ltd.<BR>Use of this website is subject to our <A class="c" href="http://www.runescape.com/terms/terms.ws">Terms+Conditions</A> and <A class="c" href="http://www.runescape.com/privacy/privacy.ws">Privacy policy</A></DIV></DIV>';
document.title = "RuneScape Advanced Forum";
} else {
div = document.getElementsByTagName('div');
if(div.length>1) {
var showuser = window.location.href.indexOf("showuser");
var loginapplet = window.location.href.indexOf("loginapplet");
var uindex = div[1].innerHTML.indexOf("\"color: rgb(255, 187, 34);\">") +28;
var username = div[1].innerHTML.substring(uindex).replace("</span></div>", "");
var postername;
if(loginapplet>-1) {
document.getElementById("hideme").style.display="inline";
} else {
table = document.getElementsByTagName('table');
form = document.getElementsByTagName('form');
for(i=0;i<form.length;i++) {
if(form[i].method=="post") {
form[i].innerHTML = form[i].innerHTML.replace('<textarea ', '<textarea style="font-family:Arial; font-size:13px"');
}
}
for(i=0;i<table.length;i++) {
if(table[i].className=="message" && table[i].innerHTML.indexOf("The contents of this message have been hidden")>-1) {
table[i].style.backgroundColor="#250505";
table[i].style.borderColor="#4A1616";
table[i].innerHTML = table[i].innerHTML.replace("<td class=\"leftpanel\">", "<td class=\"leftpanel\" style=\"background-color: #300505;\">");
}
if(window.location.href.indexOf("thd,")>-1 && table[i].innerHTML.indexOf(window.location.href.substring(window.location.href.indexOf("thd,") +4))>-1) {
var buildup = "<a class=\"sticky2\" href=\"forums.ws?"+window.location.href.substring(window.location.href.indexOf(".ws?") +4).replace("thd,", "");
var replacement = table[i].innerHTML.substring(table[i].innerHTML.indexOf(buildup) -30);
if(replacement.charAt(0)==">") {
table[i].innerHTML = table[i].innerHTML.replace(replacement, " style=\"border: 2px solid yellow\""+table[i].innerHTML.substring(table[i].innerHTML.indexOf(buildup) -30));
}
}
}
tr = document.getElementsByTagName('tr');
for(i=0;i<tr.length;i++) {
if(tr[i].className=="thdnrml") {
if(tr[i].innerHTML.indexOf("(moved)")>-1) {
tr[i].innerHTML = tr[i].innerHTML.replace("http://www.runescape.com/img/forum/buttons/locked.gif", "http://www.runescape.com/img/forum/cmdicons/refresh.gif");
tr[i].innerHTML = tr[i].innerHTML.replace(" (moved)</a>", "</a>");
//tr[i].innerHTML = tr[i].innerHTML.replace("</td>", "<br><span style=\"color:#0045FF\">A moderator has moved this thread.</span></td>");
tr[i].innerHTML = tr[i].innerHTML.replace(new RegExp(/Thread is locked/g), "Thread is moved");
tr[i].innerHTML = tr[i].innerHTML.replace(new RegExp(/<td class=\"threadtitle\">/g), "<td class=\"threadtitle\" style=\"background-color: #050525;\">");
tr[i].innerHTML = tr[i].innerHTML.replace(new RegExp(/<td class=\"num\">/g), "<td class=\"num\" style=\"background-color: #050530;\">");
tr[i].innerHTML = tr[i].innerHTML.replace(new RegExp(/<td class=\"updated">/g), "<td class=\"updated\" style=\"background-color: #16164A;\">");
}
if(tr[i].innerHTML.indexOf("This thread has been hidden")>-1) {
tr[i].innerHTML = tr[i].innerHTML.replace("This thread has been hidden", "<span style=\"color:#FF4500\">A moderator has removed this thread.</span>");
tr[i].innerHTML = tr[i].innerHTML.replace(new RegExp(/<td class=\"threadtitle\">/g), "<td class=\"threadtitle\" style=\"background-color: #250505;\">");
tr[i].innerHTML = tr[i].innerHTML.replace(new RegExp(/<td class=\"num\">/g), "<td class=\"num\" style=\"background-color: #300505;\">");
tr[i].innerHTML = tr[i].innerHTML.replace(new RegExp(/<td class=\"updated">/g), "<td class=\"updated\" style=\"background-color: #4A1616;\">");
}
if(tr[i].innerHTML.indexOf("<span class=\"username\">Mod")>-1 || tr[i].innerHTML.indexOf("<span class=\"username\">Andrew</span>")>-1 || tr[i].innerHTML.indexOf("<span class=\"username\">Paul</span>")>-1) {
tr[i].innerHTML = tr[i].innerHTML.replace(new RegExp(/<td class=\"threadtitle\">/g), "<td class=\"threadtitle\" style=\"background-color: #3E3605;\">");
tr[i].innerHTML = tr[i].innerHTML.replace(new RegExp(/<td class=\"num\">/g), "<td class=\"num\" style=\"background-color: #4C4205;\">");
tr[i].innerHTML = tr[i].innerHTML.replace(new RegExp(/<td class=\"updated">/g), "<td class=\"updated\" style=\"background-color: #8C7A16;\">");
}
tr[i].innerHTML = tr[i].innerHTML.replace(new RegExp(/username\">Mod/g), "username\"><img src=\"http://www.runescape.com/img/forum/crown_gold.gif\"/>  Mod");
tr[i].innerHTML = tr[i].innerHTML.replace(new RegExp(/by Mod/g), "by <img src=\"http://www.runescape.com/img/forum/crown_gold.gif\"/>  Mod");
var posts = document.getElementsByTagName('td')[(i*2)+2].innerHTML;
}
}
for(i=0;i<div.length;i++) {
if(div[i].id=="uid") {
var qfc = div[i].innerHTML.replace("Quick find code: ", "");
qfc = qfc.replace(new RegExp(/-/g), ",");
div[i].innerHTML = div[i].innerHTML+"<br />Link: <a href=\"http://forum.runescape.com/forums.ws?"+qfc+"\">http://forum.runescape.com/forums.ws?"+qfc+"</a>";
}
if(div[i].className=="frame wide_e") {
if(window.location.href.substring(window.location.href.length -10)=="/forums.ws" || window.location.href.substring(window.location.href.length -10)=="forums.ws?") {
div[i].innerHTML = div[i].innerHTML.replace('<span style="float: right;">', '<span style="float: right;"><a href="raf.ws">RuneScape Advanced Forum</a> &nbsp; ');
}
var index = window.location.href.indexOf("forums.ws") +10;
var endurl = window.location.href.substring(index);
div[i].innerHTML = div[i].innerHTML.replace(">.", ">, or you can <a href=\"http://forum.runescape.com/forums.ws?"+endurl+"\">view the page while logged out</a>.");
if(div[i].innerHTML.indexOf("You are not logged in")>-1) {
div[i].innerHTML = div[i].innerHTML.replace("You are not logged in", "You are not logged in.");
if(div[i-1].id=="body") {
var gotourl = window.location.href.substring(window.location.href.indexOf("forums.ws"));
var form = "<table><tbody><tr><td>&nbsp;Quick log in form:</td><td align=\"right\"><form autocomplete=\"off\" method=\"post\" action=\"https://forum.runescape.com/login.ws\"><input type=\"text\" maxlength=\"12\" name=\"username\" size=\"20\" onclick=\"if(this.value=='Username') this.value='';\" value=\"Username\"/>&nbsp;<input type=\"password\" maxlength=\"20\" name=\"password\" size=\"20\" onclick=\"if(this.value=='Password') this.value='';\" value=\"Password\"/>&nbsp;<input type=\"submit\" onclick=\"if(this.value=='Quick Login') this.value='Loading...';\" value=\"Quick Login\"/><input type=\"hidden\" value=\""+gotourl+"\" name=\"dest\"/></form></td></tr></tbody></table>";
div[i-1].innerHTML = div[i-1].innerHTML.replace("<br>", "<div style=\"background-color: black; opacity: 0.5; color: white; border-color: black; font-size: x-small;\" class=\"actions\">"+form+"</div><br>");
}
}
if(window.location.href.substring(window.location.href.length -10)=="/forums.ws" || window.location.href.substring(window.location.href.length -10)=="forums.ws?") {
if(div[i].innerHTML.indexOf("You are not logged in")==-1) {
var code = '<BR><DIV class="frame wide_e"><IFRAME src="http://www2.cbox.ws/box/?boxid=1610373&amp;boxtag=6719&amp;sec=main" marginheight="2" marginwidth="2" name="cboxmain" style="border: 0px solid ;" id="cboxmain" frameborder="0" height="100" scrolling="auto" width="100%"></IFRAME><BR><form name="cbox" target="cboxmain" action="http://www2.cbox.ws/box/index.php?boxid=1610373&boxtag=6719&sec=submit" method="post"><table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"><tr><td colspan="2" height="100%" id="tblmid"><input type="hidden" name="key" value="170a4caa5ce4a7d055fb3ebe593bc321"><input type="hidden" name="nme" value="'+username.replace(username.charAt(username.length -1), "")+'"> <input type="hidden" name="eml" value=""> <input type="text" maxlength="200" name="pst" size="123" value="Type a message here" style="background-color:#000000;border:1px solid #382418;color:#FFFFFF;font-family:Arial,sans-serif;font-size:8pt;" onclick="if(this.value==\'Type a message here\') this.value=\'\';">&nbsp;<input type="submit" value="Post" name="sub" style="background-color:#000000;border:1px solid #382418;color:#FFFFFF;font-family:Arial,sans-serif;font-size:8pt;">&nbsp;<input type="button" value="Refresh" onClick="cboxmain.location=\'http://www2.cbox.ws/box/index.php?boxid=1610373&boxtag=6719&sec=main\'" style="background-color:#000000;border:1px solid #382418;color:#FFFFFF;font-family:Arial,sans-serif;font-size:8pt;"></td></tr></table></form></DIV>';
div[i-1].innerHTML = div[i-1].innerHTML.replace('<br>', code+'<br>');
} else {
var code2 = '<BR><DIV class="frame wide_e"><IFRAME src="http://www2.cbox.ws/box/?boxid=1610373&amp;boxtag=6719&amp;sec=main" marginheight="2" marginwidth="2" name="cboxmain" style="border: 0px solid ;" id="cboxmain" frameborder="0" height="100" scrolling="auto" width="100%"></IFRAME></DIV>';
div[i-1].innerHTML = div[i-1].innerHTML.replace('<br>', code2+'<br>');
}
}
}
if(div[i].id=="top") {
if(username!="") {
var highlightindex = window.location.href.indexOf(",highlight");
var newwindowlocation = window.location.href;
if(highlightindex>-1) {
newwindowlocation = newwindowlocation.replace(window.location.href.substring(highlightindex), "");
}
newwindowlocation = newwindowlocation.replace(",goto,"+newwindowlocation.charAt(newwindowlocation.length -1), "");
var form2 = "<a href=\""+newwindowlocation+",&showuser="+username+"\"><img src=\"http://www.runescape.com/img/forum/cmdicons/code_of_conduct.gif\"/> My posts</a>";
div[i].innerHTML = div[i].innerHTML.replace("Reply</a></li>", "Reply</a></li>&nbsp;<li>"+form2+"</li>");
}
}
if(div[i].className=="msgcreator uname") {
if(div[i].innerHTML.indexOf(">")>-1) {
var index = div[i].innerHTML.indexOf(">");
postername = div[i].innerHTML.substring(index +8);
} else {
postername = div[i].innerHTML.substring(1);
}
}
if(div[i].className=="modtype") {
if(div[i].innerHTML=="" && postername!="") {
div[i].innerHTML = "Forum User";
}
}
if(div[i].className=="msgcommands") {
var index2 = window.location.href.indexOf(",highlight");
var newwindowlocation = window.location.href;
if(index2>-1) {
newwindowlocation = newwindowlocation.replace(window.location.href.substring(index2), "");
}
if(div[i].innerHTML.indexOf("Edit")>-1) {
var postid;
if(window.location.href.indexOf(",bump")>-1 || showuser>-1) {
postid = ((i-14) / 5) +1;
} else {
postid = ((i-13) / 5) +1;
}
if(table[postid].className.indexOf("msghighlight")>-1) {
table[postid].className="message moved msghighlight";
} else {
table[postid].className="message moved";
}
}
}
if(div[i].className=="msgtime") {
var index2 = window.location.href.indexOf(",highlight");
var newwindowlocation = window.location.href;
if(index2>-1) {
newwindowlocation = newwindowlocation.replace(window.location.href.substring(index2), "");
}
var index4 = newwindowlocation.indexOf("forums.ws");
var newwindowlocation2 = newwindowlocation.replace(newwindowlocation.substring(index4), "");
if(postername!="") {
postername = postername.substring(0);
postername = postername.replace(postername.charAt(postername.length -1), "");
var showuserurl;
if(showuser==-1) { showuserurl = "<li><a href=\""+newwindowlocation+",&showuser="+postername+"\"><img src=\"http://www.runescape.com/img/forum/cmdicons/code_of_conduct.gif\"/> Show Posts</a></li>".replace(",bump", ""); } else { showuserurl = ""; }
div[i].innerHTML = "<ul class=\"flat\">"+showuserurl+"<li><a href=\"http://hiscore.runescape.com/hiscorepersonal.ws?user1="+postername+"\"><img src=\"http://www.runescape.com/img/forum/cmdicons/search_threads.gif\"/> View Stats</a></li><li><a href=\""+newwindowlocation2+"users.ws?searchname="+postername+"&lookup=main\"><img src=\"http://www.runescape.com/img/forum/cmdicons/my_profile.gif\"/> View Profile</a></li></ul>"+div[i].innerHTML;
if(div[i-1].innerHTML.indexOf("Edit")>-1) {
div[i-1].innerHTML = div[i-1].innerHTML.replace("Edit", "Edit Post");
var editpost = div[i-1].innerHTML.split("<br>");
var editpost2 = div[i-1].innerHTML.substring(div[i-1].innerHTML.indexOf("&nbsp;"), div[i-1].innerHTML.indexOf("<br>") +5);
editpost[0] = editpost[0].replace(">", "<img src=\"http://www.runescape.com/img/forum/cmdicons/refresh.gif\"/> ");
editpost[0] = editpost[0].replace("&nbsp; &nbsp; ", "");

div[i].innerHTML = div[i].innerHTML.replace("Profile</a></li>", "Profile</a></li><li>"+editpost[0].substring(1)+"</li>");
div[i-1].innerHTML = div[i-1].innerHTML.replace(editpost2, "");
}
}
}
if(div[i].className=="msgcontents") {
if(div[i].innerHTML.substring(0)==div[i].innerHTML.charAt(0)+"The contents of this message have been hidden"+div[i].innerHTML.charAt(div[i].innerHTML.length -1)) {
div[i].innerHTML = "<span style=\"color:#FF4500\">A moderator has removed this message.</span>";
}
if(div[i].innerHTML.indexOf(">Click here to view the thread</a>")>-1) {
var movedforumindex = div[i].innerHTML.indexOf("<a href=\"") +9;
var movedforumindex2 = div[i].innerHTML.indexOf("\">") ;
var movedforumurl = div[i].innerHTML.substring(movedforumindex, movedforumindex2);
movedforumurl = movedforumurl.replace(movedforumurl.substring(movedforumurl.indexOf("ws?") +9), "thd,"+movedforumurl.substring(movedforumurl.indexOf("ws?") +9));
div[i].innerHTML = div[i].innerHTML.replace("This thread has been moved to the", "<span style=\"color:#0045FF\">A moderator has moved this thread to the <a href=\""+movedforumurl+"\">");
div[i].innerHTML = div[i].innerHTML.replace(" forum", "</a> forum.</span>");
}
var qfcsplit = div[i].innerHTML.split(": ");
for(split=0;split<qfcsplit.length;split++) {
var line = qfcsplit[split].substring(qfcsplit[split].length -4, qfcsplit[split].length);
if(line=="Code" || line=="code" || line=="CODE") {
var qfc = qfcsplit[split +1].substring(0, 18);
qfc = qfc.replace(new RegExp(/ /g), "");
var qfc2 = qfc.replace(new RegExp(/-/g), ",");
div[i].innerHTML = div[i].innerHTML.replace("Quick find code: "+qfc, "Quick find code: <a href=\"forums.ws?"+qfc2+"\">"+qfc+"</a>");
//var qfclink = div[i].innerHTML.substring(div[i].innerHTML.indexOf(": ") +2, div[i].innerHTML.indexOf("<br>") -1);
//div[i].innerHTML = div[i].innerHTML.replace("Quick find code: "+, "Quick find code: <a href=\"forums.ws?"+qfc+"\">"++"</a>");
}
}
}
}
}
}
}