Template talk:Useitem

From TheKolWiki
Jump to: navigation, search

So, do we need a meat or mp parameter along with other possible stuff? Or is this good for deployment now?--Dehstil (t|c) 21:12, 27 June 2006 (CDT)

Tattoos

Only tattoos from outfits are currently categorised into Category:Tattoos. This would be the place to autocat usable items that give tattoos. I'd say keep everything else as is, but just add a conditional category link if the type is tattoo. I had a quick look at adding "if type=tattoo link to category" but the curly brackets confounded my poor brain. Anyone want to have a go? many thanks in advance. --Evilkolbot (talk) 11:27, 20 June 2019 (UTC)

  • I made the template check for the presence of "You have unlocked a new tattoo" in the posteffect and effect fields, and if so autocat it as a tattoo. Might over-categorize...will have to wait and see what gets added to the category. --Fig bucket (talk) 21:39, 20 June 2019 (UTC)
    • yay! thanks. i was trying to work out my score. noticed the tattoo category was lacking. less now, though. splendid. --Evilkolbot (talk) 21:55, 20 June 2019 (UTC)
    • looking at Category:Tattoos it seems that this change is, indeed, overcategorising items. it seems if posteffect or effect start with the word "You" then they get categorised as a tattoo. Puzzling. --Evilkolbot (talk) 11:15, 15 September 2019 (UTC)
      • I tracked that down to a limitation on the length of the string being searched. For longer effects (and/or posteffects), the #pos: template searching the string returns an error (apparently it is limited to 1000 characters) instead of its normal offset or empty-string results, and that's then interpreted as a successful match for the tattoo string. I added a check for the error return and do not categorize if so, which should eliminate the false positive issue, but unfortunately that means we may now have false negatives, and miss a categorization if the effect text is long. But at least then manual categorization can be used to fix it. --Fig bucket (talk) 16:24, 15 September 2019 (UTC)

In-game html

Just posting some in-game html for future reference:


<style>
body {
	font-family: Arial, Helvetica, sans-serif;
	background-color: white;
	color: black;
}
td {
	font-family: Arial, Helvetica, sans-serif;
}
a:link {	color: black; }
a:visited {	color: black; }
a:active {	color: black; }
.tiny { font-size: 8pt; }
.small { font-size: .8em; }
.nounder { text-decoration: none; }
input.text, textarea {
	border: 1px black solid;
	font-family: Arial, Helvetica,  sans-serif;
	font-size: 10pt;
}
input.button {
	border: 2px black solid;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10pt;
	font-weight: bold;
	background-color: #FFFFFF;
}

div.rcm {
	position: absolute;
	font-family: Arial;
	font-size: 10pt;
	border: 1px solid black;
	background: white;
	display: none;
}

p.rcm {
   cursor: pointer;
   background-color: white;
   margin: 0px;
   padding: 0px 2px;
}

p.rcm:hover {
   background-color: #ccccff;
}
img.hand {
   cursor: pointer;
/*
   cursor: hand;
*/
   border: 0px;
   height: 30px;
   width: 30px;
}
.black,.red {
   font-weight: bold;
   color: black;
   font-size: smaller;
}
.red {
   color: red;
}
img.item {
   border: 0px;
   height: 30px;
   width: 30px;
   vertical-align: middle;
}
div.effect td.effect { font-size: 8pt; }
</style>

Potion5.gif


You drink the bottles of blood. It tastes like the last time the inside of your mouth was bleeding.

You gain 300 Strengthliness.
You gain some Muscle points!
You gain 148 Magicalness.
You gain some Mysticality points!

Guano.gif


You squish the bat guano around in your hands until it becomes firm. Then you fashion it into a coffee cup and let it dry.

Coffeecup.gifYou acquire an item: guano coffee cup

Disclover.gif


You carefully reassemble your ten-leaf clovers. They seem much luckier now.

Clover.gifYou acquire 2 ten-leaf clovers

--Dehstil (t|c) 13:10, 11 July 2006 (CDT)


When td'd, the "You gain..."s are two close together, example:

You gain 150 Strongness.
You gain 150 Mysteriousness<
You gain 150 Cheek.

When they should look like:

You gain 150 Beefiness.
You gain 150 Enchantedness.
You gain 150 Smarm.

p's get styled with line-height: 1.5em; in their style, td's and div's don't, but they should. --JRSiebz (|§|) 22:04, 14 July 2006 (CDT)

Consume Text

  • There are actually two versions of the consume text: one using a singular amount of an item and one using the plural amount. I'm not sure it uses these plurals, but it's worth mentioning now, during the rollout that the items under the "use multiple" menu ought to get something like "bottle(s) of blood", "[quivering cylinders of] can-shaped cranberry sauce", or "[gibson|carlisles]", if any of those apply.--Dehstil (t|c) 22:42, 14 July 2006 (CDT)
    • So far, I've only found examples of the first case and not the other two.--Dehstil (t|c) 22:44, 14 July 2006 (CDT)

Here are all the use multiples:

These have alternate consume texts.--Dehstil (t|c) 15:01, 21 July 2006 (CDT)

  • I'll just add this here instead of on all those pages or so I don't forget about this or to bump this if it's no good.--Dehstil (t|c) 22:04, 12 August 2006 (CDT)
  • Should whether an item can be used in multiples be said somewhere the item page or no?--Dehstil (t|c) 13:01, 4 November 2006 (CST)

is b0rken?

Something in the table parsing for this template appears to be broken. wikitables frankly give me a headache, so I can't speculate on what's wrong with it, but it's not being rendered properly in many or all of the pages that it's being used on. Could someone take a look? Stubblyhead 17:05, 25 October 2006 (CDT)

  • It looks like the recent upgrade broke a whole lot of templates. Looks like I've got my work cut out for me... --Quietust (t|c) 17:10, 25 October 2006 (CDT)
    • Are there any that are unprotected that I could take a look at? I'd like to help. Stubblyhead 17:52, 25 October 2006 (CDT)
      • You could always view the source of the page and test it in the TheKoLWiki:Sandbox or on this very talk page. Once you figure out what is wrong, one of the admin will be happy to move it to the actual page.--SomeStranger (t|c) 17:54, 25 October 2006 (CDT)
        • Use {{test}} if you need an actual template to work with - the existing contents of that page can be safely discarded. --Quietust (t|c) 21:32, 25 October 2006 (CDT)

Proposal to fill Category:Booze (By Adventures)

Maybe there is already a list out there somewhere and I just missed it, but having this template automagically populate Category:Booze (By Adventures) would be fan-tabulous. It should just be a matter of changing the code below, but this comes with no deposit and no warranty. :) If not, it the information could be added by hand. — MrDolomite • Talk 23:17, 28 December 2007 (CST)

Current code (with indents for readability)
|-
{{#if:
  {{{adv|}}}
  |
  {{!}}align="center"{{!}} {{adv|amount={{{adv}}}
                           }}
}}
Proposed code (with indents for readability)
|- 
{{#if:
  {{{adv|}}} 
  |
  {{!}}align="center"{{!}} {{adv|amount={{{adv}}}
                           }}
  {{#switch:{{{type}}}| booze=[[Category:Booze (By Adventures)|{{{adv}}}, {{PAGENAME}}]]
  }}
}}

Thx. — MrDolomite • Talk 23:17, 28 December 2007 (CST)

  • Wouldn't work, for the reason that the "adv" parameter is only rarely a single number, but more often a range. Also, categories group by the first character, not by the full number, so "1-3" and "14-18" would both show up under "1". If you had suggested autopopulating the "Food/Booze by Fullness/Drunkenness" categories (which are currently done manually), I would have wholeheartedly agreed, but categorizing by adventures gained simply will not work. --Quietust (t|c) 23:59, 28 December 2007 (CST)
    • Aha, forgot about two digit adventures as well as the range ones. I guess it would have to be done manually then, using the minimum number of adventures gained as the category alpha sort key, using a system like Category:Booze (By Level Requirement) where Drinks categorized under letters require levels 10 and up (with A = 10, B = 11, etc). — MrDolomite • Talk 14:14, 29 December 2007 (CST)
  • I believe Best Booze, were it to be maintained, would do what you're trying to aim for. --Bagatelle 09:55, 29 December 2007 (CST)
    • Yep, that's the closest thing so far, thx! — MrDolomite • Talk 14:14, 29 December 2007 (CST)

HTML formatting

Would it be possible to assign classes to the trs or tds in the table that match the parameter names for the template? This way the resulting html could be parsed for the data that's in template without resorting to searching for strings like "Fullness", etc in the resulting html. (Actually, having the parameter numbers in an isolated span tag and have that have the parameter class would be easiest to parse.) This would allow the page to be parsed with Greasemonkey scripts and the item pages could work like a database for displaying item use info directly in KOL. Also, once this data is available in a readily parsable format it would allow for automating some of the comparision pages with javascript, or a bot. The Best Foods pages come to mind as page that could be automated. --KronicDeth 00:40, 16 August 2008 (CDT)

  • Is this still needed? I'd rather not do a hidden span tag on every food page on the wiki.... Can't you maintain a parseable database that grabs its data from editing sections which already have data in the proper format? You really shouldn't be hitting the wiki that often anyways....--SomeStranger (t|c) 00:52, 29 January 2009 (UTC)
    • I've used the xml export to get the data, which was an excellent solution for me. It might be harder to use from e.g. greasemonkey, but if possible it's a great way to do it. --Eleron 01:02, 29 January 2009 (UTC)

Him/Her familiars.

In order to match in-game exactly, this template needs a flag for 'her' for familiars. Very simple change, just need an admin to do it. --Lordebon 12:28, 19 September 2009 (UTC)

  • Maybe if it is so easy, you could whip it out in a sandbox page and that would prompt the admins to copy and paste the fix? I'm no wiki expert, and I don't want to dive into that mess. --Club (#66669) (Talk) 18:01, 2 October 2009 (UTC)

The familiar version needs to be altered. The second image displayed is of the Familiar, not the hatchling, though some familiars use the same image for both. For this template to get the name of the hatched familiar, either another optional parameter need to be added to this template, or maybe it could be added to the data pages of familiar hatchling, where this template could retrieve it from there. Of course that image should link to the hatched familiar, and the usual ability to account for non-existing info/pages, blah blah blah. ;) Also the Squamous polyp has a custom generated familiar name (Cth + <random name>), kind of like the grapefruit does. And considering the above talk section, i guess famliars (hatchling) should be designated as male/female (data?) for "You decide to name him/her" will work. So who gets motivated first? ;) --JRSiebz (|§|) 07:22, 1 October 2009 (UTC)

  • I guess the "easiest" way woulf be adding a "sex" flag which defaults as m when m or f isn't specified (sex=ya plz harharhar), and i guess a "hatched" parameter which would specify the hatched Familiar. Oh man, I haven't edited this template in 3 years, please someone, beat me too it, I beg of you ;) --JRSiebz (|§|) 07:30, 1 October 2009 (UTC)
    • I'm aware of the issues. The gender can be handled with a parameter easily. I haven't settled on the best way for the second image. Putting a data page on the familiar page would be one solution, and then you feed the template the hatchling page name to pull up the image (and possibly add a note about what familiar it turns into, since it has the link information). The {{familiar}} template could then use the data page for the image, as well, as could anything else. So I think I'm leaning towards a data page for familiar pages. --Flargen 18:57, 2 October 2009 (UTC)

familiar name

There has got to be a better way to handle special default familiar names than hardcoding them into this template! Seems like it should just be a custom parameter like fname or something. --Starwed 09:42, 25 December 2011 (CET)

  • That could be done easily enough. --Flargen 16:06, 25 December 2011 (CET)
  • Done! Oh, I should add mention of this parameter into the help section. Stupid complicated wiki. --Flargen (talk) 00:39, 11 April 2013 (UTC)

Needs revision

An edit was made to this template on March 12, 2013, which needs to be reverted. It's causing improper text to appear on a whole bunch of pages. This needs wiki admin/superuser privileges. --Greycat (talk) 01:45, 13 March 2013 (UTC)

I just came here to mention this. It's saying "Homemade Robot=Sweetbot 8000" --Lxndr (talk) 02:19, 13 March 2013 (UTC)

Auto-categorization, >9

Consumable items with fullness/drunkenness/spleen greater than 9 are being categorized under "1", because the category group can only be a single character. --Quietust (t|c) 20:43, 1 May 2013 (UTC)