Skip to content

Instantly share code, notes, and snippets.

/proc/get_hat_icon(var/obj/item/hat, var/offset_x = 0, var/offset_y = 0)
var/list/mob_hat_cache = SSicon_cache.mob_hat_cache
var/t_state = hat.icon_state
if(hat.item_state_slots && hat.item_state_slots[slot_head_str])
t_state = hat.item_state_slots[slot_head_str]
else if(hat.item_state)
t_state = hat.item_state
var/key = "[t_state]_[offset_x]_[offset_y]"
if(!mob_hat_cache[key]) // Not ideal as there's no guarantee all hat icon_states
var/t_icon = INV_HEAD_DEF_ICON // are unique across multiple dmis, but whatever.
@Baa14453
Baa14453 / Rocketchat Outgoing Discord Webhook
Created June 1, 2018 17:37
Sends messages from Rocketchat to Discord.
class Script {
prepare_outgoing_request({ request }) {
request.data = {
content: request.data.text,
username: request.data.user_name,
avatar_url: `https://<RocketchatServerUrlGoesHere/avatar/${request.data.user_name}`
}
return request;