User talk:Klexur/Userscripts

From The Urban Dead Wiki

Jump to: navigation, search
Klexur's Userscripts
Don't forget to close the Subject field with }}.

UD PK Reporter/Private

Nice PK reporting scripts. I noticed that when you use private PK Reporter, your AP, HP and Inventory remain hidden in the game screen after the witness is taken. They come back after a refresh but was just wandering if that is just the way it is or some other way around it. Only down side is that refreshing the map takes IP hits. ~Vsig.png 03:52, 23 June 2012 (UTC)

Nice catch, I actually just wrote that an hour ago. I'll see about replacing the values after submitting to Dumbwit. --Klexur 03:59, 23 June 2012 (BST)
That would be good. It's not thaaaat big of a deal. There is another issue, though. If this script is enabled and you perform a regular dumwit, it will still open a window to report to RG. Nice if that all you intend to use dumwit for but not so nice if you just want to post the wit somewhere else. I'm going to keep the script and just enable it when I want to make an RG report (it really does take a lot of work out of it). If you end up updating the script, though, please let me know. Thanks. ~Vsig.png 04:56, 23 June 2012 (UTC)

What about the players who like to hold onto reports for a few days before submitting them? RG has a two week deadline to submit PK reports. --•▬ ▬••▬ • •••• •▬ ▬•▬• ▬•▬ #nerftemplatedsigs 06:52, 23 June 2012 (BST)

What about them? =P I'll be making another version which will only hide HP, AP, and Inventory then make the Dumbwit report. It won't automatically submit it to RG. --Klexur 16:30, 23 June 2012 (BST)
What about those using Aichon's Barrista, which turns the HP/AP stuff into a bar at the top left of the page? --•▬ ▬••▬ • •••• •▬ ▬•▬• ▬•▬ #nerftemplatedsigs 18:07, 23 June 2012 (BST)
He would have to specifically code it to remove the numbers from Barrista, which shouldn't be too bad with some simple XPath code, given that Barrista's structure for that portion never changes, meaning he wouldn't need to consider any edge cases. Aichon 19:08, 23 June 2012 (BST)

Updated for Aichon's new Barrista. --Klexur 06:48, 29 June 2012 (BST)

I plan on phasing these scripts out and simply incorporating their functionality into UD Dumbwit Privacy within the next few days. The newer Dumbwit Privacy will still perform as it does now but will in addition add a button to the viewed Dumbwit report that will submit it to the RG. The reasoning behind this is that the code is nearly identical between them already and if people don't want private Dumwits they can just use the original bookmarklet. --Klexur 05:51, 4 September 2012 (BST)

UD Map Skinner

For some reason its not displaying cathedral skins. An oversight, or a lack of images from the original incarnation? --Rosslessness 13:57, 23 June 2012 (BST)

UDTool never had skins for cathedrals. I think the Zookeepers' map skins are just a bit better, although it breaks a few of Aichon's scripts... --•▬ ▬••▬ • •••• •▬ ▬•▬• ▬•▬ #nerftemplatedsigs 14:04, 23 June 2012 (BST)
That's correct, there were not images for cathedrals. I could make a version with the Zookeepers' images if you locate them for me. --Klexur 16:30, 23 June 2012 (BST)
It's one of Ray3K's scripts. --•▬ ▬••▬ • •••• •▬ ▬•▬• ▬•▬ #nerftemplatedsigs 18:09, 23 June 2012 (BST)
Ah, right. Is he even still active? --Klexur 19:17, 23 June 2012 (BST)
I really don't know. You'll have to check in with the Zookeepers on that. All I know is his map skins script breaks sone of Aichon's stuff. --•▬ ▬••▬ • •••• •▬ ▬•▬• ▬•▬ #nerftemplatedsigs 21:18, 23 June 2012 (BST)
Which stuff of mine breaks? I might be able to look into making my stuff more robust for some of that. Aichon 21:58, 23 June 2012 (BST)
Honestly? I don't even remember. It's been a while since I had Ray's script installed. But I know it broke something. Just can't remember what. But it was definitely one of your scripts, Aich. --•▬ ▬••▬ • •••• •▬ ▬•▬• ▬•▬ #nerftemplatedsigs 23:04, 23 June 2012 (BST)
Sounds like you're sure but not sure. --Klexur 04:54, 24 June 2012 (BST)

UD Dumbwit Privacy

Okay, for those that would like to have their HP, AP, and Inventory hidden before a Dumbwit report and restored after, try this. If you try it, please give feedback.

Side note for Aichon: If you would give the Barrista items IDs it would have made this infinitely easier! =P --Klexur 05:06, 24 June 2012 (BST)

That was actually the VERY first thing I checked when Axe mentioned it, since I did give some of them classes so that they could be manipulated using some of the CSS-altering userscripts out there. Unfortunately, I didn't give any of them IDs. Keep poking me about this if I don't post an updated version of it in the next few days. Aichon 05:13, 24 June 2012 (BST)
Poke =P --Klexur 19:00, 26 June 2012 (BST)
You may need to keep poking me. I'm busy with a few random things after work this week, which may continue to distract me, though there's more than enough time to fix it if I actually remember to do so. Aichon 19:13, 26 June 2012 (BST)
hop too it. i would like this to work with barrista.-- HEY! HANDS OFF MAH BOOBS!   bitch   COBRA!   אמת 22:19, 26 June 2012
I haven't returned home yet for the day, so I can't exactly hop to it. :P As a note to Klexur, I'll give the four objects you're grabbing the IDs "barristahptext", "barristaaptext", "barristahpbar", and "barristaapbar". That should let you code it in advance of whenever I get around to fixing things on my end, which will save your users the hassle of updating two userscripts later. Aichon 22:44, 26 June 2012 (BST)
You know, Aichon, you really wouldn't need to add the IDs. I know I'm late in saying that but my script works perfectly fine without them. I just had some trouble getting the XPaths right (I'm new to them) when I was coding it. =S --Klexur 18:51, 28 June 2012 (BST)
Of this I am aware, but there are a few good reasons to do so anyway:
  1. It allows others to script for them too
  2. Future changes to Barrista won't break your script
  3. Future changes to the game won't break your script
  4. You need to change your code anyway (more on that in next edit)
Mainly I'm concerned with #2 and #3. While your current XPath does work, the fact that it's so explicit while using very generic elements means that it's very likely to break at the slightest tweak either to the game or Barrista. Aichon 20:26, 28 June 2012 (BST)

In glancing at your code, I noticed that it has the potential for a few issues. I don't think they're actually causing any problems, but I thought I'd point them out in case you're interested:

  1. When you're checking to see if Barrista exists, using .snapshotitem(0) at the end of the line will throw exceptions when no snapshotitems are returned (as would be the case when Barrista exists). Admittedly, it's a bad practice still found in some of my userscripts, but the better way to handle it is to not use .snapshotitem(0) until you know that an item exists, and instead use .snapshotLength > 0 in your if statement to check for them. That issue is in a few places.
  2. If you want to check for Barrista, it'd be better if you checked for it, rather than checking for the lack of something it removes, since other userscripts may remove the gt div as well. I'll add a "barrista" id for the outermost barrista div when I make my changes, that way it's easier to check for.
  3. When you try to grab HP from Barrista, you have "//" in the XPath code, which means that the div does not need to be an immediate child of body. As a result, other divs may be grabbed in addition to the correct one. By itself that isn't a problem, but because you're using UNORDERED_NODE, we can't say for sure which one will be .snapshotitem(0) vs. .snapshotitem(1) and so on, but you're always using .snapshotitem(0). That means you may end up using the wrong div in some cases. Switching it to ORDERED_NODE or just a "/" should fix the issue, I think (ideally the latter, since ORDERED_NODE is slower than UNORDERED_NODE).

Anyway, keep using XPath, since all of the major browser vendors have done heavy optimization around it, meaning that it's very fast compared to things like GetElementById. Aichon 20:44, 28 June 2012 (BST)

That has got to be the most detailed and informative glance I've heard of in my life. THANK YOU! I'll try to have this updated in the next few days. Please feel free to continue glancing. --Klexur 21:14, 28 June 2012 (BST)
Lol, well, I just looked at the code related to Barrista to see if there were any other IDs that could help, and that's when I saw loads of divs, which got me looking a bit more closely, though I still only looked at the stuff related to Barrista. :P Aichon 01:03, 29 June 2012 (BST)
Well it's a good thing you did because it made me look back over the rest. I must have been real tired when I "finished" it because I also found unused code and some redundancy. -_- I cleaned it up and will upload the id version once you finish yours so that they will match. --Klexur 01:23, 29 June 2012 (BST)
Updated Barrista, finally. Let me know if I did something stupid like misspell an ID. :P Aichon 01:48, 29 June 2012 (BST)
Uploaded mine as well. --Klexur 06:48, 29 June 2012 (BST)

I have but a quick question for those that use this: Who would like the encumbrance percentage hidden as well? --Klexur 20:45, 30 July 2012 (BST)

See UD PK Reporter/Private for upcoming update. --Klexur 05:53, 4 September 2012 (BST)

So I think this script might actually be broken now. I'll have to see about doing something about this if anybody actually cares. --Klexur 06:34, 3 May 2014 (UTC)

Right now, it runs only on Can you change this to use the newer version located at I'd prefer using that newer version with the location multi-select function, see. :") --•▬ ▬••▬ • •••• •▬ ▬•▬• ▬•▬ #nerftemplatedsigs 19:44, 25 August 2012 (BST)

Sorry about that! I should have remembered to update this when I updated DSS Map Skinner with the new site URL. Fixed now. --Klexur 00:55, 26 August 2012 (BST)

I hope it's alright that I modified my install of UD Dumbwit Privacy!

Hello there! Sorry that this is so random, but I am relieved to know you're still around! I modified your UD Dumbwit Privacy script when was out of service, to submit to, which is run by DoXBr (previously with the Fortress.) There are still some things I have to fix (such as something that makes it parse spaces as mojibake/gibberish symbols,) and I might also have to remove the option to submit to the Rogues Gallery at, which is also currently out of service. I am happy to provide this, if ever, and I might also try to fix it, to make it work with the reinstated Dumbwit service. Sorry for my English; it's my third language, and thank you very much again for producing the script! --Unpax pax. Unslave slave. Unknow power. BB watch you. (stalk · KT · FoD · UT) 10:16, 3 May 2014 (UTC)

Cool. I don't mind at all that you modified it fit your needs, if fact I encourage that. I put these scripts out to benefit the community so what ever works best I'll support, so long as it is fair to everyone. I have been rather lax on checking in so I apologize for not maintaining this better but if you have a working version I'd love to see the code and update my links so that there is a publicly available working version again. --Klexur 17:22, 3 May 2014 (UTC)
Thank you very much! And it's alright, I understand -- that you even checked back and replied to me is more than I expected! The Rogues Gallery site no longer works (the account it is hosted in seems to be suspended,) so I've removed the parts of the code related to RG submission. Said shoddy edit made to work for the iSpy screenshot service is here, but I can't figure out how to make it stop parsing spaces in character names as "�" instead of  . It took this long because I almost got my hosting account terminated for uploading a .user.js file to it. Thanks again! --Si vis pacem, para bellum. (stalk · KT · FoD · UU) 04:45, 9 June 2014 (UTC)
Personal tools
project wonderful