goto

Privateunrated

Content

43 lines
{silence}
{assign(input):{lower:{args}}}
{assign(comment):   Stores all text past "!goto " as the input for where the user wants to go. (Carl-bot is fickle, and sometimes forgets what the {args} tag is if you assign other stuff first. Not sure on exact circumstances, so doing it first is easiest.)   }

{assign(comment):   Assign current position as the channel name the command was posted in.   }
{assign(pos):{channel}}

{assign(comment):   Assign list of places reachable from each "location" on the map. Don't include any locked doors, and make sure to only include the correct connection for one-way doors (e.g. the hall -> 301 -> 302 -> hall loop here). Also, don't repeat elements of the list, I don't think it breaks anything but it's best to be sure.   }

{assign(XXXAccess):}

{assign(lobbyAccess):elevators bar reception}
{assign(elevatorsAccess):lobby bar reception}
{assign(barAccess):lobby elevators reception}
{assign(receptionAccess):lobby elevators bar}
{assign(elevatorinteriorAccess):elevators}

{assign(elevatorsAccess):{if({contains(664602760808759317):{user(roleids)}}==true):lobby bar reception elevatorinterior|{elevatorsAccess}}}

{assign(comment):   Assign the output location by checking if the input is contained within the list of accessible locations for whatever channel the command is used in. Sets outRoom to empty if it isn't in the list.   }
{assign(outRoom):{if({contains({input}):{{pos}Access}}==true):{input}}}

{assign(comment):   If outRoom is empty, sets outRoom to their current location.   }
{assign(outRoom):{if({outRoom}==):{pos}|{outRoom}}}

{assign(comment):   Because adding and removing the same role breaks things a little, if you aren't going anywhere the removed role is set to any random role that doesn't exist.   }
{assign(extraRoleName):randomExtraRoleThatIsntUsedAnywhereElse}
{assign(pos):{if({outRoom}=={pos}):{extraRoleName}|{pos}}}

{assign(comment):   This is the bit that actually "moves" players between rooms. Adds the role required to view the room they're heading to, and removes the role required to see their current room. As stated above, if the player isn't moving, it just removes a nonexistent role to ensure they can still see the room they're in.   }
{cmd:rank custom +"{outRoom}" -"{pos}"}

{assign(comment):   Makes sure any text output is sent to whichever channel the player is moving to, prevents sending messages to channels that the player it's intended for just left.   }
{redirect:{outRoom}}

{assign(comment):   Break case for if they aren't going anywhere (catchall for invalid location, one way or another).   }
{break({pos}=={extraRoleName}):{mention} - you can't go to `{input}` from here! Check where you can go using `!look`.}

{assign(comment):   Break for if you're trying to access the elevator before the puzzle has been solved.   }
{break({all({outRoom}==elevators|{contains(664602760808759317):{user(roleids)}}==false|{input}==elevatorinterior):true|false}==true):{mention} - the elevators are broken at the moment, so there's nothing in there for you to do (yet).}

{assign(comment):   Output message for successful movement. Ping is to make sure they actually see there's a new channel in case it doesn't move them there immediately, as they'll have other channels available.   }
{mention} moved from {pos} to {outRoom}.
Raw JSON
{
  "id": 89115,
  "created_at": "2019-11-15T01:59:12.000Z",
  "tag_name": "goto",
  "nsfw": false,
  "owner_id": "101093457585516544",
  "uses": 48,
  "description": null,
  "restricted": false,
  "shared": false,
  "deleted": false,
  "safe": "unrated",
  "hidden": false,
  "guild_id": "642994355778617345",
  "sharer": "101093457585516544",
  "content": "{silence}\n{assign(input):{lower:{args}}}\n{assign(comment):   Stores all text past \"!goto \" as the input for where the user wants to go. (Carl-bot is fickle, and sometimes forgets what the {args} tag is if you assign other stuff first. Not sure on exact circumstances, so doing it first is easiest.)   }\n\n{assign(comment):   Assign current position as the channel name the command was posted in.   }\n{assign(pos):{channel}}\n\n{assign(comment):   Assign list of places reachable from each \"location\" on the map. Don't include any locked doors, and make sure to only include the correct connection for one-way doors (e.g. the hall -> 301 -> 302 -> hall loop here). Also, don't repeat elements of the list, I don't think it breaks anything but it's best to be sure.   }\n\n{assign(XXXAccess):}\n\n{assign(lobbyAccess):elevators bar reception}\n{assign(elevatorsAccess):lobby bar reception}\n{assign(barAccess):lobby elevators reception}\n{assign(receptionAccess):lobby elevators bar}\n{assign(elevatorinteriorAccess):elevators}\n\n{assign(elevatorsAccess):{if({contains(664602760808759317):{user(roleids)}}==true):lobby bar reception elevatorinterior|{elevatorsAccess}}}\n\n{assign(comment):   Assign the output location by checking if the input is contained within the list of accessible locations for whatever channel the command is used in. Sets outRoom to empty if it isn't in the list.   }\n{assign(outRoom):{if({contains({input}):{{pos}Access}}==true):{input}}}\n\n{assign(comment):   If outRoom is empty, sets outRoom to their current location.   }\n{assign(outRoom):{if({outRoom}==):{pos}|{outRoom}}}\n\n{assign(comment):   Because adding and removing the same role breaks things a little, if you aren't going anywhere the removed role is set to any random role that doesn't exist.   }\n{assign(extraRoleName):randomExtraRoleThatIsntUsedAnywhereElse}\n{assign(pos):{if({outRoom}=={pos}):{extraRoleName}|{pos}}}\n\n{assign(comment):   This is the bit that actually \"moves\" players between rooms. Adds the role required to view the room they're heading to, and removes the role required to see their current room. As stated above, if the player isn't moving, it just removes a nonexistent role to ensure they can still see the room they're in.   }\n{cmd:rank custom +\"{outRoom}\" -\"{pos}\"}\n\n{assign(comment):   Makes sure any text output is sent to whichever channel the player is moving to, prevents sending messages to channels that the player it's intended for just left.   }\n{redirect:{outRoom}}\n\n{assign(comment):   Break case for if they aren't going anywhere (catchall for invalid location, one way or another).   }\n{break({pos}=={extraRoleName}):{mention} - you can't go to `{input}` from here! Check where you can go using `!look`.}\n\n{assign(comment):   Break for if you're trying to access the elevator before the puzzle has been solved.   }\n{break({all({outRoom}==elevators|{contains(664602760808759317):{user(roleids)}}==false|{input}==elevatorinterior):true|false}==true):{mention} - the elevators are broken at the moment, so there's nothing in there for you to do (yet).}\n\n{assign(comment):   Output message for successful movement. Ping is to make sure they actually see there's a new channel in case it doesn't move them there immediately, as they'll have other channels available.   }\n{mention} moved from {pos} to {outRoom}.",
  "embed": "{}",
  "last_fetched": "2026-10-20T20:42:42.415Z"
}