User talk:Aichon: Difference between revisions
(→It Worked!: Since it didn't work on the first try, I don't know if I can spend much more time on it at the moment) |
|||
Line 50: | Line 50: | ||
Thanks for the help Aichon, it helped us build a binary counter with 6 digits! [[Template:EBD/SafeHospitalCounter2|THIS]] counts how many East Beck hospitals are currently safe. I'm immensely proud of it :) {{User:Peralta/Signature}} 16:57, 18 July 2016 (UTC) | Thanks for the help Aichon, it helped us build a binary counter with 6 digits! [[Template:EBD/SafeHospitalCounter2|THIS]] counts how many East Beck hospitals are currently safe. I'm immensely proud of it :) {{User:Peralta/Signature}} 16:57, 18 July 2016 (UTC) | ||
:It seems I have tickled your curiosity :P Watcha doing? {{User:Peralta/Signature}} 17:56, 18 July 2016 (UTC) | :It seems I have tickled your curiosity :P Watcha doing? {{User:Peralta/Signature}} 17:56, 18 July 2016 (UTC) | ||
::...nuthin'. >_> | |||
::Well, I was trying to build a quick little recursive counter that would've worked for way more digits and used way less code, but then I remembered that the wiki doesn't support recursion. Shucks. I may try re-implementing it in much the same way that I did with my [[User:Aichon/Other#Logic.2FUtility|intToString]] templates that can take a series of digits and convert them to their text-based equivalent, since I think it'd be possible to do something of that sort, but that's definitely a less clean version of the concept. Even so, it should work and should let me add any sequence of 0s and 1s up to however many digits I program it to take. {{User:Aichon/Signature}} 18:17, 18 July 2016 (UTC) |
Revision as of 18:17, 18 July 2016
Announcement: I'm no longer active. My talk page is still your best bet to get in touch. —Aichon— 04:39, 15 December 2018 (UTC)
- New conversations should be started at the bottom using a level two header (e.g.
==Header==
). Or with the + - I like to keep conversations wherever they start, but if a conversation ends up here, I will keep it here.
- I will format comments for stylistic reasons, delete comments for whatever reason, and generally do anything else within reason.
Cycler
Stelar and me are having some trouble with this page. It's supposed to call on a East Becktown Defenders/QuoteXX page, with XX defined by the CURRENTHOUR, but it doesn't seem to take any inputs? Any help would be welcome. PB&J 14:33, 8 July 2016 (UTC)
- Just tweaked it. See if that works for you. You were missing the | that separated the template's name from the parameter you were passing into it. —Aichon— 14:39, 8 July 2016 (UTC)
- No further progress. The removal of that pipe was a desperate attempt :P PB&J 14:40, 8 July 2016 (UTC)
- Oh, so is the problem that it's not actually cycling every hour? If so, the problem is likely that the page is cached by the wiki, which is something you can't really do much about. Previewing it will cause it to update in your preview...but not for everyone else. If you do a "silent save" (i.e. save the page with no edit made), it'll force the wiki's cache to reset, which should force it to update to the latest hour for everyone, but if you just refresh the page normally, it won't do much of anything, I'm afraid. The only other way around it is to load the page with a cache reset parameter in the URL. You can see an example of one in this edit to the BB4 page (look for the "action=purge" stuff), back when I had a countdown posted to the start of the BB4 event and wanted to provide people with a way to refresh the countdown. —Aichon— 14:46, 8 July 2016 (UTC)
- The problem is that it's not taking any input. The text appearing on Template:EBDQuoteCycler is the default text for when there's no input. I know about the caching, I test everything in preview mode, saves the Recent Changes page a bit of work. PB&J 14:49, 8 July 2016 (UTC)
- Ooooh. For some reason I thought that WAS the quote you wanted. Yeah...these problems get a bit trickier since trying to grab arguments from other templates causes all sorts of issues with pipes. Two things to try:
- Replace your pipes in the quote pages with
{{!}}
. Those will get converted into pipes once they're included, rather than before, which may fix the issue, though I can't recall for sure. - Move the layout logic to your quote pages. Basically, model it after a Danger Report, where each page containing data (i.e. each quote) is responsible for formatting itself. If you want to be able to use the quotes in different formats on different pages, just use {{EastBecktownDefQuote}} as their default template, with an argument that allows you to pass in a different template for other uses, just like how the DRs default to using the BuildingStatus template, but can be used in other ways (as was done with the DangerCenter). That way will definitely work, but it'll take a bit more work. —Aichon— 15:06, 8 July 2016 (UTC)
- Thanks. The first idea didn't work. The second one is a level above my paygrade it seems, since I don't understand half of what's in there :)
- They'll only be used on one page as far as I know, I'm not even sure at this point why I tried to put a CURRENTHOUR call inside a template call inside a different template call. Made sense at the time, but I'm just going to go ahead and get rid of a couple levels of complexity :P Thanks for the tips! PB&J 15:21, 8 July 2016 (UTC)
- Well, if you want to keep it simple, just put a quote template on each quote page, then include a different one each hour. No different than flagboxes, basically. —Aichon— 15:22, 8 July 2016 (UTC)
- I went with the rather large switch table, along with putting the quote template on each quote page. Less elegant than a single line of wiki code powering the whole thing, but if it works it isn't stupid. PB&J 15:47, 8 July 2016 (UTC)
- Then again, apparently my quote pages aren't displaying the default messages for empty variables any more, so now I broke something else :P Not a giant problem, more a curiosity. PB&J 15:49, 8 July 2016 (UTC)
- Well, if you want to keep it simple, just put a quote template on each quote page, then include a different one each hour. No different than flagboxes, basically. —Aichon— 15:22, 8 July 2016 (UTC)
- Replace your pipes in the quote pages with
- Ooooh. For some reason I thought that WAS the quote you wanted. Yeah...these problems get a bit trickier since trying to grab arguments from other templates causes all sorts of issues with pipes. Two things to try:
- The problem is that it's not taking any input. The text appearing on Template:EBDQuoteCycler is the default text for when there's no input. I know about the caching, I test everything in preview mode, saves the Recent Changes page a bit of work. PB&J 14:49, 8 July 2016 (UTC)
- Oh, so is the problem that it's not actually cycling every hour? If so, the problem is likely that the page is cached by the wiki, which is something you can't really do much about. Previewing it will cause it to update in your preview...but not for everyone else. If you do a "silent save" (i.e. save the page with no edit made), it'll force the wiki's cache to reset, which should force it to update to the latest hour for everyone, but if you just refresh the page normally, it won't do much of anything, I'm afraid. The only other way around it is to load the page with a cache reset parameter in the URL. You can see an example of one in this edit to the BB4 page (look for the "action=purge" stuff), back when I had a countdown posted to the start of the BB4 event and wanted to provide people with a way to refresh the countdown. —Aichon— 14:46, 8 July 2016 (UTC)
- No further progress. The removal of that pipe was a desperate attempt :P PB&J 14:40, 8 July 2016 (UTC)
Extracting EMR input
Hi,
Me again, with another question about how to potentially break the wiki :)
Stelar and me are looking into extracting the input on EMR reports to use it in a different template. Basicly make it so that if people put info in the EMR's, we can use that info as well without manually inputting it in two places.
What we basicly need is this:
|s=Barrville |z=~0 |i=**- |p=B |d=Jul 1
so without the rest of the template surrounding it.
(example taken from the Barrville EMR)
Ideas?
PB&J 13:31, 14 July 2016 (UTC)
- You can use it directly in another template as it is, since the raw data is just defaulting to using the {{EMR}} template, but it can be passed into any template of your choosing already. Take a look at how {{EMR}} is built, then make your own that formats the pieces of data you want, how you want, and use it via something like
{{EMRP: Darvall Heights|mytemplate}}
. That'll cause the data in the relevant EMR to be formatted according to your template instead of {{EMR}}, which should be what you're looking for, from the sound of things. —Aichon— 13:51, 14 July 2016 (UTC)- It sounds about right. I'll play around with it and come back to you when I inevitably break things. PB&J 14:43, 14 July 2016 (UTC)
- Well, I tried it and it just gives me "Template:EMRP: Darvall Heights" as the output... PB&J 14:52, 14 July 2016 (UTC)
- You had the right idea. You need a colon before the EMRP template name because it has a colon in the name, which the wiki interprets as a namespace. You also need to tell it which variable you're filling, for...reasons. Anyway, Demo4 should now be working for you with its second example. —Aichon— 14:56, 14 July 2016 (UTC)
- Yeah, I tried the colon in preview, never would have guessed the template= . Thanks, once again, you've proven to be a bloody wiki genius! PB&J 14:58, 14 July 2016 (UTC)
- You had the right idea. You need a colon before the EMRP template name because it has a colon in the name, which the wiki interprets as a namespace. You also need to tell it which variable you're filling, for...reasons. Anyway, Demo4 should now be working for you with its second example. —Aichon— 14:56, 14 July 2016 (UTC)
- Well, I tried it and it just gives me "Template:EMRP: Darvall Heights" as the output... PB&J 14:52, 14 July 2016 (UTC)
- It sounds about right. I'll play around with it and come back to you when I inevitably break things. PB&J 14:43, 14 July 2016 (UTC)
It Worked!
Thanks for the help Aichon, it helped us build a binary counter with 6 digits! THIS counts how many East Beck hospitals are currently safe. I'm immensely proud of it :) PB&J 16:57, 18 July 2016 (UTC)
- It seems I have tickled your curiosity :P Watcha doing? PB&J 17:56, 18 July 2016 (UTC)
- ...nuthin'. >_>
- Well, I was trying to build a quick little recursive counter that would've worked for way more digits and used way less code, but then I remembered that the wiki doesn't support recursion. Shucks. I may try re-implementing it in much the same way that I did with my intToString templates that can take a series of digits and convert them to their text-based equivalent, since I think it'd be possible to do something of that sort, but that's definitely a less clean version of the concept. Even so, it should work and should let me add any sequence of 0s and 1s up to however many digits I program it to take. —Aichon— 18:17, 18 July 2016 (UTC)