Guest User

Timebomb (tag) v1.2

a guest
Aug 7th, 2020
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.91 KB | None | 0 0
  1. {//; BLARGBOT TIMEBOMB COMMAND
  2.  
  3. * Created by k6ka#1014
  4. * Code is released under a Creative Commons Attribution-ShareAlike license
  5. * Give credit where credit is due!
  6. * See https://k6ka.blogspot.com/2020/05/timebomb-command-for-discord.html for instructions
  7.  
  8. Version 1.2T dated July 30, 2020
  9. }
  10.  
  11. {//;Check to see if this is being run as a custom command in a server}
  12. {if;{iscc};{//;If true, then run the rest of the command}
  13.  
  14. {//;Check to see if the user left the command blank}
  15. {if;>;{argslength};0;
  16.  
  17. {//;Check to see if the user ID is valid}
  18. {set;~victim;{userid;{args};quiet}}
  19. {if;{get;~victim};==;;
  20. ❌ | Oops, I couldn't find the specified user in this server. Please specify a valid username or user ID.;
  21.  
  22. {//;If user tried to blow up blargbot}
  23. {if;{get;~victim};==;134133271750639616;❌ | You thought you could trick me into bombing myself, {usermention}?!;
  24. {//;If user tried to blow themselves up}
  25. {if;{get;~victim};==;{userid};❌ | Please, {usermention}! Pick a friend if you have to!;
  26. {//;If user tried to blow up a bot}
  27. {if;{userisbot;{get;~victim}};==;true;❌ | I'm not bombing one of my own kin, {usermention}! Pick a *human* to blow up.;
  28.  
  29. {//;Else, let the show continue}
  30.  
  31. {//;First, set the wire color}
  32. {set;~wireColor;{randchoose; 🔴 ; ⚪ ; 🔵 }}
  33.  
  34. {//;Then we get the text version}
  35. {set;~wireColorText;
  36. {switch;{get;~wireColor};
  37. 🔴 ; red;
  38. ⚪ ; white;
  39. 🔵 ; blue;
  40. ❌ **FATAL ERROR**: No wire color was set!!!
  41. }
  42. }
  43.  
  44. {//;Sends the first message to the channel the command was used in}
  45. {set;~msgid;{send;{channelid};💣 | {randchoose;
  46. ね, {usermention;{get;~victim}}, there's a stowaway in your pants! It's a bomb on a one minute timer. There are three wires: red, white, and blue. Click on the colour emoji below to cut that wire and try to defuse the bomb!;
  47. Hey {usermention;{get;~victim}}, someone shoved a bomb down your pants! There's one minute to go on the fuse, and there are three wires: red, white, and blue. Quick, click on the colour emoji below to tell me which wire to cut!;
  48. Watch out, {usermention;{get;~victim}}! There's a bomb strapped to your undies! The timer is set for one minute, and there are three wires: red, white, and blue. Click on the colour emoji below to cut that wire.;
  49. *Achtung!* There's a bomb down your pants, {usermention;{get;~victim}}! There's a one minute fuse on it, and there appears to be three wires: red, white, and blue. Given where it is, you should let me cut one of the wires for you{semi} click on the colour emoji below to tell me which one to cut!;
  50. Hey {usermention;{get;~victim}}, I saw someone put a bomb down your pants. One minute fuse, three wires: red, white, and blue. Time is running out! Click on the colour emoji below to cut that wire.
  51. }}}
  52.  
  53. {//; Add the corresponding reactions to the message}
  54. {reactadd;{get;~msgid}; 🔴 ; ⚪ ; 🔵 }
  55.  
  56. {//;DMs the initiating user the colour of the correct wire}
  57. {if;{flagset;q};==;true;{//;Don't send DMs - user has set quiet mode};{dm;{userid};Hey, don't tell {usernick;{get;~victim}}, but it's the {get;~wireColorText} wire.}}
  58.  
  59. {//; Wait until user reacts one of the emojis provided}
  60. {void;
  61. {waitreaction;{get;~msgid};{userid;{get;~victim}};🔴 ⚪ 🔵 ;{set;~reaction;{reaction}}
  62. }
  63. }
  64.  
  65. {//; Get the content of the reaction}
  66. {switch;{get;~reaction};
  67. 🔴 ; {//; User reacted red}
  68. {if;{get;~reaction};contains;{get;~wireColor};✅ | {exec;bomb-successmsg};💥 | {exec;bomb-failmsg} (You should have picked the {get;~wireColorText} wire) };
  69. ⚪ ; {//; User reacted white}
  70. {if;{get;~reaction};contains;{get;~wireColor};✅ | {exec;bomb-successmsg};💥 | {exec;bomb-failmsg} (You should have picked the {get;~wireColorText} wire) };
  71. 🔵 ; {//; User reacted blue}
  72. {if;{get;~reaction};contains;{get;~wireColor};✅ | {exec;bomb-successmsg};💥 | {exec;bomb-failmsg} (You should have picked the {get;~wireColorText} wire) };
  73. {//;User didn't react in time}💥 | {randchoose;
  74. Oh come on, {usermention;{get;~victim}}, you could've at least picked something! Well, now you're dead. You see that? Guts everywhere.;
  75. Too slow, {usermention;{get;~victim}}. You were a sitting duck waiting for the bomb to go off. Try to save yourself next time!;
  76. Well, it looks like {usermention;{get;~victim}} failed to pick a wire in time. Their indecisveness sure paid off. With their death!;
  77. Please, {usermention;{get;~victim}}, you could've at least tried! Oh well. As the saying goes: you'll always lose if you don't try.;
  78. Hello? Earth to {usermention;{get;~victim}}? You were just bombed! Next time, you should tell me which wire to cut to try to save yourself from annihilation.}{//;Display the wire they should've cut after the fail message} (You should have picked the {get;~wireColorText} wire)
  79. }
  80. }
  81. }
  82. }
  83. }
  84.  
  85. {//;If command was left empty}
  86. ;{embed;
  87. {embedbuild;
  88. title:💣 Tick, tick... BOOM!;
  89. description:Type ``b!{commandname} <username>`` to throw a bomb at someone! They have one minute to cut the correct wire or they will be blown to smithereens! Mentions will work, as will user IDs.;
  90. color:e09040;
  91. footer.text:Command created by {exec;person;249223024962830338} and is licensed under a CC BY-SA license • Version 1.2T
  92. }
  93. }
  94. }
  95.  
  96. ;{//;If not being run as a CC, will output this instead}
  97. {embed;
  98. {embedbuild;
  99. title:💣 Tick, tick... BOOM!;
  100. description:Many IRC bots have a "timebomb" fun command that provides endless hours of ensuing fun with other users. It works a little like this:{newline;2}{//;
  101. }• User A uses the "timebomb" command on User B.{newline}{//;
  102. }• The IRC bot will ping User B and present them with a selection of coloured wires to cut, along with how much time is on the fuse.{newline}{//;
  103. }• User B needs to respond back with the correct colour in order to defuse the bomb.{newline}{//;
  104. }• If User B guesses the right colour, they are saved.{newline}{//;
  105. }• If User B guesses the wrong colour, or if they don't respond by the time the timer runs out, the bomb will go off.{newline;2}{//;
  106. }I couldn't find any equivalent functionality on Discord, so I made my own implementation using blargbot's BBTag language. It works pretty well, and of course, I'm making the code for it open to everyone.{newline;2}{//;
  107. }**Cool! How do I add this to my server?**{newline;2}{//;
  108. }Since this command needs the ``send`` tag, which is disabled on the public tags system, you'll need to import this command into your server as a custom command in order for it to work. Before you begin, double-check the following:{newline;2}{//;
  109. }• You are either the Owner of, or have Admin permissions on, the server you want to add it to.{newline}{//;
  110. }• blargbot has permissions to Read and Send Messages, Add Emoji Reactions, and Read Message History.{newline;2}{//;
  111. }You can then import the command in two ways:{newline;2}{//;
  112. }1. Import this command to your server by typing ``b!cc import timebomb``. It will be available for use right away, with no additional setup, and you'll get the latest updates to the command automatically.{newline}{//;
  113. }2. Import the command manually, which will give you more control over the command and allow you to customize it to your liking. Instructions can be found on [my blog](https://k6ka.blogspot.com/2020/05/timebomb-command-for-discord.html).{newline;2}{//;
  114. }I highly encourage you to give this a go and invite some of your friends over to play around with it. Relive some classic IRC fun right in the modern comforts of Discord!;
  115. color:e09040;
  116. footer.text:Command created by {exec;person;249223024962830338} and is licensed under a CC BY-SA license • Version 1.2T
  117. }
  118. }
  119. }
Add Comment
Please, Sign In to add comment