rajat_cj

BDFD • Calculator

Aug 26th, 2021 (edited)
841
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.40 KB | None | 0 0
  1. CALCULATOR
  2. COMMANDS : 2
  3. VARIABLES : 0
  4. AUTHOR : Nothing..#4241
  5. MODIFIED BY : RedPlay#6353
  6.  
  7.  
  8.  
  9. -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
  10. CODE 1
  11. -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
  12.  
  13. Trigger : any
  14.  
  15. Code :
  16.  
  17. $nomention
  18. $title[Botuu Calculator]
  19. $description[```kt
  20. 0```
  21. ]
  22. $addButton[no;calc.7;7;secondary;no;]
  23. $addButton[no;calc.8;8;secondary;no;]
  24. $addButton[no;calc.9;9;secondary;no;]
  25. $addButton[no;calc.x;x;primary;no;]
  26. $addButton[no;calc.÷;÷;primary;no;]
  27. $addButton[yes;calc.4;4;secondary;no;]
  28. $addButton[no;calc.5;5;secondary;no;]
  29. $addButton[no;calc.6;6;secondary;no;]
  30. $addButton[no;calc.+;+;primary;no;]
  31. $addButton[no;calc.-;-;primary;no;]
  32. $addButton[yes;calc.1;1;secondary;no;]
  33. $addButton[no;calc.2;2;secondary;no;]
  34. $addButton[no;calc.3;3;secondary;no;]
  35. $addButton[no;calc.(;(;primary;no;]
  36. $addButton[no;calc.););primary;no;]
  37. $addButton[yes;calc.0;0;secondary;no;]
  38. $addButton[no;calc.00;00;secondary;no;]
  39. $addButton[no;calc.#;=;success;no;]
  40. $addButton[no;calc.<;<;danger;no;]
  41. $addButton[no;calc.ac;AC;danger;no;]
  42.  
  43.  
  44.  
  45. -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
  46. CODE 2
  47. -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
  48.  
  49. Trigger : $onInteraction
  50.  
  51. Code :
  52.  
  53. $nomention
  54. $enableDecimals[yes]
  55. $suppressErrors[Hey <@$authorID>, your expression seems strange!]
  56. $onlyIf[$cropText[$customID;5;]==calc.;]
  57. $textSplit[$replaceText[$replaceText[$getEmbedData[$channelID;$messageID;1;description];```;;2];kt;;1];]
  58.  
  59. $var[calc;$replaceText[$replaceText[$getEmbedData[$channelID;$messageID;1;description];```;;2];kt;;1]]
  60. $var[history;$getEmbedData[$channelID;$messageID;1;footer]]
  61.  
  62.  
  63. $if[$customID==calc.1]
  64. $var[Calculator;$replaceText[$replaceText[$checkContains[$splitText[$getTextSplitLength];+;-;×;÷];false;$var[calc]1;-1];true;$var[calc] 1;-1]]
  65. $endif
  66.  
  67. $if[$customID==calc.2]
  68. $var[Calculator;$replaceText[$replaceText[$checkContains[$splitText[$getTextSplitLength];+;-;×;÷];false;$var[calc]2;-1];true;$var[calc] 2;-1]]
  69. $endif
  70.  
  71. $if[$customID==calc.3]
  72. $var[Calculator;$replaceText[$replaceText[$checkContains[$splitText[$getTextSplitLength];+;-;×;÷];false;$var[calc]3;-1];true;$var[calc] 3;-1]]
  73. $endif
  74.  
  75. $if[$customID==calc.4]
  76. $var[Calculator;$replaceText[$replaceText[$checkContains[$splitText[$getTextSplitLength];+;-;×;÷];false;$var[calc]4;-1];true;$var[calc] 4;-1]]
  77. $endif
  78.  
  79. $if[$customID==calc.5]
  80. $var[Calculator;$replaceText[$replaceText[$checkContains[$splitText[$getTextSplitLength];+;-;×;÷];false;$var[calc]5;-1];true;$var[calc] 5;-1]]
  81. $endif
  82.  
  83. $if[$customID==calc.6]
  84. $var[Calculator;$replaceText[$replaceText[$checkContains[$splitText[$getTextSplitLength];+;-;×;÷];false;$var[calc]6;-1];true;$var[calc] 6;-1]]
  85. $endif
  86.  
  87. $if[$customID==calc.7]
  88. $var[Calculator;$replaceText[$replaceText[$checkContains[$splitText[$getTextSplitLength];+;-;×;÷];false;$var[calc]7;-1];true;$var[calc] 7;-1]]
  89. $endif
  90.  
  91. $if[$customID==calc.8]
  92. $var[Calculator;$replaceText[$replaceText[$checkContains[$splitText[$getTextSplitLength];+;-;×;÷];false;$var[calc]8;-1];true;$var[calc] 8;-1]]
  93. $endif
  94.  
  95. $if[$customID==calc.9]
  96. $var[Calculator;$replaceText[$replaceText[$checkContains[$splitText[$getTextSplitLength];+;-;×;÷];false;$var[calc]9;-1];true;$var[calc] 9;-1]]
  97. $endif
  98.  
  99. $if[$customID==calc.0]
  100. $var[Calculator;$replaceText[$replaceText[$checkCondition[$splitText[$getTextSplitLength]==0];true;$var[calc];-1];false;$replaceText[$replaceText[$checkContains[$splitText[$getTextSplitLength];+;-;×;÷];false;$var[calc]0;-1];true;$var[calc] 0;-1];-1]]
  101. $endif
  102.  
  103. $if[$customID==calc.00]
  104. $var[Calculator;$replaceText[$replaceText[$checkCondition[$splitText[$getTextSplitLength]==0];true;$var[calc];-1];false;$replaceText[$replaceText[$checkContains[$splitText[$getTextSplitLength];+;-;×;÷];false;$var[calc]00;-1];true;$var[calc] 0;-1];-1]]
  105.  
  106. $endif
  107.  
  108. $if[$customID==calc.000]
  109. $var[Calculator;$replaceText[$replaceText[$checkCondition[$splitText[$getTextSplitLength]==0];true;$var[calc];-1];false;$replaceText[$replaceText[$checkContains[$splitText[$getTextSplitLength];+;-;×;÷];false;$var[calc]000;-1];true;$var[calc] 0;-1];-1]]
  110. $endif
  111.  
  112. $if[$customID==calc.÷]
  113. $onlyIf[$checkContains[$splitText[$getTextSplitLength];+;-;×;÷;(]==false;Hey <@$authorID>, you already have an operator at the end that is $splitText[$getTextSplitLength]]
  114. $var[Calculator;$var[calc] ÷]
  115. $endif
  116.  
  117. $if[$customID==calc.x]
  118. $onlyIf[$checkContains[$splitText[$getTextSplitLength];+;-;×;÷;(]==false;Hey <@$authorID>, you already have an operator at the end that is $splitText[$getTextSplitLength]]
  119. $var[Calculator;$var[calc] ×]
  120. $endif
  121.  
  122. $if[$customID==calc.+]
  123. $onlyIf[$checkContains[$splitText[$getTextSplitLength];+;-;×;(;÷]==false;Hey <@$authorID>, you already have an operator at the end that is $splitText[$getTextSplitLength]]
  124. $var[Calculator;$var[calc] +]
  125. $endif
  126.  
  127. $if[$customID==calc.(]
  128. $if[$checkContains[$splitText[$getTextSplitLength];+;-;×;÷]==false]
  129. $var[Calculator;$var[calc] × (]
  130. $else
  131. $var[Calculator;$var[calc] (]
  132. $endif
  133. $endif
  134.  
  135. $if[$customID==calc.)]
  136. $onlyIf[$checkContains[$splitText[$getTextSplitLength];+;-;×;÷;(]==false;Hey <@$authorID>, you have an operator at the end that is $splitText[$getTextSplitLength]! So `)` cant be placed without any numeric intiger at last!]]
  137. $var[Calculator;$var[calc])]
  138. $endif
  139.  
  140. $if[$customID==calc.-]
  141. $onlyIf[$checkContains[$splitText[$getTextSplitLength];+;-;x;÷]==false;Hey <@$authorID>, you already have an operator at the end that is $splitText[$getTextSplitLength]]
  142. $var[Calculator;$var[calc] -]
  143. $endif
  144.  
  145. $if[$customID==calc.#]
  146. $onlyIf[$checkContains[$var[calc];+;-;×;÷]==true;Hey <@$authorID>, you haven't chosen any operator in your calculation yet please choose one]
  147. $onlyIf[$checkContains[$splitText[$getTextSplitLength];+;-;x;÷]==false;Hey <@$authorID>, your calculation ends with an operator which kinda doesn't make any sense]
  148. $var[Calculator;$calculate[$replaceText[$replaceText[$var[calc];×;*;-1];÷;/;-1]]]
  149. $var[history;$var[calc] = $var[Calculator]
  150. $var[history]]
  151. $endif
  152.  
  153. $if[$customID==calc.ac]
  154. $var[Calculator;0]
  155. $endif
  156.  
  157.  
  158. $if[$customID==calc.<]
  159. $removeSplitTextElement[$getTextSplitLength]
  160. $var[Calculator;$joinSplitText[]]
  161. $endif
  162.  
  163. $title[Botuu Calculator]
  164. $footer[$cropText[$var[history];300;...]]
  165. $description[```kt
  166. $var[Calculator]```]
  167.  
  168. $c[Author : Nothing..#4241, Modified by : RedPlay#6353]
  169.  
  170.  
  171. -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Advertisement
Add Comment
Please, Sign In to add comment