Script Issue.

View: New views
1 Messages — Rating Filter:   Alert me  

Script Issue.

by Tratz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I'm trying to use a script for a text based game to filter out some
redundant lines on the bounty hunter's page. This script is working
for other players but it's not for me and I think greasemonkey has
something to do with it.

When I install the script it appears as "enabled" in the manage
scripts page but when I right click the little greasemonkey logo at
the top it says "No Scripts Installed!"

I'm using firefox 3.5.5 and have installed (and reinstalled) the
latest version of greasemonkey and also reinstalled the script. Here's
the code if you need it

// ==UserScript==
// @name           Bounty Filter
// @namespace      Demented_Clown
// @description    Removes jail, hospital and travelling entries from
bounties
// @include        http://www.torncity.com/bounties.*
// @include        http://www.torn.com/bounties.*
// @include        http://torncity.com/bounties.*
// @include        http://torn.com/bounties.*



function removeXpath() {
// Search the font tag inside each TD for text we dont want
// For each instance of text we dont want we delete the parent of TD
// In this case thats the entire TR

    var hospital = document.evaluate("//font[(contains(text
(),'Hospital'))]/parent::*/
parent::*",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
    for (var i=0; i<hospital.snapshotLength; i++) {
        element = hospital.snapshotItem(i);
        element.parentNode.removeChild(element);
    }
    var traveling = document.evaluate("//font[(contains(text
(),'Traveling'))]/parent::*/
parent::*",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
        for (var i=0; i<traveling.snapshotLength; i++) {
            element = traveling.snapshotItem(i);
            element.parentNode.removeChild(element);
    }
    var jail = document.evaluate("//font[(contains(text(),'Jail'))]/
parent::*/
parent::*",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
        for (var i=0; i<jail.snapshotLength; i++) {
            element = jail.snapshotItem(i);
            element.parentNode.removeChild(element);
    }
}

document.addEventListener("DOMNodeInserted", removeXpath, false) ;

// ==/UserScript==


Please help if you can!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To post to this group, send email to greasemonkey-users@...
To unsubscribe from this group, send email to greasemonkey-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---