Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --computercraft
- --data table for general-purpose controller server by drPepper
- --GUI data (from file)
- guiData = {}
- guiData.LASER_EM_P_1 = { guiType = "LASER_EM", guiName = "Pri-1", controllerIds = {"LASER_P_1"}, draw = { xPos = 1, yPos = 1 } }
- guiData.LASER_EM_S_1 = { guiType = "LASER_EM", guiName = "Sec-1", controllerIds = {"LASER_S_1"}, draw = { xPos = 1, yPos = 2 } }
- guiData.LASER_EM_S_2 = { guiType = "LASER_EM", guiName = "Sec-2", controllerIds = {"LASER_S_2"}, draw = { xPos = 1, yPos = 3 } }
- guiData.LASER_EM_S_3 = { guiType = "LASER_EM", guiName = "Sec-3", controllerIds = {"LASER_S_3"}, draw = { xPos = 1, yPos = 4 } }
- --guiData.LABEL_1 = { guiType = "LABEL", guiName = "Lazors:", draw = { xPos = 1, yPos = 1, len = 10, textCol = colors.black, bgCol = colors.white } }
- guiData.MODE_SW_VERSION = { guiType = "GUI_MODE_SWITCH", guiName = "ver", guiMode = "MODE_VERSION", draw = { xPos = nil, yPos = 1, len = 3 } }
- guiData.MODE_SW_COORD_REL = { guiType = "GUI_MODE_SWITCH", guiName = "rel", guiMode = "MODE_REL_COORDS", draw = { xPos = nil, yPos = 2, len = 3 } }
- guiData.MODE_SW_COORD_GLOB = { guiType = "GUI_MODE_SWITCH", guiName = "glb", guiMode = "MODE_ABS_COORDS", draw = { xPos = nil, yPos = 3, len = 3 } }
- guiData.MODE_SW_FREQ = { guiType = "GUI_MODE_SWITCH", guiName = "frq", guiMode = "MODE_FREQ", draw = { xPos = nil, yPos = 4, len = 3 } }
- --controller data (from file)
- ctrlData = {}
- ctrlData.LASER_P_1 = { guiIds = {"LASER_EM_P_1"}, relX = 19, relY = 0, relZ = 5 }
- ctrlData.LASER_S_1 = { guiIds = {"LASER_EM_S_1"}, relX = 15, relY = 2, relZ = 10 }
- ctrlData.LASER_S_2 = { guiIds = {"LASER_EM_S_2"}, relX = 15, relY = 3, relZ = 10 }
- ctrlData.LASER_S_3 = { guiIds = {"LASER_EM_S_3"}, relX = 15, relY = 4, relZ = 10 }
- --server settings (from file)
- settings = {}
- --default values
- settings.modemSide = "back"
- settings.channelSend = 1211
- settings.channelReceive = 1210
- settings.pastebin = "6yNKPiNG"
- settings.pastebinSData = "rniskTUn"
- settings.monitorSide = "top"
- settings.textSize = 0.5
- --time interval from last response to initiate status request in kiloticks
- settings.statusUpdate = 0.5
- --time interval from last response to mark a controller missing
- settings.statusTimeout = 1.0
- --GUI column length
- settings.guiColWidth = 10.0
- settings.guiRightColWidth = 6.0
- --
- settings.guiBgColor = colors.black
- settings.guiTextColor = colors.white
- --target rel coords as parameters
- function laserChooser(trx, try, trz)
- --table to return
- local tl = { p = {}, s = {} }
- tl.p.LASER_P_1 = { tx = trx - ctrlData.LASER_P_1.relX, ty = try - ctrlData.LASER_P_1.relY, tz = trz - ctrlData.LASER_P_1.relZ }
- tl.s.LASER_S_1 = { tx = ctrlData.LASER_P_1.relX - ctrlData.LASER_S_1.relX, ty = ctrlData.LASER_P_1.relY - ctrlData.LASER_S_1.relY, tz = ctrlData.LASER_P_1.relZ - ctrlData.LASER_S_1.relZ }
- return tl
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement