模組:MTR/stationhours

出自維基百科,自由嘅百科全書
模組解[]
local p = {}
local prefix = "http://www.mtr.com.hk/ch/customer/services/service_hours_search.php?query_type=search&station="

function p.stationcode()
	return " "
end

function p.stationcode(param)
	local code = param.args[1]
	local num = -1 --error value or not found

	if code == "CEN" then num = 1 end
	if code == "ADM" then num = 2 end
	if code == "TST" then num = 3 end
	if code == "JOR" then num = 4 end
	if code == "YMT" then num = 5 end
	if code == "MOK" then num = 6 end
	if code == "SKM" then num = 7 end
	if code == "KOT" then num = 8 end
	if code == "LOF" then num = 9 end
	if code == "WTS" then num = 10 end
	if code == "DIH" then num = 11 end
	if code == "CHH" then num = 12 end
	if code == "KOB" then num = 13 end
	if code == "NTK" then num = 14 end
	if code == "KWT" then num = 15 end
	if code == "PRE" then num = 16 end
	if code == "SSP" then num = 17 end
	if code == "CSW" then num = 18 end
	if code == "LCK" then num = 19 end
	if code == "MEF" then num = 20 end
	if code == "LAK" then num = 21 end
	if code == "KWF" then num = 22 end
	if code == "KWH" then num = 23 end
	if code == "TWH" then num = 24 end
	if code == "TSW" then num = 25 end
	if code == "SHW" then num = 26 end
	if code == "WAC" then num = 27 end
	if code == "CAB" then num = 28 end
	if code == "TIH" then num = 29 end
	if code == "FOH" then num = 30 end
	if code == "NOP" then num = 31 end
	if code == "QUB" then num = 32 end
	if code == "TAK" then num = 33 end
	if code == "SWH" then num = 34 end
	if code == "SKW" then num = 35 end
	if code == "HFC" then num = 36 end
	if code == "CHW" then num = 37 end
	if code == "LAT" then num = 38 end
	if code == "HOK" then num = 39 end -- Tung Chung Line
	if code == "KOW" then num = 40 end -- Tung Chung Line
	if code == "OLY" then num = 41 end
	if code == "TSY" then num = 42 end -- Tung Chung Line
	if code == "TUC" then num = 43 end
	if code == "HOK" then num = 44 end -- Airport Express
	if code == "KOW" then num = 45 end -- Airport Express
	if code == "TSY" then num = 46 end -- Airport Express
	if code == "AIR" then num = 47 end
	if code == "YAT" then num = 48 end
	if code == "TIK" then num = 49 end
	if code == "TKO" then num = 50 end
	if code == "HAH" then num = 51 end
	if code == "POA" then num = 52 end
	if code == "NAC" then num = 53 end
	if code == "SUN" then num = 54 end
	if code == "DIS" then num = 55 end
	if code == "AWE" then num = 56 end
	if code == "LHP" then num = 57 end

	if code == "HUH" then num = 64 end
	if code == "MKK" then num = 65 end

	if code == "TAW" then num = 67 end
	if code == "SHT" then num = 68 end
	if code == "FOT" then num = 69 end
	if code == "RAC" then num = 70 end
	if code == "UNI" then num = 71 end
	if code == "TAP" then num = 72 end
	if code == "TWO" then num = 73 end
	if code == "FAN" then num = 74 end
	if code == "SHS" then num = 75 end
	if code == "LOW" then num = 76 end

	if code == "LMC" then num = 78 end

	if code == "ETS" then num = 80 end
	if code == "SYP" then num = 81 end
	if code == "HKU" then num = 82 end
	if code == "KET" then num = 83 end
	if code == "HOM" then num = 84 end
	if code == "WHA" then num = 85 end
	if code == "OCP" then num = 86 end
	if code == "WCH" then num = 87 end
	if code == "LET" then num = 88 end
	if code == "SOH" then num = 89 end
	
	if code == "HIK" then num = 90 end
	if code == "KAT" then num = 91 end
	if code == "SUW" then num = 92 end
	if code == "TKW" then num = 93 end
	if code == "EXC" then num = 94 end

	if code == "CKT" then num = 96 end
	if code == "STW" then num = 97 end
	if code == "CIO" then num = 98 end
	if code == "SHM" then num = 99 end
	if code == "TSH" then num = 100 end
	if code == "HEO" then num = 101 end
	if code == "MOS" then num = 102 end
	if code == "WKS" then num = 103 end

	if code == "AUS" then num = 111 end

	if code == "TWW" then num = 114 end
	if code == "KSR" then num = 115 end
	if code == "YUL" then num = 116 end
	if code == "LOP" then num = 117 end
	if code == "TIS" then num = 118 end
	if code == "SIH" then num = 119 end
	if code == "TUM" then num = 120 end
	
	if code == "WEK" then num = 888 end

	if (num > 0) then return prefix .. num
	else error('車站代碼(code)唔啱') end
end

return p