Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /c
- local pl = game.player;
- local tpPoints =
- {
- { name = "Center", pos = {0, 0}},
- { name = "PH", pos = {-412, -424}},
- { name = "Petr", pos = {-150, -350}},
- { name = "Coke", pos = {-550, -320}},
- { name = "Alien", pos = {-144, 100}},
- { name = "Q Input", pos = {215, -350}},
- { name = "Q[1]", pos = {-375, -800}},
- { name = "Q[2]", pos = {-700, -100}},
- { name = "Q[3]", pos = {-715, 450}},
- { name = "Q[4]", pos = {-1165, 865}},
- { name = "I Output", pos = {84, -406}},
- { name = "I Input", pos = {110, -392}},
- { name = "I[0]", pos = {-510, -208}},
- { name = "L Input", pos = {175, -600}},
- { name = "L[0]", pos = {78, 1}},
- { name = "A Input", pos = {177, -530}},
- { name = "A[0]", pos = {10, -1200}},
- { name = "Cop Input", pos = {177, -462}},
- { name = "Cop[1]", pos = {-820, 420}},
- { name = "CR Input", pos = {177, -662}},
- { name = "CR[0]", pos = {0, -380}},
- { name = "Tin Input", pos = {177, -800}},
- { name = "Stone[0]", pos = {-927, 277}},
- { name = "Boiler", pos = {91, -60}},
- { name = "Coal[0]", pos = {-85, -200}}
- };
- function getPos (btnName)
- for _, tpPoint in pairs (tpPoints) do
- if tpPoint.name == btnName then
- return tpPoint.pos;
- end
- end
- return nil;
- end
- script.on_event(defines.events.on_gui_click, function(event)
- local pos = getPos(event.element.caption);
- if (pos ~= nil) then
- pl.teleport (pos);
- end
- end)
- local frameCont = pl.gui.left;
- if frameCont.tpFrame ~= nil then frameCont.tpFrame.destroy() end;
- local tpFrame = frameCont.add{type = "frame", name = "tpFrame", direction = "vertical"};
- local tpFrameTable = tpFrame.add{type ="table", name = "tpFrameTable", column_count = 1 };
- for index, tpPoint in pairs (tpPoints)
- do tpFrameTable.add {type = "button", name = "tpButton" .. index, caption = tpPoint.name };
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement