User:SerpentofSet: Difference between revisions

From The Deadlock Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
I am bad at the game so I edit the wiki
I am bad at the game so I edit the wiki


Below stolen shamelessly from the MediaWiki Scribunto articles
==How to Debug in Scribunto==
 
==Examples==
===Invoking module directly===
Given [[Module:Test]] with the following contents:
<syntaxhighlight lang="lua">
local p = {}
function p.main(frame)
  local args = frame.args
  mw.log("log test")
  return args[1]..args["sep"]..args[2]
end
return p
</syntaxhighlight>
The following invoke call:
<code><nowiki>{{#invoke:Test|a|sep=;|b}}</nowiki></code>
<code><nowiki>{{#invoke:Test|a|sep=;|b}}</nowiki></code>
Can be simulated accurately with the following code in the debug console:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
=p.main(
=p.main(
Line 25: Line 10:
   }
   }
)</syntaxhighlight>
)</syntaxhighlight>
Note that in this example the element in the export table which is being evaluated is called "main".
====Simplified version====
====Simplified version====
If the module you are debugging does not use any [[Extension:Scribunto/Lua_reference_manual#Frame_object|frame object methods]] (such as <code>frame:preprocess()</code>), like the example [[#Invoking module directly|above]], then the frame object analog(?) does not have to be complete, and the debugging code can be simplified into the following:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
=p.main{
=p.main{
Line 34: Line 16:
}</syntaxhighlight>
}</syntaxhighlight>


What's a sandbox
==What's a sandbox==
{{PageRef|Yamato|type=Hero}}
{{PageRef|Yamato|type=Hero}}



Revision as of 17:13, 20 October 2024

I am bad at the game so I edit the wiki

How to Debug in Scribunto

{{#invoke:Test|a|sep=;|b}}

=p.main(
   mw.getCurrentFrame():newChild{
      title="Module:Test",
      args={"a",["sep"]=";","b"}
   }
)

Simplified version

=p.main{
   args={"a",["sep"]=";","b"}
}

What's a sandbox

Yamato

Base Health Stats
Hero Starting Added per Boon At Max Boon
Abrams 800 +49 2515
Apollo 770 +45 2345
Bebop 880 +52 2700
Billy 820 +53 2675
Calico 730 +37 2025
Celeste 690 +33 1845
The Doorman 755 +42 2225
Drifter 755 +41 2190
Dynamo 880 +61 3015
Graves 730 +33 1885
Grey Talon 780 +38 2110
Haze 730 +33 1885
Holliday 780 +41 2215
Infernus 830 +39 2195
Ivy 755 +45 2330
Kelvin 880 +60 2980
Lady Geist 880 +51 2665
Lash 780 +50 2530
McGinnis 780 +52 2600
Mina 660 +27 1605
Mirage 730 +45 2305
Mo & Krill 930 +65 3205
Paige 680 +31 1765
Paradox 730 +46 2340
Pocket 780 +36 2040
Rem 680 +28 1660
Seven 730 +41 2165
Shiv 830 +46 2440
Silver 830 +28 1810
Silver (Transformed) 830 +28 1810
Sinclair 730 +38 2060
Venator 820 +43 2325
Victor 800 +34 1990
Vindicta 755 +28 1735
Viscous 780 +45 2355
Vyper 780 +35 2005
Warden 805 +60 2905
Wraith 730 +35 1955
Yamato 730 +45 2305

Item Cost +X% Bullet Lifesteal

Use this for the debug console when testing the ItemsByStat page: =p.tablefy( mw.getCurrentFrame():newChild{ title="Module:ItemsByStat", args={"BulletLifestealPercent", "+X% Bullet Lifesteal", "%"} })