Difference between revisions of "User:NewseX"

From Trials in Tainted Space Wiki
Jump to navigation Jump to search
(hmm)
m
 
(6 intermediate revisions by 2 users not shown)
Line 11: Line 11:
 
(Get-Content $path -Raw) | Foreach-Object {
 
(Get-Content $path -Raw) | Foreach-Object {
 
     $_ -replace "`t","" `
 
     $_ -replace "`t","" `
 +
    -replace "clearOutputCodex\(\);","" `
 +
    -replace ".*CodexManager.*","" `
 +
    -replace ".*randBust.*","" `
 +
    -replace ".*showBust.*","" `
 
     -replace "outputCodex\(header\(`".*.`"\)\);","" `
 
     -replace "outputCodex\(header\(`".*.`"\)\);","" `
 
     -replace "\/\/.*","" `
 
     -replace "\/\/.*","" `
Line 17: Line 21:
 
     -replace "\n","" `
 
     -replace "\n","" `
 
     -replace "\r","" `
 
     -replace "\r","" `
     -replace "\\n\\n","`n" `
+
     -replace "\\n\\n","`n`n" `
 
     -replace "\\n","`n`n" `
 
     -replace "\\n","`n`n" `
 
     -replace "`"\);","" `
 
     -replace "`"\);","" `
Line 37: Line 41:
 
* Get-Content : Cannot bind argument to parameter 'Path' because it is null.
 
* Get-Content : Cannot bind argument to parameter 'Path' because it is null.
 
** Your path variable wasn't set to a valid destination. Make sure to do $path = ".\dongs.txt" and that you are in the right directory.
 
** Your path variable wasn't set to a valid destination. Make sure to do $path = ".\dongs.txt" and that you are in the right directory.
 +
 
== Script to Generate List of All Codecies Codexes? codi? ==
 
== Script to Generate List of All Codecies Codexes? codi? ==
 
# Goto [https://github.com/OXOIndustries/TiTS-Public/blob/master/includes/CodexEntries.as Public Github CodexEntries.as]
 
# Goto [https://github.com/OXOIndustries/TiTS-Public/blob/master/includes/CodexEntries.as Public Github CodexEntries.as]
Line 42: Line 47:
 
# Copy paste those lines into notepad and save the file as codmain.txt
 
# Copy paste those lines into notepad and save the file as codmain.txt
 
# Open PowerShell. Should be included with windows.
 
# Open PowerShell. Should be included with windows.
# cd into the dir that you stored codex.txt
+
# cd into the dir that you stored codmain.txt
 
# Paste this code:
 
# Paste this code:
 
<pre>
 
<pre>
Line 48: Line 53:
 
(Get-Content $path -Raw) | Foreach-Object {
 
(Get-Content $path -Raw) | Foreach-Object {
 
     $_ -replace "`t","" `
 
     $_ -replace "`t","" `
 +
    -replace "\n\/\/.*","" `
 
     -replace "\/\/.*","" `
 
     -replace "\/\/.*","" `
 
     -replace "CodexManager.*[\=\ a-zA-Z0-9\(\)&*\[\]$^\*<!=>%|\-+/_]*, *`"","`* `[`[Codex: " `
 
     -replace "CodexManager.*[\=\ a-zA-Z0-9\(\)&*\[\]$^\*<!=>%|\-+/_]*, *`"","`* `[`[Codex: " `
Line 55: Line 61:
  
 
It should generate a wiki formatted list that can be pasted in an edit page. Then just hit <code>Show Preview</code> and it will make links to all the pages.
 
It should generate a wiki formatted list that can be pasted in an edit page. Then just hit <code>Show Preview</code> and it will make links to all the pages.
 +
 +
=== Output ===
 +
 +
 +
 +
 +
 +
* [[Codex: Anatae]]
 +
* [[Codex: Ausar]]
 +
* [[Codex: Daynar]]
 +
* [[Codex: Dzaan]]
 +
* [[Codex: Fanfir]]
 +
* [[Codex: Galotians]]
 +
* [[Codex: Humans]]
 +
* [[Codex: Laquines]]
 +
* [[Codex: Leithans]]
 +
* [[Codex: Kaithrit]]
 +
* [[Codex: Kalabast/Fhan’i]]
 +
* [[Codex: Kui-Tan]]
 +
* [[Codex: Ovir]]
 +
* [[Codex: Rahn]]
 +
* [[Codex: Rodenians]]
 +
* [[Codex: Roehm]]
 +
* [[Codex: Siel]]
 +
* [[Codex: Saeri]]
 +
* [[Codex: Saurmorians]]
 +
* [[Codex: Simii]]
 +
* [[Codex: Suulas]]
 +
* [[Codex: Tarratch]]
 +
* [[Codex: Thraggen]]
 +
* [[Codex: Toves]]
 +
* [[Codex: Varmints]]
 +
* [[Codex: Gryvain]]
 +
* [[Codex: Vildarii]]
 +
* [[Codex: Vulkrimi]]
 +
 +
* [[Codex: Cunt Snakes]]
 +
* [[Codex: Kerokoras]]
 +
* [[Codex: Mimbranes]]
 +
* [[Codex: Naleen]]
 +
* [[Codex: Vanae]]
 +
* [[Codex: Venus Pitchers]]
 +
* [[Codex: Zil]]
 +
 +
* [[Codex: Gabilani]]
 +
* [[Codex: Gray Goos]]
 +
* [[Codex: Lapinara]]
 +
* [[Codex: Raskvel]]
 +
* [[Codex: Sydians]]
 +
 +
* [[Codex: Cockvines]]
 +
* [[Codex: Ganrael]]
 +
* [[Codex: Gold Myr]]
 +
* [[Codex: Myr Fungus]]
 +
* [[Codex: Nyrea]]
 +
* [[Codex: Red Myr]]
 +
* [[Codex: Bothrioc]]
 +
 +
* [[Codex: Essyras]]
 +
* [[Codex: Frostwyrm]]
 +
* [[Codex: Korgonne]]
 +
* [[Codex: Lurelings]]
 +
* [[Codex: Milodan]]
 +
 +
 +
* [[Codex: V-Ko Nursedroids|Codex: V-Ko]]
 +
* [[Codex: V-Ko IV Nursedroids|Codex: V-Ko IVs]]
 +
 +
 +
* [[Codex: Aegis]]
 +
* [[Codex: BI/G]]
 +
* [[Codex: Camarilla]]
 +
* [[Codex: Humphard Inc.]]
 +
* [[Codex: J’ejune]]
 +
* [[Codex: JoyCo]]
 +
* [[Codex: KihaCorp]]
 +
* [[Codex: Nova Securities]]
 +
* [[Codex: Pyrite]]
 +
* [[Codex: Reaper]]
 +
* [[Codex: RhenWorld]]
 +
* [[Codex: Snugglé]]
 +
* [[Codex: Steele Tech]]
 +
* [[Codex: Xenogen]]
 +
 +
* [[Codex: Black Void]]
 +
* [[Codex: J.A.F.]]
 +
* [[Codex: Scarlet Federation]]
 +
* [[Codex: T.S.C.]]
 +
* [[Codex: U.G.C.]]
 +
 +
* [[Codex: Stormguard]]
 +
 +
* [[Codex: Throbb]]
 +
* [[Codex: Dumbfuck]]
 +
* [[Codex: Gush]]
 +
* [[Codex: The Treatment]]
 +
* [[Codex: Tentatool]]
 +
 +
* [[Codex: SynthSheath]]
 +
* [[Codex: BionaHoles]]
 +
* [[Codex: Grav Cuffs]]
 +
* [[Codex: Holodom]]
 +
* [[Codex: Suma Cream]]
 +
* [[Codex: ClearYu]]
 +
* [[Codex: Rubber-Made]]
 +
* [[Codex: Bubble Buddy]]
 +
* [[Codex: Muffstick]]
 +
* [[Codex: FizzyFix]]
 +
 +
 +
* [[Codex: AI Systems]]
 +
* [[Codex: Item Mechanics]]
 +
* [[Codex: Maia Series AI]]
 +
 +
* [[Codex: Furpies]]
 +
* [[Codex: Locofever]]
 +
* [[Codex: Sneezing Tits]]
 +
 +
* [[Codex: Eight Clicks | Codex: ||||||||]]
 +
* [[Codex: Becoming One...]]
 +
* [[Codex: Bull’s Strength]]
 +
* [[Codex: BXBI: I]]
 +
* [[Codex: BXBI: II]]
 +
* [[Codex: Captured...]]
 +
* [[Codex: Dragon’s Hoard]]
 +
* [[Codex: Diverting Jokes]]
 +
* [[Codex: Dildo Snakes]]
 +
* [[Codex: Fuck the System]]
 +
* [[Codex: Satyr Slave]]
 +
* [[Codex: Stolen Goods]]
 +
* [[Codex: Tentacles & Tanukis]]
 +
 +
 +
 +
== Codex Fiction ==
 +
# Goto [https://github.com/OXOIndustries/TiTS-Public/blob/master/includes/CodexFiction.as Public Github CodexFiction.as]
 +
# Highlight the function's contents.
 +
# Copy paste those lines into notepad and save the file as titfiction.txt
 +
# Open PowerShell. Should be included with windows.
 +
# cd into the dir that you stored titfiction.txt
 +
# Paste this code:
 +
<pre>
 +
$path = ".\titfiction.txt";
 +
$url = Select-String $path -Pattern "<u>"| Select-Object Line;
 +
(Get-Content $path -Raw) | Foreach-Object {
 +
    $_ -replace "`t","" `
 +
      -replace "clearOutputCodex\(\);","" `
 +
      -replace "author(.*);","" `
 +
      -replace ".*CodexManager.*","" `
 +
      -replace ".*<u>.*","" `
 +
      -replace "outputCodex\(header\(`".*.`"\)\);","" `
 +
      -replace "\/\/.*","" `
 +
      -replace "outputCodex\(`"","" `
 +
      -replace "\r\n","" `
 +
      -replace "\n","" `
 +
      -replace "\r","" `
 +
      -replace "\\n\\n","`n`n" `
 +
      -replace "\\n","`n`n" `
 +
      -replace "`"\);","" `
 +
      -replace "outputCodex\(blockHeader\(`"","</blockquote>`n===" `
 +
      -replace "`"\)\);","===`n<blockquote>" `
 +
      -replace "\\`'","`'" `
 +
      -replace "\\`"","`"" `
 +
      -replace "\\\(","\(" `
 +
      -replace "\\\)","\)" `
 +
      -replace "if *\([\=\ a-zA-Z0-9\(&*\[\]$^\*<!=>%|\-+/_`"]*\)","" `
 +
    } | Set-Content $path -Force;
 +
"__NOTOC__ `r`n<onlyinclude>`r`n<blockquote>`r`n" + $url + (Get-Content $path -Raw) | Set-Content $path -Force;
 +
Add-Content $path "`r`n</blockquote>`r`n</onlyinclude>`r`n[[Category: Codices ]]`r`n[[Category: Fiction]]";
 +
(Get-Content $path -Raw) | Foreach-Object {
 +
    $_ -replace "`t","" `
 +
      -replace "outputCodex\(`"","" `
 +
      -replace "`"\);","" `
 +
      -replace "<a[^>]*>","" `
 +
      -replace "<\/a>","" `
 +
      -replace "@{Line=","" `
 +
      -replace "}","" `
 +
      -replace "\\n","`n`n" `
 +
    } | Set-Content $path -Force;
 +
</pre>
 +
 +
If everything worked the text in titfiction.txt should have changed and can be copy/pasted into any the correct Sotry codex page. It should include the right categories, formatting, and deal with any other weirdness. You should still read the article to make sure. I tested it on PS5 (default in Windows 10), but I believe back to Windows 7 will have a working PS version.
 +
 +
=== Notes ===
 +
The script keeps in the author's name, but removes the website links. This is partly due to laziness and partly because I don't want to post the links all over the wiki in case of spam-bots or other maliciousness.

Latest revision as of 11:10, 10 November 2017

PowerShell script to convert actionscript to mediawiki content for codex

  1. Goto Public Github CodexEntries.as
  2. Find the function for the Codex entry you want( fenoxo names functions stupidly sometimes, but the configureCodex() main function will include a short list of them all).
  3. Highlight all the lines starting with "outputCodex" within the function.
  4. Copy paste those lines into notepad and save the file as codex.txt
  5. Open PowerShell. Should be included with windows.
  6. cd into the dir that you stored codex.txt
  7. Paste this code:
$path = ".\codex.txt";
(Get-Content $path -Raw) | Foreach-Object {
    $_ -replace "`t","" `
    -replace "clearOutputCodex\(\);","" `
    -replace ".*CodexManager.*","" `
    -replace ".*randBust.*","" `
    -replace ".*showBust.*","" `
    -replace "outputCodex\(header\(`".*.`"\)\);","" `
    -replace "\/\/.*","" `
    -replace "outputCodex\(`"","" `
    -replace "\r\n","" `
    -replace "\n","" `
    -replace "\r","" `
    -replace "\\n\\n","`n`n" `
    -replace "\\n","`n`n" `
    -replace "`"\);","" `
    -replace "outputCodex\(blockHeader\(`"","</blockquote>`n===" `
    -replace "`"\)\);","===`n<blockquote>" `
    -replace "\\`'","`'" `
    -replace "\\`"","`"" `
    -replace "\\\(","\(" `
    -replace "\\\)","\)" `
    -replace "if *\([\=\ a-zA-Z0-9\(&*\[\]$^\*<!=>%|\-+/_`"]*\)","" `
    } | Set-Content $path -Force;
"__NOTOC__ `r`n<onlyinclude>`r`n<blockquote>`r`n" + (Get-Content $path -Raw) | Set-Content $path -Force;
Add-Content $path "`r`n</blockquote>`r`n</onlyinclude>`r`n[[Category: Codices ]]"; 

If everything worked the text in codex.txt should have changed and can be copy/pasted into any codex wiki article. It should include the right categories, formatting, and deal with any other weirdness. You should still read the article to make sure. I tested it on PS5 (default in Windows 10), but I believe back to Windows 7 is okay.

Troubleshooting

  • Get-Content : Cannot bind argument to parameter 'Path' because it is null.
    • Your path variable wasn't set to a valid destination. Make sure to do $path = ".\dongs.txt" and that you are in the right directory.

Script to Generate List of All Codecies Codexes? codi?

  1. Goto Public Github CodexEntries.as
  2. Highlight configureCodex function's contents
  3. Copy paste those lines into notepad and save the file as codmain.txt
  4. Open PowerShell. Should be included with windows.
  5. cd into the dir that you stored codmain.txt
  6. Paste this code:
$path = ".\codmain.txt";
(Get-Content $path -Raw) | Foreach-Object {
    $_ -replace "`t","" `
    -replace "\n\/\/.*","" `
    -replace "\/\/.*","" `
    -replace "CodexManager.*[\=\ a-zA-Z0-9\(\)&*\[\]$^\*<!=>%|\-+/_]*, *`"","`* `[`[Codex: " `
    -replace "`",[\=\ a-zA-Z0-9\(\)&*\[\]$^\*<!=>%|\-+/_;,]*","`]`]" `
    } | Set-Content $path -Force;

It should generate a wiki formatted list that can be pasted in an edit page. Then just hit Show Preview and it will make links to all the pages.

Output





Codex Fiction

  1. Goto Public Github CodexFiction.as
  2. Highlight the function's contents.
  3. Copy paste those lines into notepad and save the file as titfiction.txt
  4. Open PowerShell. Should be included with windows.
  5. cd into the dir that you stored titfiction.txt
  6. Paste this code:
$path = ".\titfiction.txt";
$url = Select-String $path -Pattern "<u>"| Select-Object Line;
(Get-Content $path -Raw) | Foreach-Object {
    $_ -replace "`t","" `
       -replace "clearOutputCodex\(\);","" `
       -replace "author(.*);","" `
       -replace ".*CodexManager.*","" `
       -replace ".*<u>.*","" `
       -replace "outputCodex\(header\(`".*.`"\)\);","" `
       -replace "\/\/.*","" `
       -replace "outputCodex\(`"","" `
       -replace "\r\n","" `
       -replace "\n","" `
       -replace "\r","" `
       -replace "\\n\\n","`n`n" `
       -replace "\\n","`n`n" `
       -replace "`"\);","" `
       -replace "outputCodex\(blockHeader\(`"","</blockquote>`n===" `
       -replace "`"\)\);","===`n<blockquote>" `
       -replace "\\`'","`'" `
       -replace "\\`"","`"" `
       -replace "\\\(","\(" `
       -replace "\\\)","\)" `
       -replace "if *\([\=\ a-zA-Z0-9\(&*\[\]$^\*<!=>%|\-+/_`"]*\)","" `
    } | Set-Content $path -Force;
"__NOTOC__ `r`n<onlyinclude>`r`n<blockquote>`r`n" + $url + (Get-Content $path -Raw) | Set-Content $path -Force;
Add-Content $path "`r`n</blockquote>`r`n</onlyinclude>`r`n[[Category: Codices ]]`r`n[[Category: Fiction]]"; 
(Get-Content $path -Raw) | Foreach-Object {
    $_ -replace "`t","" `
       -replace "outputCodex\(`"","" `
       -replace "`"\);","" `
       -replace "<a[^>]*>","" `
       -replace "<\/a>","" `
       -replace "@{Line=","" `
       -replace "}","" `
       -replace "\\n","`n`n" `
    } | Set-Content $path -Force;

If everything worked the text in titfiction.txt should have changed and can be copy/pasted into any the correct Sotry codex page. It should include the right categories, formatting, and deal with any other weirdness. You should still read the article to make sure. I tested it on PS5 (default in Windows 10), but I believe back to Windows 7 will have a working PS version.

Notes

The script keeps in the author's name, but removes the website links. This is partly due to laziness and partly because I don't want to post the links all over the wiki in case of spam-bots or other maliciousness.