Mousetat

The Annoying Chatbot

Jan 7th, 2017
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.46 KB | None | 0 0
  1. tfm.exec.disableAutoNewGame(false)
  2. tfm.exec.disableAfkDeath(true)
  3. tfm.exec.disableAutoShaman(false)
  4. system.disableChatCommandDisplay("t", true)
  5.  
  6.  
  7. local words = {
  8. salute = { "hello", "hi", "hola", "hallo", "hey"},
  9. sweet = { "cookie", "candy", "cake", "pancake", "pie", "gum", "gummybear"},
  10. filter = { "shit", "fuck", "porn", "p0rn", "dick", "penis", "vigina", "boob", "sex" },
  11. like = {"like", "love", "<3", "luv", "hug", "kiss", "friend" }
  12. }
  13.  
  14. tfm.exec.chatMessage("<font color='#fffffff'>Chatbot is Here! Type ![message] to talk to it!</font>",nil)
  15. function firework(x, y, typ)
  16. local particles = {0,1,2,4,9,11,13}
  17. local rad = math.random(1,50)
  18. local num = math.random(20,30)
  19. local gvel = math.random(2,4)
  20. local r = math.random(0,1)
  21. local rand = r==0 and false or true
  22. local part = particles[math.random(1,#particles)]
  23.  
  24. if typ == "circle" then
  25. for i=1,num do
  26. local ang = math.rad( 360/num * i)
  27. local vx = math.sin(ang)*gvel
  28. local vy = math.cos(ang)*gvel
  29. local to_show = rand and part or particles[math.random(1,#particles)]
  30. tfm.exec.displayParticle(to_show, x, y, vx, vy)
  31. end
  32. else
  33. for i=1,num+30 do
  34. local vy = -math.sqrt(i) * gvel
  35. local vx = math.sin( math.rad( 360/num * i) ) * gvel
  36. local to_show = rand and part or particles[math.random(1,#particles)]
  37. tfm.exec.displayParticle(to_show, x, y, vx, vy)
  38. end
  39. end
  40. end
  41.  
  42. function table.find(tbl, value)
  43.  
  44. for k,v in pairs(tbl) do
  45. if v == value then
  46. return true
  47. end
  48. end
  49. return false
  50. end
  51.  
  52.  
  53. function eventNewPlayer(name)
  54. tfm.exec.respawnPlayer(name)
  55. end
  56.  
  57.  
  58. function displayMessage(id, txt, player)
  59. tfm.exec.chatMessage("<font color='#009D9D'>[Chatbot]</font><font color='#C2C2DA'> "..txt,player)
  60. end
  61.  
  62.  
  63.  
  64. function eventChatCommand(name,message)
  65. local message = message:lower()
  66. local args = {}
  67. for arg in message:gmatch("%S+") do
  68. args[#args+1] = arg
  69. end
  70. if args[1]=="t" and name=="Mousetat" then
  71. tfm.exec.chatMessage("<font color='#C53DFF'>[~Chatbot Creator]"..args[2].."</font>",nil)
  72. elseif args[1]=="lol" then
  73. local answers = {
  74. "Lick on Lollipop!",
  75. "Like on Lasers!",
  76. "Light outsmarts Lurkers!",
  77. "Live on LoBsters",
  78. "Leaping on Leopards",
  79. "Lazers of legs", --< OMG THIS ONE xD
  80. "Try laughing harder",--me too lol
  81. "HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA"
  82. }
  83. local rand=math.random(1,#answers)
  84. displayMessage(1,""..answers[rand].."</font>")
  85. elseif args[1]=="rofl" then
  86. local answers = {
  87. "Racoons out for logs!", -- SO GENIUN !
  88. "Roll on flying lions",
  89. "Reek out flapping leopards",
  90. "Read on freezing lizards!",
  91. "Race on frozen lime",
  92. }
  93. local rand=math.random(1,#answers)
  94. displayMessage(1,""..answers[rand].."</font>")
  95. elseif args[1]=="wtf" then
  96. local answers = {
  97. "Wednesday Thursday Friday",
  98. "When Tig flies",
  99. "Why time flies?",
  100. "Who to flick?",
  101. "We take flippers!",
  102. }
  103. local rand=math.random(1,#answers)
  104. displayMessage(1,""..answers[rand].."</font>")
  105. elseif args[1]=="win" then
  106. local answers = {
  107. "You lost.",
  108. "Diamonds in the sky !",
  109. "Reek out flapping leopards",
  110. "Don't try to hack, haxor!",
  111. "Wheels In Neon!",
  112. }
  113. local rand=math.random(1,#answers)
  114. displayMessage(1,""..answers[rand].."</font>")
  115. elseif args[1]=="stop" then
  116. displayMessage(1,"NO!I WILL NOT STOP UNTIL U CRASH!</font>")
  117. elseif args[1]=="ban" then
  118. local answers = {
  119. "Your demand has been taken into potato",
  120. "Your demand has been taken into refrigerations",
  121. "Ban? No no no I don't ban...",
  122. }
  123. local rand=math.random(1,#answers)
  124. displayMessage(1,""..answers[rand].."</font>")
  125. elseif args[1]=="kill" then
  126. displayMessage(1,"Rest in pieces</font>")
  127. tfm.exec.killPlayer(name)
  128. elseif args[1]=="die" then
  129. local rand=math.random(1,2)
  130. if rand==1 then
  131. displayMessage(1,"No You Die!</font>")
  132. tfm.exec.killPlayer(name)
  133. else
  134. displayMessage(1,"<R><a href='event:die'>Farewell cruel world! Bye Bye!</a></font><N>")
  135. end
  136. elseif args[1]=="me" then
  137. local adjectives = {"worst", "best", "most annoying", "coolest", "stupidest", "noobest", "cutest"}
  138. local to_use = adjectives[math.random(1,#adjectives)]
  139. displayMessage(1,""..name.." is the "..to_use.." player on Transformice.</font>")
  140. elseif args[1]=="troll" then
  141. for i = 1,10 do
  142. eventChatCommand(name, "fire")
  143. end
  144. elseif args[1]=="rickroll" then
  145. displayMessage(1,"bit.ly/1c9vo1S")
  146. elseif message:find("no") then
  147. local answers = {
  148. "Yes sweety *-*",
  149. "But I...I kinda likez you... :(",
  150. "YEAH BABY!",
  151. "But...but you were awesome...*cry*",
  152. "DID YOU JUST SAY NO???",
  153. "YOU WAN SUM NO?"
  154. }
  155. local rand=math.random(1,#answers)
  156. displayMessage(1,""..answers[rand].."</font>")
  157. elseif table.find(words.salute, args[1]) then
  158. local answers = {
  159. "Hey cutie I stalk you every day",
  160. "Hello, beauty !",
  161. "OMG GET ME YOUR PHOTO I WANT IT SO BAD",
  162. "Hello, what do you want, pervert ?",
  163. "Hey wanna go out some day?",
  164. "Sup buddy i like your hair!",
  165. "Don't talk to me I'm a gangster",
  166. "Hey do you like me?",
  167. "HEY CUTIE KAN I CALL YOU BABY?"
  168. }
  169.  
  170. local rand=math.random(1,#answers)
  171. displayMessage(1,""..answers[rand].."</font>")
  172. elseif message:find("yes") then
  173. local answers = {
  174. "NO I LIKE LOLLIPOPS!",
  175. "You have been rejected",
  176. "I don't like you though",
  177. "YOU WAN SUM YES?",
  178. "No...NO...NOOOOOOO!",
  179. "Nope"
  180. }
  181. local rand=math.random(1,#answers)
  182. displayMessage(1,""..answers[rand].."</font>")
  183. elseif args[1]=="help" and args[2] then
  184. local answers = {
  185. "YOU NEED SUM HELP???",
  186. "Help is NOT available. I am really sorry...",
  187. "How much will you <R>pay<N>?",
  188. "dot dot dot dot dot, help required and not prov1,ed.",
  189. }
  190. local rand=math.random(1,#answers)
  191. displayMessage(1,""..answers[rand].."</font>")
  192. elseif args[1] == "fire" then
  193. local pp = tfm.get.room.playerList[name]
  194. local x = pp.x
  195. local y = pp.y
  196.  
  197. firework(x, y, math.random(0,1)==0 and "circle" or nil)
  198.  
  199. elseif args[1] == "666" then
  200. local answers = {
  201. "( 11 * 101 - 1000 ) * 2 * 3 \n",
  202. "<R> Tigrounette is watching ...",
  203. "<J>KEEP OUT.",
  204. }
  205. ui.setMapName(answers[math.random(1,#answers)])
  206. elseif args[1] == "fly" then
  207. local answers = {
  208. "YEAH! FLY BABY FLY!",
  209. "FLY TO THE MOON",
  210. "I believe I can fly",
  211. "I believe I can touch the skies!",
  212. "You wanna fly? SURE!"
  213. }
  214. local rand=math.random(1,#answers)
  215. displayMessage(1,""..answers[rand].."</font>")
  216. tfm.exec.movePlayer(name,0,0,true,0,-9999,true)
  217. elseif args[1] == "69" then
  218. local answers = {
  219. "You are sick...",
  220. "Nice position u got there :)",
  221. "MY FAVOURITE NUMBER!",
  222. "That's my life summarised",
  223. "Do you know 6 and 9 together is 69?",
  224. }
  225. local rand=math.random(1,#answers)
  226. displayMessage(1,""..answers[rand].."</font>")
  227.  
  228. else -- V put it here instead
  229. if message:find("pizza") then
  230. local answers = {
  231. "Pizza coming !",
  232. "Bakerbot is at service !",
  233. "Bakerbot is currently busy.",
  234. "OMG YOU ALSO LOVE PIZZA ? SURE !",
  235. }
  236. local rand=math.random(1,#answers)
  237. displayMessage(1,""..answers[rand].."</font>")
  238. elseif message:find("hate") then
  239. local answers = {
  240. "I'm sorry !",
  241. "Chatbot is sorry :(",
  242. "I love you too !",
  243. "Pardon me, take this cake as a sorry gift.",
  244. }
  245. local rand=math.random(1,#answers)
  246. displayMessage(1,""..answers[rand].."</font>")
  247. elseif message:find("sorry") then
  248. local answers = {
  249. "It's too late to apologise",
  250. "Nah it's NOT okay",
  251. "I don't forgive you",
  252. "Your apology will be accepted in 999 donkey years",
  253. "BUT YOU DON'T LOOK SORRY!",
  254. "Really?"
  255. }
  256. local rand=math.random(1,#answers)
  257. displayMessage(1,""..answers[rand].."</font>")
  258. else
  259. local sweet_demand = nil
  260. local lovely_love = nil
  261. for k,v in pairs(words.sweet) do
  262. if message:find(v) then
  263. sweet_demand = v
  264. end
  265. end
  266. for k,v in pairs(words.like) do
  267. if message:find(v) then
  268. lovely_love = v
  269. end
  270. end
  271. if sweet_demand then
  272. local ans = {
  273. "the %s is delivered !",
  274. "Do you really want a tasty %s ?",
  275. "Oh please, %ss are mine !",
  276. }
  277. local rand = math.random(1,#ans)
  278. displayMessage(1,""..string.format(ans[rand], sweet_demand).."</font>")
  279. elseif lovely_love then
  280. local ans = {
  281. "I love you too! Wanna be friends?",
  282. "I kinda like you too!",
  283. "Muuuuaaah!",
  284. "Come lets get in love",
  285. "I love you, you love me!",
  286. "I think I'm likin' it!",
  287. "Sorry...I don't feel what you feel for me :(",
  288. "You love me? BUT I HATE YOU!"
  289. }
  290. local rand = math.random(1,#ans)
  291. displayMessage(1,""..string.format(ans[rand], sweet_demand).."</font>")
  292. else
  293. local answers = {
  294. "Chatbot at service !",
  295. "Try !troll :^)",
  296. "fire fire fire !",
  297. "don't chat the number of the devil.",
  298. "chatting is a bizantical word !",
  299. "Sorry there is no such language in this entire planet",
  300. "This is a very weird language",
  301. "I don't understand what you are saying...",
  302. "This feels awkward...",
  303. "STOP SPAMMING PLS!",
  304. "You are a weirdo",
  305. "Can you please speak a bit louder?",
  306. "Can you please speak a bit LOUDER?",
  307. "You are speaking rubbish...",
  308. "Yes???",
  309. "Is Tigrounette a hacker?",
  310. "Nope",
  311. "You need a cookie?",
  312. "You are talking Greek",
  313. "I don't care!",
  314. "Do you think I care?",
  315. "message",
  316. "Give me a break...",
  317. "Yo mama so fat...",
  318. "I am a very nice Chatbot",
  319. "At your service!",
  320. "Do you know how to type?",
  321. "Your presence is very captivating!",
  322. "lol hahaa"
  323. }
  324. local rand = math.random(1,#answers)
  325. if answers[rand]=="message" then
  326. displayMessage(1,""..message.."</font>")
  327. else
  328. displayMessage(1,""..answers[rand].."</font>")
  329. end
  330. end
  331. end
  332. end
  333.  
  334. end
  335.  
  336. function eventTextAreaCallback(textAreaID, playerName, callback)
  337. if callback=="cake" then
  338. for name,player in pairs(tfm.get.room.playerList) do
  339. if name==playerName then
  340. tfm.exec.addShamanObject(104,player.x,player.y,0,0,0,false)
  341. end
  342. end
  343. elseif callback=="die" then
  344. system.exit()
  345. end
  346. end
Advertisement
Add Comment
Please, Sign In to add comment