Guest User

UltimateChatBot Free

a guest
May 30th, 2018
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 10.23 KB | None | 0 0
  1. options:
  2.     prefix : &a&lUCB &8| &7
  3.     adminperm : rang.admin
  4.     language : en # en (other languages only in premium version on skUnity)
  5.     onlydisplayanswertoplayer : true
  6.     version : 1.1.0
  7.    
  8. on load:
  9.     if {varpref} isn't set:
  10.         set {varpref} to "%a random integer from 10000 to 99999%"
  11.     set {ucb.%{varpref}%.removechat} to "false"
  12.     set {ucb.%{varpref}%.onlytoplayer} to "{@onlydisplayanswertoplayer}"
  13.     set {ucb.%{varpref}%.language} to "{@language}"
  14.     {ucb.%{varpref}%.language} is "en":
  15.         set {ucb.text1} to "The setup already has been completed. Confirm with /setup confirm"
  16.         set {ucb.text2} to "What should the chatbot be called to react on? (Tim, Frank, Lisa, etc.)"
  17.         set {ucb.text3} to "Which permission should a user need in order to use the bot? (none for none)"
  18.         set {ucb.text4} to "The setup has been completed. Please wait until installation is done."
  19.         set {ucb.text5} to "what"
  20.         set {ucb.text6} to "where"
  21.         set {ucb.text7} to "who"
  22.         set {ucb.why} to "why"
  23.         set {ucb.whose} to "whose"
  24.         set {ucb.how} to "how"
  25.         set {ucb.text8} to "The installation is complete."
  26.         set {ucb.text8.5} to "Add questions with /addquest [<interrogative>] obj [<object>]."
  27.         set {ucb.text9} to "Example: /addquest what bedwars"
  28.         set {ucb.text10} to "You'll be asked to answer in chat."
  29.         set {ucb.text11} to "Example: BedWars is a great game mode."
  30.         set {ucb.text12} to "Question added. Answer in chat."
  31.         set {ucb.text13} to "&8[----&bUltimateChatBot &7By HiverHD&8----]"
  32.         set {ucb.text16} to "&8[----&bUltimateChatBot &7By HiverHD&8----]"
  33.         set {noidea} to "&7No idea."
  34.  
  35. command /ucb:
  36.     aliases: /ultimatechatbot:ucb, /ultimatechatbot, /ucb:ucb, /chatbot, /ucb:chatbot
  37.     trigger:
  38.         player has permission "{@adminperm}":
  39.             send "{@prefix} %{ucb.text13}%"
  40.             send "{@prefix} /ucb"
  41.             send "{@prefix} /reset"
  42.             send "{@prefix} /import [<ID>]"
  43.             send "{@prefix} /export"
  44.             send "{@prefix} /listquest"
  45.             send "{@prefix} /addquest [<INTERROGATIVE>] obj [<OBJECT>]"
  46.             send "{@prefix} /setup"
  47.             send "{@prefix} %{ucb.text16}%"
  48.  
  49. on join:
  50.     wait 60 ticks
  51.     if player has permission "{@adminperm}":
  52.         {ucb.%{varpref}%.ucb.setup} isn't set:
  53.             execute player command "/setup"
  54.            
  55. command /setup [<text>]:
  56.     aliases: /ucb:setup
  57.     trigger:
  58.         player has permission "{@adminperm}":
  59.             arg-1 isn't set:
  60.                 {ucb.%{varpref}%.ucb.setup} is "done":
  61.                     send "{@prefix} %{ucb.text1}%"
  62.                 else:
  63.                     execute player command "/setup confirm"
  64.             arg-1 is "confirm":
  65.                 send "{@prefix} &41. &7%{ucb.text2}%"
  66.                 set {ucb.%{varpref}%.askforname} to true
  67.                
  68.            
  69. command /install:
  70.     aliases: /ucb:install
  71.     trigger:
  72.         player has permission "{@adminperm}":
  73.             wait 20 ticks
  74.             set {ucb.%{varpref}%.question.what} to "%{ucb.text5}%"
  75.             set {ucb.%{varpref}%.question.where} to "%{ucb.text6}%"
  76.             set {ucb.%{varpref}%.question.who} to "%{ucb.text7}%"
  77.             send "{@prefix} &43. &7%{ucb.text8}%"
  78.             send "{@prefix} %{ucb.text8.5}%"
  79.             wait 20 ticks
  80.             send "{@prefix} %{ucb.text9}%"
  81.             send "{@prefix} %{ucb.text10}%"
  82.             send "{@prefix} %{ucb.text11}%"
  83.             stop
  84.            
  85. on chat:
  86.     player has permission "{@adminperm}":
  87.         {ucb.%{varpref}%.askforname} is true:
  88.             cancel event
  89.             wait 20 ticks
  90.             set {ucb.%{varpref}%.askforname} to false
  91.             set {ucb.%{varpref}%.ucb.chatbot.name} to "%message%"
  92.             send "{@prefix} &42. &7%{ucb.text3}%"
  93.             set {ucb.%{varpref}%.askforperm} to true
  94.             stop
  95.         {ucb.%{varpref}%.askforperm} is true:
  96.             cancel event
  97.             wait 20 ticks
  98.             set {ucb.%{varpref}%.askforperm} to false
  99.             if message is "none":
  100.                 set {ucb.%{varpref}%.ucb.chatbot.perm} to "none"
  101.             else:
  102.                 set {ucb.%{varpref}%.ucb.chatbot.perm} to message
  103.             set {ucb.%{varpref}%.ucb.setup} to "done"
  104.             execute player command "/install"
  105.             stop
  106.         {ucb.%{varpref}%.askforans} is set:
  107.             {ucb.%{varpref}%.frg.ans.%{ucb.%{varpref}%.askforans.quest}%.%{ucb.%{varpref}%.askforans}%} is true:
  108.                 cancel event
  109.                 wait 20 ticks
  110.                 set {ucb.%{varpref}%.ucb.%{ucb.%{varpref}%.askforans.quest}%.%{ucb.%{varpref}%.askforans}%.ans} to "%message%"
  111.                 delete {ucb.%{varpref}%.askforans}
  112.            
  113.            
  114. command /addquest [<text>] obj [<text>]:
  115.     trigger:
  116.         player has permission "{@adminperm}":
  117.             arg-2 contains "%{ucb.%{varpref}%.ucb.chatbot.name}%":
  118.                 send "{@prefix} &4&m%{ucb.%{varpref}%.ucb.chatbot.name}%"
  119.                 send "{@prefix} &aYOU &7(en) &8/ &aDU &7(de)"
  120.                 stop
  121.             loop {ucb.%{varpref}%.frg.%arg-1%::*}:
  122.                 {ucb.%{varpref}%.frg.ans.%arg-1%.%loop-value%} is true:
  123.                     remove arg-2 from {ucb.%{varpref}%.frg.%arg-1%::*}
  124.                     send "{@prefix} &4&m%arg-2%"
  125.                     stop
  126.             add arg-2 to {ucb.%{varpref}%.frg.%arg-1%::*}
  127.             set {ucb.%{varpref}%.frg.ans.%arg-1%.%arg-2%} to true
  128.             add "%arg-1%.%arg-2%" to {ucb.%{varpref}%.questlist::*}
  129.             send "{@prefix} %{ucb.text12}%"
  130.             set {ucb.%{varpref}%.askforans} to "%arg-2%"
  131.             set {ucb.%{varpref}%.askforans.quest} to "%arg-1%"
  132.            
  133. command /reset [<text>]:
  134.     trigger:
  135.         player has permission "{@adminperm}":
  136.             arg-1 isn't set:
  137.                 send "{@prefix} /reset confirm"
  138.                 send "{@prefix} Saved. %{varpref}%"
  139.             arg-1 is "confirm":
  140.                 send "{@prefix} Exported: %{varpref}%. Use /varpref %{varpref}% to restore."
  141.                 set {varpref} to "%random integer from 10000 to 99999%"
  142.                 send "{@prefix} New: %{varpref}%."
  143.                 execute player command "/setup"
  144.            
  145. command /export:
  146.     trigger:
  147.         player has permission "{@adminperm}":
  148.             send "{@prefix} Exported: %{varpref}%. Use /import %{varpref}% to import."
  149.                
  150.                
  151. command /import [<int>]:
  152.     trigger:
  153.         player has permission "{@adminperm}":
  154.             arg-1 is set:
  155.                 send "{@prefix} Exported: %{varpref}%. Use /import %{varpref}% to restore last export."
  156.                 set {varpref} to "%arg-1%"
  157.                 send "{@prefix} New: %{varpref}%."
  158.            
  159. command /listquest:
  160.     trigger:
  161.         player has permission "{@adminperm}":
  162.             send "{@prefix} List:"
  163.             loop {ucb.%{varpref}%.questlist::*}:
  164.                 send "&e-  %loop-value%:"
  165.                 send "&e-- %{ucb.%{varpref}%.ucb.%loop-value%.ans}%"
  166.            
  167.            
  168. on chat:
  169.     {ucb.%{varpref}%.ucb.setup} isn't "done":
  170.         stop
  171.     set {ucb.%{varpref}%.message} to message
  172.     set {ucb.%{varpref}%.chatbot.allowed.%player%} to false
  173.     {ucb.%{varpref}%.ucb.chatbot.perm} isn't "none":
  174.         player has permission "%{ucb.%{varpref}%.ucb.chatbot.perm}%":
  175.             set {ucb.%{varpref}%.chatbot.allowed.%player%} to true
  176.     {ucb.%{varpref}%.ucb.chatbot.perm} is "none":
  177.         set {ucb.%{varpref}%.chatbot.allowed.%player%} to true
  178.     {ucb.%{varpref}%.chatbot.allowed.%player%} is true:
  179.         set {ucb.%{varpref}%.loop} to true
  180.         {ucb.%{varpref}%.onlytoplayer} is "true":
  181.             set {ucb.%{varpref}%.loop} to false
  182.         set {ucb.%{varpref}%.good} to false
  183.         {ucb.%{varpref}%.message} contains "%{ucb.%{varpref}%.ucb.chatbot.name}%":
  184.             set {ucb.%{varpref}%.good} to true
  185.         {ucb.%{varpref}%.good} is false:
  186.             stop
  187.         {ucb.%{varpref}%.removechat} is "true":
  188.             cancel event
  189.         wait 5 ticks
  190.         {ucb.%{varpref}%.message} contains "%{ucb.whose}%":
  191.             #how
  192.             loop {ucb.%{varpref}%.frg.%{ucb.whose}%::*}:
  193.                 {ucb.%{varpref}%.frg.ans.%{ucb.whose}%.%loop-value%} is true:
  194.                     {ucb.%{varpref}%.message} contains "%loop-value%":
  195.                         {ucb.%{varpref}%.loop} is true:
  196.                             loop all players:
  197.                                 send "&e%{ucb.%{varpref}%.ucb.chatbot.name}% &8| &7%{ucb.%{varpref}%.ucb.%{ucb.whose}%.%loop-value%.ans}%" to loop-player
  198.                                 stop
  199.                         else:
  200.                             send "&e%{ucb.%{varpref}%.ucb.chatbot.name}% &8| &7%{ucb.%{varpref}%.ucb.%{ucb.whose}%.%loop-value%.ans}%"
  201.                             stop
  202.         {ucb.%{varpref}%.message} contains "%{ucb.text5}%":
  203.             #what
  204.             loop {ucb.%{varpref}%.frg.%{ucb.text5}%::*}:
  205.                 {ucb.%{varpref}%.frg.ans.%{ucb.text5}%.%loop-value%} is true:
  206.                     {ucb.%{varpref}%.message} contains "%loop-value%":
  207.                         {ucb.%{varpref}%.loop} is true:
  208.                             loop all players:
  209.                                 send "&e%{ucb.%{varpref}%.ucb.chatbot.name}% &8| &7%{ucb.%{varpref}%.ucb.%{ucb.text5}%.%loop-value%.ans}%" to loop-player
  210.                                 stop
  211.                         else:
  212.                             send "&e%{ucb.%{varpref}%.ucb.chatbot.name}% &8| &7%{ucb.%{varpref}%.ucb.%{ucb.text5}%.%loop-value%.ans}%"
  213.                             stop
  214.         {ucb.%{varpref}%.message} contains "%{ucb.text6}%":
  215.             #where
  216.             loop {ucb.%{varpref}%.frg.%{ucb.text6}%::*}:
  217.                 {ucb.%{varpref}%.frg.ans.%{ucb.text6}%.%loop-value%} is true:
  218.                     {ucb.%{varpref}%.message} contains "%loop-value%":
  219.                         {ucb.%{varpref}%.loop} is true:
  220.                             loop all players:
  221.                                 send "&e%{ucb.%{varpref}%.ucb.chatbot.name}% &8| &7%{ucb.%{varpref}%.ucb.%{ucb.text6}%.%loop-value%.ans}%" to loop-player
  222.                                 stop
  223.                         else:
  224.                             send "&e%{ucb.%{varpref}%.ucb.chatbot.name}% &8| &7%{ucb.%{varpref}%.ucb.%{ucb.text6}%.%loop-value%.ans}%"
  225.                             stop
  226.         {ucb.%{varpref}%.message} contains "%{ucb.text7}%":
  227.             #who
  228.             loop {ucb.%{varpref}%.frg.%{ucb.text7}%::*}:
  229.                 {ucb.%{varpref}%.frg.ans.%{ucb.text7}%.%loop-value%} is true:
  230.                     {ucb.%{varpref}%.message} contains "%loop-value%":
  231.                         {ucb.%{varpref}%.loop} is true:
  232.                             loop all players:
  233.                                 send "&e%{ucb.%{varpref}%.ucb.chatbot.name}% &8| &7%{ucb.%{varpref}%.ucb.%{ucb.text7}%.%loop-value%.ans}%" to loop-player
  234.                                 stop
  235.                         else:
  236.                             send "&e%{ucb.%{varpref}%.ucb.chatbot.name}% &8| &7%{ucb.%{varpref}%.ucb.%{ucb.text7}%.%loop-value%.ans}%"
  237.                             stop
  238.         {ucb.%{varpref}%.message} contains "%{ucb.how}%":
  239.             #how
  240.             loop {ucb.%{varpref}%.frg.%{ucb.how}%::*}:
  241.                 {ucb.%{varpref}%.frg.ans.%{ucb.how}%.%loop-value%} is true:
  242.                     {ucb.%{varpref}%.message} contains "%loop-value%":
  243.                         {ucb.%{varpref}%.loop} is true:
  244.                             loop all players:
  245.                                 send "&e%{ucb.%{varpref}%.ucb.chatbot.name}% &8| &7%{ucb.%{varpref}%.ucb.%{ucb.how}%.%loop-value%.ans}%" to loop-player
  246.                                 stop
  247.                         else:
  248.                             send "&e%{ucb.%{varpref}%.ucb.chatbot.name}% &8| &7%{ucb.%{varpref}%.ucb.%{ucb.how}%.%loop-value%.ans}%"
  249.                             stop
  250.         {ucb.%{varpref}%.message} contains "%{ucb.why}%":
  251.             #how
  252.             loop {ucb.%{varpref}%.frg.%{ucb.why}%::*}:
  253.                 {ucb.%{varpref}%.frg.ans.%{ucb.why}%.%loop-value%} is true:
  254.                     {ucb.%{varpref}%.message} contains "%loop-value%":
  255.                         {ucb.%{varpref}%.loop} is true:
  256.                             loop all players:
  257.                                 send "&e%{ucb.%{varpref}%.ucb.chatbot.name}% &8| &7%{ucb.%{varpref}%.ucb.%{ucb.why}%.%loop-value%.ans}%" to loop-player
  258.                                 stop
  259.                         else:
  260.                             send "&e%{ucb.%{varpref}%.ucb.chatbot.name}% &8| &7%{ucb.%{varpref}%.ucb.%{ucb.why}%.%loop-value%.ans}%"
  261.                             stop
  262.         send "{@prefix} &7%{noidea}%"
Add Comment
Please, Sign In to add comment