User:Iritscen/TestSpace: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (→‎Magic words: MW also supposedly won't count an article without a comma, but it actually just looks at whether (length > 0) because "if the page is empty, it can't contain a comma"; shoot me now)
m (link fix to satisfy my script)
 
(56 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Divbox and Pullquote, stop fighting, or I'll pull this car right over!==
{|border=1 cellspacing=0 cellpadding=2
Divbox and Pullquote don't get along well. Here's what happens when I write some reasonable wiki code:
!Kind
!Type
!Name
!Platform<onlyinclude>
|-<includeonly>
|Group 1</includeonly>
|style="font-family:cursive; font-weight:bold" align="center"|f
|bool
|[[User:Iritscen/TestSpace#chr_has_lsi|chr_has_lsi]]
|align="center" data-sort-value="wm"|[[Image:Platform-Win.png|20px]] [[Image:Platform-Mac.png|20px]]
|-<includeonly>
|Group 2</includeonly>
|style="font-size:166%; font-family:cursive" align="center"|v
|bool
|[[User:Iritscen/TestSpace#gl_fog_start_changeto|gl_fog_start_changeto]]
|align="center" data-sort-value=" m"|[[Image:Platform-empty.png|20px]] [[Image:Platform-Mac.png|20px]]</onlyinclude>
|}


<pre><nowiki>{{Divbox|yellow|title|{{Pullquote|Pretend something witty is written here.|Iritscen}}}}</nowiki></pre>
{{Find BSL Group|ai2_idle}}


begets:
==Task A==
{{BSLfuncinfo
|type=bool
|name=chr_has_lsi
}}


{{Divbox|yellow|title|{{Pullquote|Pretend something witty is written here.|Iritscen}}}}
==Task B==
{{BSLvarinfo
|name=gl_fog_red
|type=float
|default=0.25
|mac=no
}}
{{BSLvarinfo
|name=gl_fog_green
|type=string
|default=0.25
}}
{{BSLvarinfo
|name=gl_fog_blue
|type=float
|default=0.25
}}
{{BSLvarinfo
|name=gl_fog_start
|type=float
|default=0.925
}}
{{BSLvarinfo
|name=gl_fog_end
|type=float
|default=1.0
}}
{{BSLfuncinfo
|type=void
|default=
|name=gl_fog_start_changeto
|arg1default=
|arg1type=float
|arg1name=start_val
|arg2default=
|arg2type=int
|arg2name=frames
}}
{{BSLfuncinfo
|type=void
|default=
|name=gl_fog_end_changeto
|arg1default=
|arg1type=float
|arg1name=start_val
|arg2default=
|arg2type=int
|arg2name=frames
}}


==Task C==
{{BSLfuncinfo
|type=void
|name=playback
|arg1type=string
|arg1name=ai_name
|arg1alttype=int
|arg1altname=script_id
|arg2type=string
|arg2name=film_name
|arg3optional=yes
|arg3type=string
|arg3name=mode
|arg4optional=yes
|arg4type=int
|arg4name=num_frames
}}


After doing some reading on WP and some fiddling, I've found that:
==Task D==


<pre><nowiki>{{Divbox|yellow|3=<br>{{Pullquote|Pretend something witty is written here.|Iritscen}}}}</nowiki></pre>


begets
[[Category:Userspace]]
 
{{Divbox|yellow|3=<br>{{Pullquote|Pretend something witty is written here.|Iritscen}}}}
 
So, although it works, it's only by a hack that the two templates get along together even partially.
 
Questions that need answering:
# Why do I need to declare that the quote text is the third parameter with "3="?
# Why does some bum text need to be inserted (here I've used "<nowiki><br></nowiki>") before the data returned by Pullquote?
# Why does using Pullquote inside of Divbox break Divbox's "width" parameter?
:Because pullquote has its own width...[[User:Gumby|Gumby]]
<nowiki>#</nowiki>3 is of the most concern to me, followed by #2. I suspect that the fact that Pullquote actually returns table code is part of the problem behind all this.
 
 
{{Divhide|this is the title}}
Testing divhide.
{{Divhide|end}}
 
==Page count project==
===Magic words===
These first two poorly-documented magic words provide easy answers to the amount of content on the wiki. However, unless they are based on something logical that I haven't discovered yet, they are completely useless.
 
'''NUMBEROFPAGES''': {{NUMBEROFPAGES}}
 
MW code says: Simply count all entries in page table.
 
Iritscen says: What gives, MW? This number is higher than the total of files, articles, and talk pages, so what the #$^& is the software looking at? Totally unhelpful.
 
'''NUMBEROFARTICLES''': {{NUMBEROFARTICLES}}
 
MW code says: In our current MW version, 1.16.5, the code simply counts all pages which are in content namespaces (as listed in $wgContentNamespaces) and are not redirects and are not empty. From MW 1.18 on, the function now gets a distinct count of the entries in the pagelinks table, "pl_from" field, that match those page ids. In other words, it filters out pages that do not link to other pages (the reasoning presumably being that "those aren't real wiki pages" if they're not connecting to anything else).
 
Iritscen says: One would expect that in the current software, this number would therefore agree with the sum of the results from PAGESINNS for each namespace if you account for redirects, but it's off by 30 as of 4/22/12 (see bottom section). Things will become more complicated when we eventually upgrade the wiki, as dead-end pages will also be excluded from this count, which is not desirable. Fortunately, we can get a list of these pages on [[Special:DeadendPages]]. But since NUMBEROFARTICLES should agree currently with PAGESINNS less redirects, and it doesn't, I consider NUMBEROFARTICLES too unreliable to use.
 
'''PAGESINNS''', AKA PAGESINNAMESPACE: These counts agree with the number of pages displayed for each namespace on the [[Special:AllPages]] page, which provides some much-needed verifiability. However, since Allpages counts redirect pages, that means that PAGESINNS does too. Therefore, we can't use a straight sum of PAGESINNS results as our page count. See final section for the adjusted number.
 
PAGESINNS breakdown:
*Namespace '''{{ns:-2}}''' has ID -2, but we can't get a page count
*Namespace '''{{ns:-1}}''' has ID -1, but we can't get a page count
*Namespace '''Main''' does not return an ID number, but apparently it's 0, because <nowiki>{{PAGESINNS:0}}</nowiki> returns {{PAGESINNS:0}} pages, which agrees with [[Special:AllPages]]
*Namespace '''{{ns:1}}''' has ID 1 and {{PAGESINNS:1}} pages
*Namespace '''{{ns:2}}''' has ID 2 and {{PAGESINNS:2}} pages
*Namespace '''{{ns:3}}''' has ID 3 and {{PAGESINNS:3}} pages
*Namespace '''{{ns:4}}''' has ID 4 and {{PAGESINNS:4}} pages
*Namespace '''{{ns:5}}''' has ID 5 and {{PAGESINNS:5}} pages
*Namespace '''{{ns:6}}''' has ID 6 and {{PAGESINNS:6}} pages
*Namespace '''{{ns:7}}''' has ID 7 and {{PAGESINNS:7}} pages
*Namespace '''{{ns:8}}''' has ID 8 and {{PAGESINNS:8}} pages
*Namespace '''{{ns:9}}''' has ID 9 and {{PAGESINNS:9}} pages
*Namespace '''{{ns:10}}''' has ID 10 and {{PAGESINNS:10}} pages
*Namespace '''{{ns:11}}''' has ID 11 and {{PAGESINNS:11}} pages
*Namespace '''{{ns:12}}''' has ID 12 and {{PAGESINNS:12}} pages
*Namespace '''{{ns:13}}''' has ID 13 and {{PAGESINNS:13}} pages
*Namespace '''{{ns:14}}''' has ID 14 and {{PAGESINNS:14}} pages
*Namespace '''{{ns:15}}''' has ID 15 and {{PAGESINNS:15}} pages
*Namespace '''{{ns:100}}''' has ID 100 and {{PAGESINNS:100}} pages
*Namespace '''{{ns:101}}''' has ID 101 and {{PAGESINNS:101}} pages
*Namespace '''{{ns:102}}''' has ID 102 and {{PAGESINNS:102}} pages
*Namespace '''{{ns:103}}''' has ID 103 and {{PAGESINNS:103}} pages
*Namespace '''{{ns:104}}''' has ID 104 and {{PAGESINNS:104}} pages
*Namespace '''{{ns:105}}''' has ID 105 and {{PAGESINNS:105}} pages
*Namespace '''{{ns:108}}''' has ID 108 and {{PAGESINNS:108}} pages
*Namespace '''{{ns:109}}''' has ID 109 and {{PAGESINNAMESPACE:109}} pages
 
'''All articlespaces''' (without File) totalled using PAGESINNS: {{#expr:{{PAGESINNS:0}}+{{PAGESINNS:2}}+{{PAGESINNS:4}}+{{PAGESINNS:8}}+{{PAGESINNS:10}}+{{PAGESINNS:12}}+{{PAGESINNS:14}}+{{PAGESINNS:100}}+{{PAGESINNS:102}}+{{PAGESINNS:104}}+{{PAGESINNS:108}}}}
 
'''All talkspaces''' totalled using PAGESINNS: {{#expr:{{PAGESINNS:1}}+{{PAGESINNS:3}}+{{PAGESINNS:5}}+{{PAGESINNS:9}}+{{PAGESINNS:11}}+{{PAGESINNS:13}}+{{PAGESINNS:15}}+{{PAGESINNS:101}}+{{PAGESINNS:103}}+{{PAGESINNS:105}}+{{PAGESINNS:109}}}}
 
The '''grand total''' for all namespaces (including File) is: {{#expr:{{PAGESINNS:0}}+{{PAGESINNS:1}}+{{PAGESINNS:2}}+{{PAGESINNS:3}}+{{PAGESINNS:4}}+{{PAGESINNS:5}}+{{formatnum:{{PAGESINNS:6}}|R}}+{{PAGESINNS:7}}+{{PAGESINNS:8}}+{{PAGESINNS:9}}+{{PAGESINNS:10}}+{{PAGESINNS:11}}+{{PAGESINNS:12}}+{{PAGESINNS:13}}+{{PAGESINNS:14}}+{{PAGESINNS:15}}+{{PAGESINNS:100}}+{{PAGESINNS:101}}+{{PAGESINNS:102}}+{{PAGESINNS:103}}+{{PAGESINNS:104}}+{{PAGESINNS:105}}+{{PAGESINNS:108}}+{{PAGESINNS:109}}}}
 
===Redirects===
There were 357 redirects as of 4/22/12 according to [[Special:ListRedirects]].
 
Redirect breakdown:
*Main: 289
*Talk: 9
*Help: 1
*File: 8
*AE: 10
*AE Talk: 1
*BSL: 2
*OBD: 21
*OBD Talk: 3
*OniGalore: 2
*Oni2: 8
*Oni2 Talk: 1
*User: 2
 
===Subpages===
I once believed that NUMBEROFARTICLES was ignoring subpages, so I performed the following check. However, these numbers seem too large to explain the discrepancy between NUMBEROFARTICLES and PAGESINNS, so it was probably a waste of my time.
 
As of 4/22/12, a quick glance through [[Special:AllPages]] appears to show 258 of them in Main, 31 in Talk, 113 in User, 35 in User Talk, 4 in MediaWiki, 4 in Template, 6 in BSL, 1 in BSL Talk, 121 in OBD, 39 in OBD Talk, 4 in AE, 2 in AE Talk, 16 in Oni2, and 1 in Oni2 Talk.  The total is 405 subpages in Main, BSL, OBD, AE, and Oni2.
 
The total for '''articlespace subpages''' is: 526
 
'''Total subpages''' are: 635
 
===Conclusion===
NUMBEROFPAGES is worse than useless, and I cannot reconcile NUMBEROFARTICLES with PAGESINNS. On the other hand, PAGESINNS reconciles with AllPages, which makes it verifiable. So we need to get the true count by using PAGESINNS and subtracting redirects (which is unfortunate because the redirect part has to be counted manually).
 
First, let's count Main and the custom namespaces that we added on for specialized content:
 
Namespaces '''Main, BSL, OBD, AE, and Oni2''' totaled using PAGESINNS: {{#expr:{{PAGESINNS:0}}+{{PAGESINNS:100}}+{{PAGESINNS:102}}+{{PAGESINNS:104}}+{{PAGESINNS:108}}}}
 
Now if we deduct the redirects for those five namespaces, we get: {{#expr:{{PAGESINNS:0}}+{{PAGESINNS:100}}+{{PAGESINNS:102}}+{{PAGESINNS:104}}+{{PAGESINNS:108}}-289-2-21-10-8}}
 
If you think about it, the User namespace is probably not in $wgContentNamespaces, which means that the combination of PAGESINNS counts that is (maybe) equivalent to NUMBEROFARTICLES is only off by 30 (as of 4/22/12, anyway). But wait! Some users have placed their Oni 2-related stories under their user pages. So we need to add in userspace pages...
 
Namespaces '''Main, User, BSL, OBD, AE, and Oni2''' totaled using PAGESINNS: {{#expr:{{PAGESINNS:0}}+{{PAGESINNS:2}}+{{PAGESINNS:100}}+{{PAGESINNS:102}}+{{PAGESINNS:104}}+{{PAGESINNS:108}}}}
 
'''''True count''''' (above total minus redirects in those namespaces): {{#expr:{{PAGESINNS:0}}+{{PAGESINNS:2}}+{{PAGESINNS:100}}+{{PAGESINNS:102}}+{{PAGESINNS:104}}+{{PAGESINNS:108}}-289-2-2-21-10-8}}

Latest revision as of 14:44, 5 April 2021

Kind Type Name Platform
f bool chr_has_lsi Platform-Win.png Platform-Mac.png
v bool gl_fog_start_changeto Platform-empty.png Platform-Mac.png

AI tasks

Task A

bool
Edit this info
chr_has_lsi(
);
default: --

Task B

float gl_fog_red string gl_fog_green float gl_fog_blue float gl_fog_start float gl_fog_end

void
float
int
Edit this info
gl_fog_start_changeto(
start_val,
frames
);
default: --
--
--

void
float
int
Edit this info
gl_fog_end_changeto(
start_val,
frames
);
default: --
--
--

Task C

void
string or int
string
string
int
Edit this info
playback(
ai_name or script_id,
film_name,
mode,
num_frames
);
default: --
--
--
--
--

Task D