User Functions
Don't have an account yet? Sign up as a New User
Lost your password?
|
Enquirer Home Page | Twitter | Back to Improbable Island
Devin |
 |
Monday, August 16 2010 @ 01:56 AM UTC (Read 26707 times) |
|
|

Contestant
Status: offline
Registered: 06/17/10
Posts: 30
|
I made a Greasemonkey script that adds a second experience bar below the first, which fills up toward the point where you get hunted down by your dojo master. It works on my system, so I figured I'd share.
PHP Formatted Code // ==UserScript==
// @name Improbable Truancy Meter
// @namespace http://www.shadedraco.com/improbabletruancy
// @include http://improbableisland.com/*
// ==/UserScript==
var CharInfo = document.evaluate ("//table[@class='charinfo']", document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;
if (CharInfo ) {
var LevelRow = document.evaluate ("//td[@class='charinfo']/b/span[@class='colLtWhite'][text()='Level']/../../..", CharInfo, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;
if (LevelRow ) {
var Level = new Number (LevelRow.cells [1].childNodes [0].childNodes [0].textContent );
var ExperienceRow = LevelRow.parentNode.rows [LevelRow.rowIndex +1];
var ExperienceMatch = ExperienceRow.cells [1].childNodes [0].childNodes [0].textContent.match (/^ ([\d, ]+ )\/ ([\d, ]+ )$/ );
var Experience = new Number (ExperienceMatch [1].replace (/,/g, ''));
var ExperienceNextLevel = new Number (ExperienceMatch [2].replace (/,/g, ''));
var ExperienceTable = {
1 : 0,
2 : 100,
3 : 400,
4 : 1002,
5 : 1912,
6 : 3140,
7 : 4707,
8 : 6641,
9 : 8985,
10 : 11795,
11 : 15143,
12 : 19121,
13 : 23840,
14 : 29437,
15 : 36071,
16 : 43930,
17 : 43930, // Doesn't actually exist, but I needed to put something here
};
var DKs = (ExperienceNextLevel - ExperienceTable [Level +1]) / Level / 25;
var ExperienceThisLevel = ExperienceTable [Level ] + ((Level -1) * DKs * 25);
var ExperienceTruancy = ExperienceTable [Level +2] + ((Level +1) * DKs * 25);
var TruancyBarWidth = ((Experience - ExperienceNextLevel ) / (ExperienceTruancy - ExperienceNextLevel )) * 100;
if (TruancyBarWidth < 0) TruancyBarWidth = 0;
if (TruancyBarWidth > 100) TruancyBarWidth = 100;
var RemainderWidth = 100 - TruancyBarWidth;
ExperienceRow.cells [1].innerHTML +=
"<span class='colLtYellow'>" +
"<table style='border: solid 1px #000000;' bgcolor='red' cellpadding='0' cellspacing='0' width='70' height='5'><tr><td width='"+TruancyBarWidth+ "%' bgcolor='"+ (Experience>=ExperienceTruancy? 'blue': 'white')+ "'></td><td width='"+RemainderWidth+ "%'></td></tr></table>" +
"</span>";
}
}
|
|
|
|
bl0b |
 |
Monday, August 16 2010 @ 03:20 AM UTC |
|
|

Contender
Status: offline
Registered: 06/19/10
Posts: 66
|
Umm, not working for me. Don't know what I might be doing wrong.
Got Greasemonkey, restarted firefox, saved the script as test.user.js , opened it and greasemonkey recognised it. Went under Tools -> Greasemonkey to check it's enabled and the script is running and restarted firefox again.
Running fresh-from-the-box ubuntu 10, so it might need a bit of tweaking first, but javascript seems to be working ok.
Going to try windows later and report on results
|
|
|
|
Devin |
 |
Monday, August 16 2010 @ 04:58 AM UTC |
|
|

Contestant
Status: offline
Registered: 06/17/10
Posts: 30
|
Probably some node or another not quite where it expects it - the whole thing's a bit of a house of cards with the way it navigates around the document. Let me know if you see anything in the Error Console, that'll probably be a big hint for where we're different.
Oh also, if you're not accessing II through http://improbableisland.com/ (like if you have a www), you might have to add your preferred prefix to the Included Pages section.
|
|
|
|
tehdave |
 |
Monday, August 16 2010 @ 05:51 AM UTC |
|
|

Improbable Badass
 Status: offline
Registered: 12/17/09
Posts: 429
|
for those of us using www.improbableisland.com, add the line
// @include http://www.improbableisland.com/*
in the heading of it. And if anyone's running Ubuntu and doesn't know where the scripts are, they're in ~/.mozilla/firefox/{userid}/gm_scripts
For a fresh greasemonkey install, you can just add a folder named (whatever you want to name the script) and save the code as .user.js
Also: nifty addition, thanks Devin. Saves having to doublecheck my spreadsheet if I'm actually trying to optimize truancy 
Isn't sanity just a one-trick pony anyway? All you get is one trick: rational thinking.
But when you're good and crazy, oooh, oooh, the sky's the limit.
|
|
|
|
bl0b |
 |
Monday, August 16 2010 @ 07:54 AM UTC |
|
|

Contender
Status: offline
Registered: 06/19/10
Posts: 66
|
This.
Quote by: DevinOh also, if you're not accessing II through http://improbableisland.com/ (like if you have a www), you might have to add your preferred prefix to the Included Pages section.[/p]
Tools -> Greasemonkey -> Manage User Scripts...
Under included pages click add. Address is going to be of the page you're currently on, paste the address and it's sorted. No need to restart firefox either.
Thank you both for help.
The added bar looks good. Nice one.
|
|
|
|
Buddleia |
 |
Wednesday, October 13 2010 @ 05:30 PM UTC |
|
|

Improbable Badass
 Status: offline
Registered: 04/23/10
Posts: 343
|
I downloaded Greasemonkey, set up the script, and ... it's not working. The add-on is enabled, the script is enabled, there are no error messages, everything seems to be fine - but I have no second XP bar, before or after it goes blue.
I'm running Firefox 3.6.8 on Windows 7, and I've tried restarting it and restarting Windows and all sorts of nonsense.
What totally obvious thing have I missed?
Improbable Reference Links - goo.gl/MRBnb --------------
Land Registry (map of Places) ---- goo.gl/bpkRR
|
|
|
|
Maniak |
 |
Wednesday, October 13 2010 @ 05:36 PM UTC |
|
|

Improbable Badass
Status: offline
Registered: 10/11/10
Posts: 298
|
Quote by: BuddleiaI downloaded Greasemonkey, set up the script, and ... it's not working. The add-on is enabled, the script is enabled, there are no error messages, everything seems to be fine - but I have no second XP bar, before or after it goes blue.
I'm running Firefox 3.6.8 on Windows 7, and I've tried restarting it and restarting Windows and all sorts of nonsense.
What totally obvious thing have I missed?
Do you access Improbable Island on http://www.improbableisland.com or on http://improbableisland.com? Read the other posts in this thread, there is something relating to that. I got it working here after adding the extra www.
http://maniak.cu.cc/
|
|
|
|
Devin |
 |
Wednesday, October 13 2010 @ 06:38 PM UTC |
|
|

Contestant
Status: offline
Registered: 06/17/10
Posts: 30
|
Quote by: ManiakDo you access Improbable Island on http://www.improbableisland.com or on http://improbableisland.com? Read the other posts in this thread, there is something relating to that. I got it working here after adding the extra www.
Yeah, that's what it most commonly is. Here's a fixed version that defaults to using both:
http://gist.github.com/624609
I've been thinking about compressing the extra bar into a different-colored layer over the first, like Reverb suggested on the other thread. Maybe a nice cyan over the darker blue.
|
|
|
|
Buddleia |
 |
Wednesday, October 13 2010 @ 08:32 PM UTC |
|
|

Improbable Badass
 Status: offline
Registered: 04/23/10
Posts: 343
|
I use www, but I've got both in the script header, with T'Dave's extra line. Like so
Improbable Reference Links - goo.gl/MRBnb --------------
Land Registry (map of Places) ---- goo.gl/bpkRR
|
|
|
|
Maniak |
 |
Wednesday, October 13 2010 @ 09:39 PM UTC |
|
|

Improbable Badass
Status: offline
Registered: 10/11/10
Posts: 298
|
Quote by: Devin
Yeah, that's what it most commonly is. Here's a fixed version that defaults to using both:
http://gist.github.com/624609
I've been thinking about compressing the extra bar into a different-colored layer over the first, like Reverb suggested on the other thread. Maybe a nice cyan over the darker blue.
Could you also be as awesome to add the number for the next level to it as well? Sometimes I'm really close to truancy and I'd like to know if I can do 1 or 2 more jungle fights and use the Dojo for healing. Staring at one or two pixels on the bar is rather unclear. A fixed number is more obvious.
And thanks for making this awesome script.
http://maniak.cu.cc/
|
|
|
|
Devin |
 |
Wednesday, October 13 2010 @ 09:58 PM UTC |
|
|

Contestant
Status: offline
Registered: 06/17/10
Posts: 30
|
Quote by: BuddleiaI use www, but I've got both in the script header, with T'Dave's extra line. Like so
Hmm. Well, if it was originally installed without the extra line, it may still not have it under Included Pages on the Manage User Scripts page. If it is there, I'm not sure. Does it show up at the top of the menu when you right click the GreaseMonkey icon, or does it say nothing's installed?
|
|
|
|
Buddleia |
 |
Thursday, October 14 2010 @ 09:48 AM UTC |
|
|

Improbable Badass
 Status: offline
Registered: 04/23/10
Posts: 343
|
Well, whatdoyaknow, it's working now. I right-clicked on the icon, it said Greasemonkey is enabled and the truancy meter was ticked for enabled, and nothing happened. But then I left-clicked, the icon turned brown instead of grey, and suddenly I has new XP bar. I don't understand, but then, with computers, do you ever? It's working! Thank you!
Improbable Reference Links - goo.gl/MRBnb --------------
Land Registry (map of Places) ---- goo.gl/bpkRR
|
|
|
|
tehdave |
 |
Thursday, October 14 2010 @ 03:33 PM UTC |
|
|

Improbable Badass
 Status: offline
Registered: 12/17/09
Posts: 429
|
Quote by: BuddleiaWell, whatdoyaknow, it's working now. I right-clicked on the icon, it said Greasemonkey is enabled and the truancy meter was ticked for enabled, and nothing happened. But then I left-clicked, the icon turned brown instead of grey, and suddenly I has new XP bar. I don't understand, but then, with computers, do you ever? It's working! Thank you!
Yeah, greasemonkey was enabled but was toggled off. The monkey's gotta be in color (He's B&W sad if he's not being used)
Isn't sanity just a one-trick pony anyway? All you get is one trick: rational thinking.
But when you're good and crazy, oooh, oooh, the sky's the limit.
|
|
|
|
Tahvohck |
 |
Wednesday, November 10 2010 @ 08:50 AM UTC |
|
|

Contender
Status: offline
Registered: 10/15/10
Posts: 65
|
Awesome, finally found a GM script that works with Improbable Island. Anyone know of any others?
|
|
|
|
Devin |
 |
Tuesday, November 16 2010 @ 05:52 PM UTC |
|
|

Contestant
Status: offline
Registered: 06/17/10
Posts: 30
|
I haven't gotten around to dinking with the truancy meter again (I do like the ideas for enhancing it), but to help assuage my guilt, here's another script I've been using privately for quite a while. It adds a "what danquest are you on, and have you finished it" section to your stats without putting the load on the server like a php solution would. It recognizes nearly every quest-related event (I think it might be missing one or two varieties of you-found-an-item still). The name of the quest critter will be bold if it's the Big Bad Guy of the chain.
https://gist.github.com/702161
|
|
|
|
Maniak |
 |
Tuesday, November 16 2010 @ 09:11 PM UTC |
|
|

Improbable Badass
Status: offline
Registered: 10/11/10
Posts: 298
|
Nice. Glad that this exists now.
One small suggestion. It won't pick up my current quest. Not even after visiting the PSK.
You decide to ask Dan if he has heard any rumors.
He stares at you for a moment.
"What?" Dan leans over the bar towards you. "Did I hear you correctly? You want me to set you off on another crazy adventure, when you've not even finished the one you're already on?"
He smirks. "I'll bet you've not even gone to AceHigh yet."
Feeling kind of embarrassed, you wonder if you should ask Dan if you can start another mission, or if you should get on with the one that you're already on.
Another suggestion, or more a question. Does this show if you've collected your reward or not? Would be great if it could tell me that the quest is finished but that there is still a reward waiting.
http://maniak.cu.cc/
|
|
|
|
Tahvohck |
 |
Tuesday, November 16 2010 @ 09:14 PM UTC |
|
|

Contender
Status: offline
Registered: 10/15/10
Posts: 65
|
Here's my own modifications to the Truancy script:
PHP Formatted Code // ==UserScript==
// @name Improbable Island Xp Bar
// @namespace http://www.shadedraco.com/improbabletruancy
// @include http://*improbableisland.com/*
// ==/UserScript==
var CharInfo = document.evaluate ("//table[@class='charinfo']", document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;
if (CharInfo ) {
var LevelRow = document.evaluate ("//td[@class='charinfo']/b/span[@class='colLtWhite'][text()='Level']/../../..", CharInfo, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;
if (LevelRow ) {
var Level = new Number (LevelRow.cells [1].childNodes [0].childNodes [0].textContent );
var ExperienceRow = LevelRow.parentNode.rows [LevelRow.rowIndex +1];
var ExperienceMatch = ExperienceRow.cells [1].childNodes [0].childNodes [0].textContent.match (/^ ([\d, ]+ )\/ ([\d, ]+ )$/ );
var Experience = new Number (ExperienceMatch [1].replace (/,/g, ''));
var ExperienceNextLevel = new Number (ExperienceMatch [2].replace (/,/g, ''));
var ExperienceTable = {
1 : 0,
2 : 100,
3 : 400,
4 : 1002,
5 : 1912,
6 : 3140,
7 : 4707,
8 : 6641,
9 : 8985,
10 : 11795,
11 : 15143,
12 : 19121,
13 : 23840,
14 : 29437,
15 : 36071,
16 : 43930,
17 : 43930, // Doesn't actually exist, but I needed to put something here
};
var DKs = (ExperienceNextLevel - ExperienceTable [Level +1]) / Level / 25;
//The various bars.------------------------------------------------
//Truancy
var ExperienceThisLevel = ExperienceTable [Level ] + ((Level -1) * DKs * 25);
var ExperienceTruancy = ExperienceTable [Level +2] + ((Level +1) * DKs * 25);
var TruancyBarWidth = ((Experience - ExperienceNextLevel ) / (ExperienceTruancy - ExperienceNextLevel )) * 100;
if (TruancyBarWidth < 0) TruancyBarWidth = 0;
if (TruancyBarWidth > 100) TruancyBarWidth = 100;
var RemainderWidth = 100 - TruancyBarWidth;
if(Experience >= ExperienceNextLevel ) {
ExperienceRow.cells [1].innerHTML +=
"<span class='colLtYellow'>" +
"<table style='border: solid 1px #000000;' bgcolor='black' cellpadding='0' cellspacing='0' width='70' height='5'><tr><td width='"+TruancyBarWidth+ "%' bgcolor='"+ (Experience>=ExperienceTruancy? '#00D000': 'white')+ "'></td><td width='"+RemainderWidth+ "%'></td></tr></table>" +
"</span>"; }
/*//Overall
var ExperienceWin = ExperienceTable[15] + (14 * DKs * 25);
var OverallWidth = (Experience / (ExperienceWin)) * 100;
var OverRemaining = 100 - OverallWidth;
LevelRow.cells[1].innerHTML +=
"<span class='colLtYellow'>" +
"<table style='border: solid 1px #000000;' bgcolor='red' cellpadding='0' cellspacing='0' width='70' height='5'><tr><td width='"+OverallWidth+"%' bgcolor='"+(Experience>=ExperienceWin?'#00D000':'white')+"'></td><td width='"+OverRemaining+"%'></td></tr></table>" +
"<br/></span>";
//alert(ExperienceWin);*/
}
}
I ended up adding a bit to it so it only shows the second bar if you've gone past what you need for the level you're on, and fiddled with the colors. The part commented out near the bottom--/*//Overall...Win);*/--adds a bar below your level number, showing you how far you have to go to level 15. Just remove the /* and */ to turn that part on.
|
|
|
|
Devin |
 |
Tuesday, November 16 2010 @ 11:14 PM UTC |
|
|

Contestant
Status: offline
Registered: 06/17/10
Posts: 30
|
Quote by: ManiakNice. Glad that this exists now.
One small suggestion. It won't pick up my current quest. Not even after visiting the PSK.
Another suggestion, or more a question. Does this show if you've collected your reward or not? Would be great if it could tell me that the quest is finished but that there is still a reward waiting.
Yeah, I could add the picking up the current quest location after the first installation (going to the PSK would be the only way to get that info though). To your second question, yep, it'll show the quest with the status as "Completed" until you turn it in, after which it'll show no quest until you get a new one.
|
|
|
|
tehdave |
 |
Wednesday, November 17 2010 @ 06:00 AM UTC |
|
|

Improbable Badass
 Status: offline
Registered: 12/17/09
Posts: 429
|
Quote by: DevinI haven't gotten around to dinking with the truancy meter again (I do like the ideas for enhancing it), but to help assuage my guilt, here's another script I've been using privately for quite a while. It adds a "what danquest are you on, and have you finished it" section to your stats without putting the load on the server like a php solution would. It recognizes nearly every quest-related event (I think it might be missing one or two varieties of you-found-an-item still). The name of the quest critter will be bold if it's the Big Bad Guy of the chain.
https://gist.github.com/702161
Is there a way to transfer data between two computers? So I can track it back and forth from work and home?
Isn't sanity just a one-trick pony anyway? All you get is one trick: rational thinking.
But when you're good and crazy, oooh, oooh, the sky's the limit.
|
|
|
|
Devin |
 |
Wednesday, November 17 2010 @ 04:44 PM UTC |
|
|

Contestant
Status: offline
Registered: 06/17/10
Posts: 30
|
Quote by: tehdaveIs there a way to transfer data between two computers? So I can track it back and forth from work and home?
I wish there was, I have a similar issue. All the GM data is stored with other browser settings in prefs.js (A.K.A. about:config), so if you find a good way to synchronize that, this'll go along with it, but I haven't come across any really good solutions.
|
|
|
|
Content generated in: 1.64 seconds |
|
|