Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function executeTableFunction(input, funcname, ...)
- for k,v in pairs(input) do
- if (type(v[funcname]) == "function" ) then
- v[funcname](...)
- end
- end
- end
- function getGleisFromPosX(posArray)
- if os.getComputerLabel() == "Bahnhof1" then
- if posArray["Y"] ~= 5.5 or posArray["Z"] ~= 7.5 then
- return "?"
- end
- posX = posArray["X"]
- if posX == -4.5 then return 5
- elseif posX == -2.5 then return 4
- elseif posX == 1.5 then return 3
- elseif posX == 3.5 then return 2
- elseif posX == 7.5 then return 1
- else return "?"
- end
- elseif os.getComputerLabel() == "Bahnhof2" then
- if posArray["Y"] ~= 2.5 or posArray["X"] ~= 2.5 then
- return "?"
- end
- posZ = posArray["Z"]
- if posZ == -2.5 then return 5
- elseif posZ == -0.5 then return 4
- elseif posZ == 5.5 then return 3
- elseif posZ == 7.5 then return 2
- elseif posZ == 13.5 then return 1
- else return "?"
- end
- end
- end
- function fillMyString(myString, fillCount)
- local length = string.len(myString)
- if length > fillCount then
- myString = string.sub(myString, 0, fillCount) .. " "
- elseif length < fillCount then
- for i=length,fillCount do
- myString = myString .. " "
- end
- else
- myString = myString .. " "
- end
- return myString
- end
Advertisement
Add Comment
Please, Sign In to add comment