Editing
Module:Video
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} function p.file( frame ) -- looks for a webm file that matches the first and second arguments separated by a dash and ends in '-voice' if frame.args[2] and frame.args[2] ~= 'none' then fileexists = frame:expandTemplate{title = 'exist', args = {'file:'..frame.args[1]..'-'..frame.args[2]..'-voice.webm', 'yes'}} if fileexists == 'yes' then return frame.args[1]..'-'..frame.args[2]..'-voice.webm' end end -- looks for a webm file that matches: -- a matched source at the beginning of the first argument, -- and appends the matched source to the first argument separated by a dash, -- and ends in '-voice' for _, source in pairs({'RoE', 'AB', 'SoD', 'HC', 'HotA'}) do if frame.args[1]:match('^' .. source) == source then fileexists = frame:expandTemplate{title = 'exist', args = {'file:'..frame.args[1]..'-'..source..'-voice.webm', 'yes'}} if fileexists == 'yes' then return frame.args[1]..'-'..source..'-voice.webm' end break end end -- looks for a webm file that matches the first argument by itself fileexists = frame:expandTemplate{title = 'exist', args = {'file:'..frame.args[1]..'.webm', 'yes'}} if fileexists == 'yes' then return frame.args[1]..'.webm' end -- returns a gif using the first argument with its last two parts separated by dashes removed local lines = p.split(frame.args[1], '-') local parent2 = '' for i, line in ipairs(lines) do parent2 = parent2 .. line if i + 2 >= #lines then break else parent2 = parent2 .. '-' end end return parent2..'.gif' end function p.split(str, sep) local result = {} local regex = ("([^%s]+)"):format(sep) for each in str:gmatch(regex) do table.insert(result, each) end return result end return p
Summary:
Please note that all contributions to Heroes 3 wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
File:RoE 1.0 CD-Heroes3-DATA-HEROES3 SND-E1A-smk-EVIL1A.webm
(
edit
)
File:RoE 1.0 CD-Heroes3-DATA-HEROES3 VID-EVIL1A-smk-EVIL1A-RoE-voice.webm
(
edit
)
File:RoE 1.0 CD-Heroes3-DATA-HEROES3 VID-EVIL1A-smk-EVIL1Axyz123-RoE-voice.webm
(
edit
)
File:RoE 1.0 CD-Heroes3-DATA-HEROES3 VID-EVIL1A-smk-EVIL1Axyz123.webm
(
edit
)
File:Unknown file.webm
(
edit
)
Template:Exist
(
edit
)
Module:Video
(
edit
)
Module:Video/doc
(
edit
)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Module
Discussion
English
Views
Read
Edit
View history
More
Purge
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information