Template:Archived Page History/Help:Automation: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Thinking about deleting the entire "First community bot" section)
 
(7 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Language subpage}}
{{APH|Help:Automation}}
{{todo|This page is not a stub but could use some more detail.}}
Unlike many other wikis, such as Wikipedia, the VDC, as a site focused on programming in relation to certain games and engines, can benefit greatly from automatic gathering and formatting of much of the data that these engines use. Automation can also greatly help with tasks such as applying and updating templates across pages, for example updating pages using the old template {{tlc|Lang}} to use it's new counterpart {{tl2|MultiPage}}. <!-- or maybe {{page}} in the future -->
 
This article delves into the realm of automation, exploring the usage of scripts and bots in streamlining processes and enhancing efficiency across the VDC.
[[File:PyQT6-Entity-List-Script-Skit.png|400px|thumb|A script for generation entity lists from fgd file]]
 
==Scripts==
Scripts are fundamental to automation, enabling the automation of repetitive tasks and the execution of complex operations. This section will detail the types of scripts used in automation, their applications, and the programming languages most commonly employed for scripting.
{{note|While AI can be used for some automation, it still often makes errors and needs specific prompts. Regular scripts are still recommended for most tasks.}}
<br>The following scripts provide utility for task automation:
 
===Entity Lists===
Creating lists of entities is not difficult task; in fact, it is rather straightforward.
 
{{warning|This script is useless if the format for the [[FGD]] file in the game is modified, for example in games using {{strata|4}}. This script works with standard FGD files for all vanilla {{src|4}} branches.}}
 
{{note|These scripts utilize a combination of Bash scripting and Unix/Linux command-line tools, such as ''grep'', ''sed'', and ''awk''}}
 
==== Issues ====
{{bug|Sometimes the script adds entities to the wrong section (with a different prefix)}}
{{bug|Sometimes unnecessary spaces may be added}}
 
====For {{src|4}} [[FGD]]'s====
'''The Script'''{{ref|1}}
*Uses grep -i '^\(@solidclass\|@pointclass\|@NPCClass\)' "$1" to filter lines from the input file that start with @solidclass, @pointclass, or @NPCClass.
 
*Creates sections based on the prefixes extracted from the processed lines. It uses an associative array declare -A seen to keep track of prefixes that have already been processed. This ensures that each prefix corresponds to a single section. <!-- The grammar in this sentence seems flawed but I since I don't understand what it's talking about I'm not sure how to fix it -->
*Uses <nowiki>*{{ent|$result}}</nowiki> to format the processed lines as wiki entries.
 
*The section headers are formatted as ===%s_*=== where %s is replaced with the prefix. For example, if the prefix is foo, the section header will be ===foo_*===. Each processed line is then added under the appropriate section.
 
*Handles unincluded lines by appending them to a separate "Unincluded" section at the end of the output file. This ensures that all lines are accounted for, even if they don't fit the criteria for the other sections.
 
===== Usage =====
{{code|'''Source-FGD-Ent-List-VDC-2.sh''' ''<input>'' ''<output>''}}
 
===== Pages created using this script =====
* [[List of Fistful of Frags entities]]
* [[List of Heart of Evil: Source entities]]
* [[List of Grey entities]]
* [[List of Wilson Chronicles entities]]
 
==== For {{gldsrc|4}} [[FGD]]'s====
'''The Script'''{{ref|2}}
* The logic is the same as the {{src|4}} script
**Uses grep -i '^\(@solidclass\|@pointclass\)' "$1" to filter lines from the input file that start with @solidclass, @pointclass, or @NPCClass.
** Uses <nowiki>*{{ent|$result_(GoldSrc)|alt=$result}}</nowiki> to format the processed lines as wiki entries.
 
===== Usage =====
{{code|'''GoldSrc-FGD-Ent-List-VDC-2.sh''' ''<input>'' ''<output>''}}
 
===== Pages created using this script =====
* [[List of Counter-Strike: Condition Zero Deleted Scenes entities]]
* [[List of James Bond 007: Nightfire entities]]
* [[List of Paranoia entities]]
* [[List of Cry of Fear entities]]
 
== Bots ==
Bots are automated software agents designed to perform repetitive or time-consuming tasks, often in response to certain triggers or conditions.<br>
This is a table of bots that currently exist on this site.
 
{| class="wikitable sortable"
|-
! Bot !! Operator !! Framework !! Purpose <!-- Could also be "description" or "notes" --> !!  Status <!-- This would need to be updated every now and then--> <!-- !! Source code section could be added sometime in the future-->
|-
| {{u|VDCBot}} || {{valve|4.1}} || {{N/A}} || A range of automated cleanup assignments. Also used to ban users from editing the wiki. || <p style="color:yellow;display:inline">Active</p> (intermittently)
|-
| {{u|PIPEbot}} || {{u|Mailmanmicky}} || {{pywikibot|4.1}} || {{N/A}} || <p style="color:red;display:inline">Inactive</p>, likely to never become active
|-
| {{u|WisdomBot}} || {{u|Wisdurm}} || {{DotNetWikiBot|4.1}} || Updating pages using {{t|lang}} to use {{t|multipage}}, as well as other tasks, most of which are also just replacing deprecated templates. || <p style="color:yellow;display:inline">Active</p> (intermittently)
|-
| [[User:Thunder4ik|AveaBot]]|| {{u|Noug4at}} || {{w|Wikipedia:AutoWikiBrowser|AutoWikiBrowser|icon=hide}}<br>{{pywikibot|4.1}}|| Updating deprecated templates, optimizing pages, categorization & adding templates. See more at it's [[User:Thunder4ik#Function|user page]]. <!-- References should be used for references, keep hyperlinks as is since it makes more sense and is easier for the reader --> || <p style="color:yellow;display:inline">Active</p> (intermittently)
|-
|{{u|PeeBot}} || {{u|Pee}} || {{DotNetWikiBot|4.1}} || Fixing redirects, updating templates, helping with template creation and possibly more. || <p style="color:yellow;display:inline">Active</p> (intermittently)
|}
 
===First community bot===
{{u|WisdomBot}} marks the inaugural creation of an automated bot within the VDC, realized by {{u|Wisdurm}}. Despite the existence of {{u|PIPEbot}} prior to this, there is no evidence to suggest that it operated autonomously or performed any specific functions{{ref|3}}. As of current time, the bot has made a number of edits, including significantly replacing the outdated {{t|entity}} and its derivatives with {{t|this is a}} on pages featuring it,{{ref|4}} as well as having begun the process of moving pages using {{t|lang}} to use {{t|multipage}}. The bot has previously dealt with problems with editing due to an apparent block of some kind, although this now appears to have been lifted.
 
== See also ==
* [[Help:Page Creation]] (Basics)
* {{w|Wikipedia:Bots|Bots}} (Wikipedia)
* {{w|ChatGPT}} (Wikipedia)
* [[:Category:Bot operators|Bot operators in the VDC]] (Category)
* [[:Category:Bot accounts|Bot accounts on the VDC]] (Category)
 
== External links ==
* [https://meta.wikimedia.org/wiki/Bot Bot] (Wikimedia)
* [https://meta.wikimedia.org/wiki/Bot_policy Bot policy] (Wikimedia)
* [https://www.mediawiki.org/wiki/Help:Bots Bots] (Mediawiki)
 
{{References|1=
{{ref2|cite id=1|1=[https://gist.github.com/ayaz345/504460fc45ca10505daedf0dc4a14675 "FGD to Entity List" for Source Engine] (GitHub Gist)}}
{{ref2|cite id=2|1=[https://gist.github.com/ayaz345/3927f4be9a86bd4f576b8a5fb15b6ee0 "FGD to Entity List" for GoldSrc Engine] (GitHub Gist)}}
{{ref2|cite id=3|1=[[Special:Contributions/PIPEbot|PIPEbot, lack of auto-contributions]]}}
{{ref2|cite id=4|1=[[Special:Contributions/WisdomBot|WisdomBot, list of auto-contributions]]}}
}}

Latest revision as of 15:07, 18 August 2024

Note.pngNote:Archived rest of page history of page Help:Automation
Icon-Important.pngImportant:These pages are linked often from page history logs so Special:WhatLinksHere will not show anything.