Jump to content

Welcome to Rune Tips, the first ever RuneScape help site. We aim to offer skill guides, quest guides, maps, calculators, informative databases, tips, and much more to help you get the most from the Massive Online Adventure Game, RuneScape, by Jagex Ltd © 2009.

Report Ad

Welcome to Forum.Tip.It
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!
Photo

Add instant quest hiding on click for Quests List page.


  • Please log in to reply
1 reply to this topic

#1
GrandZephyr
[ Display Name History ]

GrandZephyr

    Unicorn Horn

  • Members
  • 178 posts
  • Gender:Male
  • Location:#runescape
  • Joined:30 June 2005
  • RuneScape Status:F2P
  • RSN:grandzephyr
  • RSN '07:grandzephyr
May I suggest functionality for the quests page similar to what is achieved using this Greasemonkey script?

This way as soon as a player checkmarks a quest as done, it is hidden and the questid is added to the quests_completed cookie.

// ==UserScript==
// @name           TIPQ
// @namespace      TIPQ
// @description    TIPQ Hider
// @include        http://open.tip.it/quests
// @require        http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
// ==/UserScript==

//Add the functions for cookie handling
function setQuestCookie(questid,action)
{
	var index,key,contents,exists=0
	var cookies=document.cookie.split(";");
	for (index=0; index<cookies.length; index++)
	{
		key=cookies[index].substr(0,cookies[index].indexOf("="));
		key=key.replace(/^\s+|\s+$/g,"");
		contents=cookies[index].substring(cookies[index].indexOf("=")+1,cookies[index].length);
		if (key=="quests_completed")
		{
			exists = 1; //cookie exists, we found it
			contents = unescape(unescape(contents));
			//When a quest is checked, we will add that questid to the cookie
			if(action == "add")
			{
				contents=contents.concat(questid+";");
			}
			//When a quest is unchecked, we will remove that questid from the cookie
			if(action == "remove")
			{
				contents=contents.replace(questid+";","");
			}
		}
	}
	if(exists == 0) // we did not find the cookie
	{
		contents=questid+";";
	}

	//Check if there are any quests hidden, if not remove the cookie
	if(contents != "")
	{
		var expiration=new Date();
		expiration.setDate(expiration.getDate() + 31536000);
		contents = escape(escape(contents)) + "; expires="+expiration.toUTCString();
	} else {
		contents = "; expires=-1";
	}
	document.cookie="quests_completed=" + contents;
}


// Initialize our jQuery once the page is ready
$(document).ready(function()
{
	// When a checkbox is changed, hide it if it was checked, or unhide it if it was unchecked.
	$(':checkbox').change(function()
	{
		if(this.checked){
			$(this).parent().parent().addClass("members");
			$(this).parent().parent().hide();
			setQuestCookie(this.value,"add");
		} else {
			$(this).parent().parent().removeClass("members");
			$(this).parent().parent().show();
			setQuestCookie(this.value,"remove");
		}
	});
});


#2
Tecmaster
[ Display Name History ]

Tecmaster

    The Engineer

  • Members
  • 1,596 posts
  • Gender:Female
  • Joined:8 August 2009
  • RuneScape Status:P2P
  • RSN:TecMaster532
This shouldn't be too hard to implement, I'll look into it.



lm9dzxe3.png
Owner of the Quest Point Cape





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users