mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-15 17:13:46 +01:00
[READY] Bot Refactor (#18930)
* [WIP] Bot Refactor * No more spawns, sleeps, and working EDs * Mules * GC fixing * h
This commit is contained in:
@@ -250,7 +250,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
playsound(src, 'sound/machines/pda_button1.ogg', 50, TRUE)
|
||||
return
|
||||
|
||||
/obj/item/pda/attackby(obj/item/C as obj, mob/user as mob, params)
|
||||
/obj/item/pda/attackby(obj/item/C, mob/user, params)
|
||||
..()
|
||||
if(istype(C, /obj/item/cartridge) && !cartridge)
|
||||
cartridge = C
|
||||
@@ -260,8 +260,6 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
update_shortcuts()
|
||||
to_chat(user, "<span class='notice'>You insert [cartridge] into [src].</span>")
|
||||
SStgui.update_uis(src)
|
||||
if(cartridge.radio)
|
||||
cartridge.radio.hostpda = src
|
||||
playsound(src, 'sound/machines/pda_button1.ogg', 50, TRUE)
|
||||
|
||||
else if(istype(C, /obj/item/card/id))
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
/// Integrated signaler for captain, science & generic signaler cartridge
|
||||
var/obj/item/assembly/signaler/integ_signaler
|
||||
|
||||
var/obj/item/integrated_radio/radio = null
|
||||
|
||||
var/charges = 0
|
||||
|
||||
var/list/stored_data = list()
|
||||
@@ -18,7 +16,6 @@
|
||||
var/list/messenger_plugins = list()
|
||||
|
||||
/obj/item/cartridge/Destroy()
|
||||
QDEL_NULL(radio)
|
||||
QDEL_LIST(programs)
|
||||
QDEL_LIST(messenger_plugins)
|
||||
return ..()
|
||||
@@ -70,10 +67,6 @@
|
||||
new /datum/data/pda/app/secbot_control
|
||||
)
|
||||
|
||||
/obj/item/cartridge/security/Initialize(mapload)
|
||||
. = ..()
|
||||
radio = new /obj/item/integrated_radio/beepsky(src)
|
||||
|
||||
/obj/item/cartridge/detective
|
||||
name = "D.E.T.E.C.T. Cartridge"
|
||||
icon_state = "cart-s"
|
||||
@@ -148,10 +141,6 @@
|
||||
new /datum/data/pda/app/mule_control
|
||||
)
|
||||
|
||||
/obj/item/cartridge/quartermaster/Initialize(mapload)
|
||||
. = ..()
|
||||
radio = new /obj/item/integrated_radio/mule(src)
|
||||
|
||||
/obj/item/cartridge/head
|
||||
name = "Easy-Record DELUXE"
|
||||
icon_state = "cart-h"
|
||||
@@ -170,10 +159,6 @@
|
||||
new /datum/data/pda/app/status_display
|
||||
)
|
||||
|
||||
/obj/item/cartridge/hop/Initialize(mapload)
|
||||
. = ..()
|
||||
radio = new /obj/item/integrated_radio/mule(src)
|
||||
|
||||
/obj/item/cartridge/hos
|
||||
name = "R.O.B.U.S.T. DELUXE"
|
||||
icon_state = "cart-hos"
|
||||
@@ -183,10 +168,6 @@
|
||||
new /datum/data/pda/app/status_display
|
||||
)
|
||||
|
||||
/obj/item/cartridge/hos/Initialize(mapload)
|
||||
. = ..()
|
||||
radio = new /obj/item/integrated_radio/beepsky(src)
|
||||
|
||||
/obj/item/cartridge/ce
|
||||
name = "Power-On DELUXE"
|
||||
icon_state = "cart-ce"
|
||||
@@ -242,7 +223,6 @@
|
||||
|
||||
/obj/item/cartridge/captain/Initialize(mapload)
|
||||
. = ..()
|
||||
radio = new /obj/item/integrated_radio/beepsky(src)
|
||||
integ_signaler = new /obj/item/assembly/signaler(src)
|
||||
|
||||
/obj/item/cartridge/supervisor
|
||||
@@ -271,10 +251,6 @@
|
||||
new /datum/data/pda/app/status_display
|
||||
)
|
||||
|
||||
/obj/item/cartridge/centcom/Initialize(mapload)
|
||||
. = ..()
|
||||
radio = new /obj/item/integrated_radio/beepsky(src)
|
||||
|
||||
/obj/item/cartridge/syndicate
|
||||
name = "Detomatix Cartridge"
|
||||
icon_state = "cart"
|
||||
|
||||
+88
-109
@@ -201,40 +201,41 @@
|
||||
template = "pda_secbot"
|
||||
category = "Security"
|
||||
|
||||
var/active_uid = null
|
||||
|
||||
/datum/data/pda/app/secbot_control/update_ui(mob/user as mob, list/data)
|
||||
var/list/botsData = list()
|
||||
var/list/beepskyData = list()
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/beepsky))
|
||||
var/obj/item/integrated_radio/beepsky/SC = pda.cartridge.radio
|
||||
beepskyData["active"] = SC.active ? sanitize(SC.active.name) : null
|
||||
has_back = SC.active ? 1 : 0
|
||||
if(SC.active && !isnull(SC.botstatus))
|
||||
var/area/loca = SC.botstatus["loca"]
|
||||
var/loca_name = sanitize(loca.name)
|
||||
beepskyData["botstatus"] = list("loca" = loca_name, "mode" = SC.botstatus["mode"])
|
||||
else
|
||||
beepskyData["botstatus"] = list("loca" = null, "mode" = -1)
|
||||
var/botsCount=0
|
||||
if(SC.botlist && SC.botlist.len)
|
||||
for(var/mob/living/simple_animal/bot/B in SC.botlist)
|
||||
botsCount++
|
||||
if(B.loc)
|
||||
botsData[++botsData.len] = list("Name" = sanitize(B.name), "Location" = sanitize(B.loc.loc.name), "uid" = "[B.UID()]")
|
||||
|
||||
if(!botsData.len)
|
||||
var/mob/living/simple_animal/bot/secbot/active_bot = locateUID(active_uid)
|
||||
|
||||
if(active_bot && !QDELETED(active_bot))
|
||||
beepskyData["active"] = active_bot ? sanitize(active_bot.name) : null
|
||||
has_back = !!active_bot
|
||||
if(active_bot && !isnull(active_bot.mode))
|
||||
var/area/loca = get_area(active_bot)
|
||||
var/loca_name = sanitize(loca.name)
|
||||
beepskyData["botstatus"] = list("loca" = loca_name, "mode" = active_bot.mode)
|
||||
|
||||
else
|
||||
var/botsCount = 0
|
||||
var/list/mob/living/simple_animal/bot/bots = list()
|
||||
for(var/mob/living/simple_animal/bot/secbot/SB in GLOB.bots_list)
|
||||
bots += SB
|
||||
for(var/mob/living/simple_animal/bot/ed209/ED in GLOB.bots_list)
|
||||
bots += ED
|
||||
|
||||
for(var/mob/living/simple_animal/bot/B in bots)
|
||||
botsCount++
|
||||
if(B.loc)
|
||||
botsData[++botsData.len] = list("Name" = sanitize(B.name), "Location" = sanitize(get_area(B).name), "uid" = "[B.UID()]")
|
||||
|
||||
if(!length(botsData))
|
||||
botsData[++botsData.len] = list("Name" = "No bots found", "Location" = "Invalid", "uid"= null)
|
||||
|
||||
beepskyData["bots"] = botsData
|
||||
beepskyData["count"] = botsCount
|
||||
|
||||
else
|
||||
beepskyData["active"] = 0
|
||||
botsData[++botsData.len] = list("Name" = "No bots found", "Location" = "Invalid", "uid"= null)
|
||||
beepskyData["botstatus"] = list("loca" = null, "mode" = null)
|
||||
beepskyData["bots"] = botsData
|
||||
beepskyData["count"] = 0
|
||||
has_back = 0
|
||||
|
||||
data["beepsky"] = beepskyData
|
||||
|
||||
/datum/data/pda/app/secbot_control/ui_act(action, list/params)
|
||||
@@ -246,36 +247,26 @@
|
||||
|
||||
. = TRUE
|
||||
|
||||
// Aight listen up. Its time for a comment rant again.
|
||||
// The old way of doing this was to proxy things directly from the NanoUI into the PDA's cartridge's radio Topic() function directly
|
||||
// It was AWFUL and took me 30 minutes to even understand
|
||||
// This is in no way a good solution, but it works atleast
|
||||
// Why do we rely on this whole "magical radio system" anyways
|
||||
// Hell, I would rather take GLOBs with direct interactions over this
|
||||
// WHYYYYYYYYYYYYYYY -aa07
|
||||
|
||||
switch(action)
|
||||
if("Back")
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/beepsky))
|
||||
pda.cartridge.radio.Topic(null, list(op = "botlist"))
|
||||
if("Rescan")
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/beepsky))
|
||||
pda.cartridge.radio.Topic(null, list(op = "scanbots"))
|
||||
if("AccessBot")
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/beepsky))
|
||||
pda.cartridge.radio.Topic(null, list(op = "control", bot = params["uid"]))
|
||||
if("Stop")
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/beepsky))
|
||||
pda.cartridge.radio.Topic(null, list(op = "stop"))
|
||||
if("Go")
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/beepsky))
|
||||
pda.cartridge.radio.Topic(null, list(op = "go"))
|
||||
if("Home")
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/beepsky))
|
||||
pda.cartridge.radio.Topic(null, list(op = "home"))
|
||||
if("Summon")
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/beepsky))
|
||||
pda.cartridge.radio.Topic(null, list(op = "summon"))
|
||||
if("control")
|
||||
active_uid = params["bot"]
|
||||
|
||||
if("botlist", "Back") // "Back" is part of the PDA TGUI itself.
|
||||
active_uid = null
|
||||
|
||||
if("stop", "go", "home")
|
||||
var/mob/living/simple_animal/bot/active_bot = locateUID(active_uid)
|
||||
if(active_bot && !QDELETED(active_bot))
|
||||
active_bot.handle_command(usr, action)
|
||||
else
|
||||
active_uid = null
|
||||
|
||||
if("summon")
|
||||
var/mob/living/simple_animal/bot/active_bot = locateUID(active_uid)
|
||||
if(active_bot && !QDELETED(active_bot))
|
||||
active_bot.handle_command(usr, "summon", list("target" = get_turf(usr), "useraccess" = usr.get_access()))
|
||||
else
|
||||
active_uid = null
|
||||
|
||||
/datum/data/pda/app/mule_control
|
||||
name = "Delivery Bot Control"
|
||||
@@ -283,27 +274,37 @@
|
||||
template = "pda_mule"
|
||||
category = "Quartermaster"
|
||||
|
||||
var/active_uid = null
|
||||
|
||||
/datum/data/pda/app/mule_control/update_ui(mob/user as mob, list/data)
|
||||
var/list/muleData = list()
|
||||
var/list/mulebotsData = list()
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
|
||||
var/obj/item/integrated_radio/mule/QC = pda.cartridge.radio
|
||||
muleData["active"] = QC.active ? sanitize(QC.active.name) : null
|
||||
has_back = QC.active ? 1 : 0
|
||||
if(QC.active && !isnull(QC.botstatus))
|
||||
var/area/loca = QC.botstatus["loca"]
|
||||
|
||||
var/mob/living/simple_animal/bot/mulebot/active_bot = locateUID(active_uid)
|
||||
|
||||
if(active_bot && !QDELETED(active_bot))
|
||||
muleData["active"] = active_bot ? sanitize(active_bot.name) : null
|
||||
has_back = !!active_bot
|
||||
if(active_bot && !isnull(active_bot.mode))
|
||||
var/area/loca = get_area(active_bot)
|
||||
var/loca_name = sanitize(loca.name)
|
||||
muleData["botstatus"] = list("loca" = loca_name, "mode" = QC.botstatus["mode"],"home"=QC.botstatus["home"],"powr" = QC.botstatus["powr"],"retn" =QC.botstatus["retn"], "pick"=QC.botstatus["pick"], "load" = QC.botstatus["load"], "dest" = sanitize(QC.botstatus["dest"]))
|
||||
muleData["botstatus"] = list(
|
||||
"loca" = loca_name,
|
||||
"mode" = active_bot.mode,
|
||||
"home" = active_bot.home_destination,
|
||||
"powr" = (active_bot.cell ? active_bot.cell.percent() : 0),
|
||||
"retn" = active_bot.auto_return,
|
||||
"pick" = active_bot.auto_pickup,
|
||||
"load" = active_bot.load,
|
||||
"dest" = sanitize(active_bot.destination)
|
||||
)
|
||||
|
||||
else
|
||||
muleData["botstatus"] = list("loca" = null, "mode" = -1,"home"=null,"powr" = null,"retn" =null, "pick"=null, "load" = null, "dest" = null)
|
||||
|
||||
|
||||
var/mulebotsCount=0
|
||||
for(var/mob/living/simple_animal/bot/B in QC.botlist)
|
||||
else
|
||||
var/mulebotsCount = 0
|
||||
for(var/mob/living/simple_animal/bot/mulebot/B in GLOB.bots_list)
|
||||
mulebotsCount++
|
||||
if(B.loc)
|
||||
mulebotsData[++mulebotsData.len] = list("Name" = sanitize(B.name), "Location" = sanitize(B.loc.loc.name), "uid" = "[B.UID()]")
|
||||
mulebotsData[++mulebotsData.len] = list("Name" = sanitize(B.name), "Location" = get_area(B).name, "uid" = "[B.UID()]")
|
||||
|
||||
if(!mulebotsData.len)
|
||||
mulebotsData[++mulebotsData.len] = list("Name" = "No bots found", "Location" = "Invalid", "uid"= null)
|
||||
@@ -311,14 +312,6 @@
|
||||
muleData["bots"] = mulebotsData
|
||||
muleData["count"] = mulebotsCount
|
||||
|
||||
else
|
||||
muleData["botstatus"] = list("loca" = null, "mode" = -1,"home"=null,"powr" = null,"retn" =null, "pick"=null, "load" = null, "dest" = null)
|
||||
muleData["active"] = 0
|
||||
mulebotsData[++mulebotsData.len] = list("Name" = "No bots found", "Location" = "Invalid", "uid"= null)
|
||||
muleData["bots"] = mulebotsData
|
||||
muleData["count"] = 0
|
||||
has_back = 0
|
||||
|
||||
data["mulebot"] = muleData
|
||||
|
||||
/datum/data/pda/app/mule_control/ui_act(action, list/params)
|
||||
@@ -330,40 +323,26 @@
|
||||
|
||||
. = TRUE
|
||||
|
||||
// Heres the exact same shit as before, but worse
|
||||
// See L257 to L263 for explanation
|
||||
|
||||
switch(action)
|
||||
if("Back")
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
|
||||
pda.cartridge.radio.Topic(null, list(op = "botlist"))
|
||||
if("Rescan")
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
|
||||
pda.cartridge.radio.Topic(null, list(op = "scanbots"))
|
||||
if("AccessBot")
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
|
||||
pda.cartridge.radio.Topic(null, list(op = "control", bot = params["uid"]))
|
||||
if("Unload")
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
|
||||
pda.cartridge.radio.Topic(null, list(op = "unload"))
|
||||
if("SetDest")
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
|
||||
pda.cartridge.radio.Topic(null, list(op = "setdest"))
|
||||
if("SetAutoReturn")
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
|
||||
pda.cartridge.radio.Topic(null, list(op = params["autoReturnType"])) // "retoff" or "reton"
|
||||
if("SetAutoPickup")
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
|
||||
pda.cartridge.radio.Topic(null, list(op = params["autoPickupType"])) // "pickoff" or "pickon"
|
||||
if("Stop")
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
|
||||
pda.cartridge.radio.Topic(null, list(op = "stop"))
|
||||
if("Start")
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
|
||||
pda.cartridge.radio.Topic(null, list(op = "start"))
|
||||
if("ReturnHome")
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
|
||||
pda.cartridge.radio.Topic(null, list(op = "home"))
|
||||
if("control")
|
||||
active_uid = params["bot"]
|
||||
|
||||
if("botlist", "Back") // "Back" is part of the PDA TGUI itself.
|
||||
active_uid = null
|
||||
|
||||
if("stop", "start", "home", "unload", "target")
|
||||
var/mob/living/simple_animal/bot/active_bot = locateUID(active_uid)
|
||||
if(active_bot && !QDELETED(active_bot))
|
||||
active_bot.handle_command(usr, action)
|
||||
else
|
||||
active_uid = null
|
||||
|
||||
if("set_auto_return", "set_pickup_type")
|
||||
var/mob/living/simple_animal/bot/active_bot = locateUID(active_uid)
|
||||
if(active_bot && !QDELETED(active_bot))
|
||||
active_bot.handle_command(usr, action, params)
|
||||
else
|
||||
active_uid = null
|
||||
|
||||
/datum/data/pda/app/supply
|
||||
name = "Supply Records"
|
||||
|
||||
@@ -86,8 +86,6 @@
|
||||
scanmode = null
|
||||
if(current_app in C.programs)
|
||||
start_program(find_program(/datum/data/pda/app/main_menu))
|
||||
if(C.radio)
|
||||
C.radio.hostpda = null
|
||||
for(var/datum/data/pda/P in notifying_programs)
|
||||
if(P in C.programs)
|
||||
P.unnotify()
|
||||
|
||||
@@ -1,145 +0,0 @@
|
||||
//TODO convert this crap over to proper radios or find a way to utilize regualr radios for this object, this thing needs to go.
|
||||
|
||||
/obj/item/integrated_radio
|
||||
name = "\improper PDA radio module"
|
||||
desc = "An electronic radio system of Nanotrasen origin."
|
||||
icon = 'icons/obj/module.dmi'
|
||||
icon_state = "power_mod"
|
||||
var/obj/item/pda/hostpda = null
|
||||
var/list/botlist = null // list of bots
|
||||
var/mob/living/simple_animal/bot/active // the active bot; if null, show bot list
|
||||
var/list/botstatus // the status signal sent by the bot
|
||||
var/bot_type //The type of bot it is.
|
||||
var/bot_filter //Determines which radio filter to use.
|
||||
|
||||
var/control_freq = 1447
|
||||
|
||||
var/on = FALSE //Are we currently active??
|
||||
var/menu_message = ""
|
||||
|
||||
/obj/item/integrated_radio/Initialize(mapload)
|
||||
. = ..()
|
||||
if(istype(loc.loc, /obj/item/pda))
|
||||
hostpda = loc.loc
|
||||
if(bot_filter)
|
||||
add_to_radio(bot_filter)
|
||||
|
||||
/obj/item/integrated_radio/Destroy()
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, control_freq)
|
||||
hostpda = null
|
||||
return ..()
|
||||
|
||||
/obj/item/integrated_radio/proc/post_signal(freq, key, value, key2, value2, key3, value3, key4, value4, s_filter)
|
||||
|
||||
// to_chat(world, "Post: [freq]: [key]=[value], [key2]=[value2]")
|
||||
var/datum/radio_frequency/frequency = SSradio.return_frequency(freq)
|
||||
|
||||
if(!frequency)
|
||||
return
|
||||
|
||||
var/datum/signal/signal = new()
|
||||
signal.source = src
|
||||
signal.transmission_method = 1
|
||||
signal.data[key] = value
|
||||
if(key2)
|
||||
signal.data[key2] = value2
|
||||
if(key3)
|
||||
signal.data[key3] = value3
|
||||
if(key4)
|
||||
signal.data[key4] = value4
|
||||
|
||||
frequency.post_signal(src, signal, filter = s_filter)
|
||||
|
||||
/obj/item/integrated_radio/receive_signal(datum/signal/signal)
|
||||
if(bot_type && istype(signal.source, /obj/machinery/bot_core) && signal.data["type"] == bot_type)
|
||||
if(!botlist)
|
||||
botlist = new()
|
||||
|
||||
var/obj/machinery/bot_core/core = signal.source
|
||||
|
||||
if(istype(core) && !(core.owner in botlist))
|
||||
botlist += core.owner
|
||||
|
||||
if(active == core.owner)
|
||||
var/list/b = signal.data
|
||||
botstatus = b.Copy()
|
||||
|
||||
/obj/item/integrated_radio/Topic(href, href_list)
|
||||
..()
|
||||
switch(href_list["op"])
|
||||
if("control")
|
||||
active = locateUID(href_list["bot"])
|
||||
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = bot_filter)
|
||||
|
||||
if("scanbots") // find all bots
|
||||
botlist = null
|
||||
post_signal(control_freq, "command", "bot_status", s_filter = bot_filter)
|
||||
|
||||
if("botlist")
|
||||
active = null
|
||||
|
||||
if("stop", "go", "home")
|
||||
post_signal(control_freq, "command", href_list["op"], "active", active, s_filter = bot_filter)
|
||||
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = bot_filter)
|
||||
|
||||
if("summon")
|
||||
post_signal(control_freq, "command", "summon", "active", active, "target", get_turf(hostpda), "useraccess", hostpda.GetAccess(), "user", usr, s_filter = bot_filter)
|
||||
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = bot_filter)
|
||||
|
||||
/obj/item/integrated_radio/proc/add_to_radio(bot_filter) //Master filter control for bots. Must be placed in the bot's local New() to support map spawned bots.
|
||||
if(SSradio)
|
||||
SSradio.add_object(src, control_freq, filter = bot_filter)
|
||||
|
||||
/obj/item/integrated_radio/honkbot
|
||||
bot_filter = RADIO_HONKBOT
|
||||
bot_type = HONK_BOT
|
||||
|
||||
/obj/item/integrated_radio/beepsky
|
||||
bot_filter = RADIO_SECBOT
|
||||
bot_type = SEC_BOT
|
||||
|
||||
/obj/item/integrated_radio/medbot
|
||||
bot_filter = RADIO_MEDBOT
|
||||
bot_type = MED_BOT
|
||||
|
||||
/obj/item/integrated_radio/floorbot
|
||||
bot_filter = RADIO_FLOORBOT
|
||||
bot_type = FLOOR_BOT
|
||||
|
||||
/obj/item/integrated_radio/cleanbot
|
||||
bot_filter = RADIO_CLEANBOT
|
||||
bot_type = CLEAN_BOT
|
||||
|
||||
/obj/item/integrated_radio/mule
|
||||
bot_filter = RADIO_MULEBOT
|
||||
bot_type = MULE_BOT
|
||||
|
||||
/obj/item/integrated_radio/mule/Topic(href, href_list)
|
||||
..()
|
||||
switch(href_list["op"])
|
||||
if("start")
|
||||
post_signal(control_freq, "command", "start", "active", active, s_filter = RADIO_MULEBOT)
|
||||
|
||||
if("unload")
|
||||
post_signal(control_freq, "command", "unload", "active", active, s_filter = RADIO_MULEBOT)
|
||||
|
||||
if("setdest")
|
||||
if(GLOB.deliverybeacons)
|
||||
var/dest = input("Select Bot Destination", "Mulebot [active.suffix] Interlink", active.destination) as null|anything in GLOB.deliverybeacontags
|
||||
if(dest)
|
||||
post_signal(control_freq, "command", "target", "active", active, "destination", dest, s_filter = RADIO_MULEBOT)
|
||||
|
||||
if("retoff")
|
||||
post_signal(control_freq, "command", "autoret", "active", active, "value", 0, s_filter = RADIO_MULEBOT)
|
||||
|
||||
if("reton")
|
||||
post_signal(control_freq, "command", "autoret", "active", active, "value", 1, s_filter = RADIO_MULEBOT)
|
||||
|
||||
if("pickoff")
|
||||
post_signal(control_freq, "command", "autopick", "active", active, "value", 0, s_filter = RADIO_MULEBOT)
|
||||
|
||||
if("pickon")
|
||||
post_signal(control_freq, "command", "autopick", "active", active, "value", 1, s_filter = RADIO_MULEBOT)
|
||||
|
||||
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = RADIO_MULEBOT)
|
||||
Reference in New Issue
Block a user