User:SerpentofSet: Difference between revisions

From 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
==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>
Can be simulated accurately with the following code in the debug console:
<syntaxhighlight lang="lua">
=p.main(
  mw.getCurrentFrame():newChild{
      title="Module:Test",
      args={"a",["sep"]=";","b"}
  }
)</syntaxhighlight>
Note that in this example the element in the export table which is being evaluated is called "main".
====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">
=p.main{
  args={"a",["sep"]=";","b"}
}</syntaxhighlight>


What's a sandbox
What's a sandbox

Revision as of 17:03, 19 October 2024

I am bad at the game so I edit the wiki

Below stolen shamelessly from the MediaWiki Scribunto articles

Examples

Invoking module directly

Given Module:Test with the following contents:

local p = {}
function p.main(frame)
   local args = frame.args
   mw.log("log test")
   return args[1]..args["sep"]..args[2]
end
return p

The following invoke call: {{#invoke:Test|a|sep=;|b}} Can be simulated accurately with the following code in the debug console:

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

Note that in this example the element in the export table which is being evaluated is called "main".

Simplified version

If the module you are debugging does not use any frame object methods (such as frame:preprocess()), like the example above, then the frame object analog(?) does not have to be complete, and the debugging code can be simplified into the following:

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

What's a sandbox Yamato

Hero Base Health Stats
Hero Starting Added per PI At Max PI
Ivy 550 +35 1040
Pocket 550 +31 984
Mo & Krill 700 +44 1316
Dynamo 650 +44 1266
Abrams 570 +34 1046
Vindicta 550 +20 830
Haze 500 +27 878
Grey Talon 550 +27 928
Warden 550 +45 1180
Paradox 550 +40 1110
Lash 550 +42 1138
Seven 550 +31 984
Shiv 600 +35 1090
Infernus 600 +33 1062
Kelvin 600 +50 1300
McGinnis 550 +41 1124
Viscous 550 +38 1082
Bebop 650 +41 1224
Lady Geist 650 +41 1224
Mirage 550 +37 1068
Wraith 550 +31 984
Yamato 500 +31 934

Item Cost +X% Bullet Lifesteal
Active Reload Souls1250 +20%
Heroic Aura Souls3000 +20%
Crippling Headshot Souls6200 +10%
Bullet Lifesteal Souls1250 +28%
Leech Souls6200 +35%

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