Toggle menu
1
18
17
345
Emergency Response: Liberty County Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Editing Module:Vehicle specifications

From Emergency Response: Liberty County Wiki
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.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
Line 4: Line 4:
local getArgs = require('Module:Arguments').getArgs
local getArgs = require('Module:Arguments').getArgs
local args = getArgs(frame)
local args = getArgs(frame)
local title = mw.uri.encode(mw.title.getCurrentTitle().text, 'WIKI');
local wikitext = '|-|General=\n{|class="wikitable vehicle-specifications-table'
local wikitext = '|-|General=\n\n{|class="wikitable vehicle-specifications-table'
if args['manufacturer'] then
if args['manufacturer'] then
wikitext = wikitext .. '\n|-\n|Manufacturer\n|' .. args['manufacturer']
wikitext = wikitext .. '\n\n|-\n\n|Manufacturer\n\n|' .. args['manufacturer']
end
end
if args['model'] then
if args['model'] then
wikitext = wikitext .. '\n|-\n|Model\n|' .. args['model']
wikitext = wikitext .. '\n\n|-\n\n|Model\n\n|' .. args['model']
end
end
if args['trim'] then
if args['trim'] then
wikitext = wikitext .. '\n|-\n|Trim\n|' .. args['trim']
wikitext = wikitext .. '\n\n|-\n\n|Trim\n\n|' .. args['trim']
end
end
if args['model_year'] then
if args['model_year'] then
wikitext = wikitext .. '\n|-\n|Model year\n|' .. args['model_year']
wikitext = wikitext .. '\n\n|-\n\n|Model year\n\n|' .. args['model_year']
end
end
if args['vehicle_id'] then
if args['vehicle_id'] then
wikitext = wikitext .. '\n|-\n|Vehicle ID\n|' .. args['vehicle_id']
wikitext = wikitext .. '\n\n|-\n\n|Vehicle ID\n\n|' .. args['vehicle_id']
end
end
if args['team'] then
if args['team'] then
wikitext = wikitext .. '\n|-\n|Team\n|' .. args['team']
wikitext = wikitext .. '\n\n|-\n\n|Team\n\n|' .. args['team']
end
end
if args['form_factor'] then
if args['form_factor'] then
wikitext = wikitext .. '\n|-\n|Form factor\n|' .. args['form_factor']
wikitext = wikitext .. '\n\n|-\n\n|Form factor\n\n|' .. args['form_factor']
end
end
if args['type'] then
if args['type'] then
wikitext = wikitext .. '\n|-\n|Type\n|' .. args['type']
wikitext = wikitext .. '\n\n|-\n\n|Type\n\n|' .. args['type']
end
end
if args['class'] then -- Fixed case from 'Class' to 'class' for consistency
if args['class'] then -- Fixed case from 'Class' to 'class' for consistency
wikitext = wikitext .. '\n|-\n|Class\n|' .. args['class']
wikitext = wikitext .. '\n\n|-\n\n|Class\n\n|' .. args['class']
end
end
if args['price'] then
if args['price'] then
wikitext = wikitext .. '\n|-\n|Price\n|' .. args['price']
wikitext = wikitext .. '\n\n|-\n\n|Price\n\n|' .. args['price']
end
end
if args['discounted_price'] then
if args['discounted_price'] then
wikitext = wikitext .. '\n|-\n|Discounted price\n|' .. args['discounted_price']
wikitext = wikitext .. '\n\n|-\n\n|Discounted price\n\n|' .. args['discounted_price']
end
end
if args['rank'] then
if args['rank'] then
wikitext = wikitext .. '\n|-\n|Rank\n|' .. args['rank']
wikitext = wikitext .. '\n\n|-\n\n|Rank\n\n|' .. args['rank']
end
end
if not (args['form_factor'] == 'Trailer') then
if not (args['form_factor'] == 'Trailer') then
wikitext = wikitext .. '\n|}\n|-|Performance=\n{|class="wikitable vehicle-specifications-table'
wikitext = wikitext .. '\n\n|}\n\n|-|Performance=\n\n{|class="wikitable vehicle-specifications-table'
end
end
if args['top_speed'] then
if args['top_speed'] then
wikitext = wikitext .. '\n|-\n|Top speed\n|' .. args['top_speed'] .. ' <small>MPH</small>'
wikitext = wikitext .. '\n\n|-\n\n|Top speed\n\n|' .. args['top_speed'] .. ' <small>MPH</small>'
end
end
if args['top_reverse_speed'] then
if args['top_reverse_speed'] then
wikitext = wikitext .. '\n|-\n|Top reverse speed\n|' .. args['top_reverse_speed'] .. ' <small>MPH</small>'
wikitext = wikitext .. '\n\n|-\n\n|Top reverse speed\n\n|' .. args['top_reverse_speed'] .. ' <small>MPH</small>'
end
end
if args['acceleration'] then
if args['acceleration'] then
wikitext = wikitext .. '\n|-\n|Acceleration <small>(0-60)</small>\n|' .. args['acceleration'] .. ' <small>seconds</small>'
wikitext = wikitext .. '\n\n|-\n\n|Acceleration <small>(0-60)</small>\n\n|' .. args['acceleration'] .. ' <small>seconds</small>'
end
end
if args['deceleration'] then
if args['deceleration'] then
wikitext = wikitext .. '\n|-\n|Deceleration <small>(60-0)</small>\n|' .. args['deceleration'] .. ' <small>seconds</small>'
wikitext = wikitext .. '\n\n|-\n\n|Deceleration <small>(60-0)</small>\n\n|' .. args['deceleration'] .. ' <small>seconds</small>'
end
end
if not (args['form_factor'] == 'Trailer') then
if not (args['form_factor'] == 'Trailer') then
wikitext = wikitext .. '\n\n|}\n\n|-|Structure=\n\n{|class="wikitable vehicle-specifications-table'
wikitext = wikitext .. '\n|}\n<div class="vehicle-charts-tabber">{{#tag:tabber|Acceleration={{#chart:' .. title .. '_acceleration.chart|data=' .. title .. '_acceleration.tab}}{{!}}-{{!}}Deceleration={{#chart:' .. title .. '_deceleration.chart|data=' .. title .. '_deceleration.tab}}}}</div>'
end
if not (args['form_factor'] == 'Trailer') then
wikitext = wikitext .. '\n|-|Structure=\n{|class="wikitable vehicle-specifications-table'
end
end
if args['transmission'] then
if args['transmission'] then
wikitext = wikitext .. '\n|-\n|Transmission\n|' .. args['transmission'] .. '<small>-speed automatic/sequential</small>'
wikitext = wikitext .. '\n\n|-\n\n|Transmission\n\n|' .. args['transmission'] .. '<small>-speed automatic/sequential</small>'
end
end
if args['fuel_capacity'] then
if args['fuel_capacity'] then
wikitext = wikitext .. '\n|-\n|Fuel capacity\n|' .. args['fuel_capacity'] .. ' <small>gallons</small>'
wikitext = wikitext .. '\n\n|-\n\n|Fuel capacity\n\n|' .. args['fuel_capacity'] .. ' <small>gallons</small>'
end
end
if args['battery_size'] then
if args['battery_size'] then
wikitext = wikitext .. '\n|-\n|Battery size\n|' .. args['battery_size'] .. ' <small>kWh</small>'
wikitext = wikitext .. '\n\n|-\n\n|Battery size\n\n|' .. args['battery_size'] .. ' <small>kWh</small>'
end
end
if args['drivetrain'] then
if args['drivetrain'] then
wikitext = wikitext .. '\n|-\n|Drivetrain\n|' .. args['drivetrain'] .. '<small>-wheel drive</small>'
wikitext = wikitext .. '\n\n|-\n\n|Drivetrain\n\n|' .. args['drivetrain'] .. '<small>-wheel drive</small>'
end
end
if args['health'] then
if args['health'] then
wikitext = wikitext .. '\n|-\n|Health\n|' .. args['health'] .. ' <small>HP</small>'
wikitext = wikitext .. '\n\n|-\n\n|Health\n\n|' .. args['health'] .. ' <small>HP</small>'
end
end
wikitext = wikitext .. '\n|}\n|-|Frame=\n{|class="wikitable vehicle-specifications-table'
wikitext = wikitext .. '\n\n|}\n\n|-|Frame=\n\n{|class="wikitable vehicle-specifications-table'
if args['seats'] then
if args['seats'] then
wikitext = wikitext .. '\n|-\n|Seats\n|' .. args['seats']
wikitext = wikitext .. '\n\n|-\n\n|Seats\n\n|' .. args['seats']
end
end
if args['wheels'] then
if args['wheels'] then
wikitext = wikitext .. '\n|-\n|Wheels\n|' .. args['wheels']
wikitext = wikitext .. '\n\n|-\n\n|Wheels\n\n|' .. args['wheels']
end
end
if args['inspired_by'] and args['inspired_by_url'] then
if args['inspired_by'] then -- Removed invalid 'and args['']'
wikitext = wikitext .. '\n|-\n|Inspired by\n|[' .. args['inspired_by_url'] .. ' ' .. args['inspired_by'] .. ']'
wikitext = wikitext .. '\n\n|-\n\n|Inspired by\n\n|' .. args['inspired_by']
else
if args['inspired_by'] then
wikitext = wikitext .. '\n|-\n|Inspired by\n|' .. args['inspired_by']
end
end
end
wikitext = wikitext .. '\n|}'
wikitext = wikitext .. '\n\n|}'
-- Bulk semantic setting at the end: Always include all properties, setting to args value or '' (to trigger removal if previously set)
-- Bulk semantic setting at the end: Always include all properties, setting to args value or '' (to trigger removal if previously set)
Line 159: Line 150:
mw.smw.set(properties)
mw.smw.set(properties)

return wikitext
return wikitext
end
end
Please note that all contributions to Emergency Response: Liberty County Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see Meta:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, 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)
🍪 Cookies help us deliver our services. By using our site, you agree to our use of cookies.