Guest User

Untitled

a guest
Sep 25th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.30 KB | None | 0 0
  1. def respond(msg)
  2. # msg :name, :hostname, :mode, :origin, :privmsg, :text
  3. if msg.name == "JDigital" && msg.text == "Bones, quit"
  4. quit(msg.text)
  5. end
  6.  
  7. if msg.text =~ /^bones(:|,*) (\S+)( (.*))?/i
  8. prefix = "bones"
  9. command = $2
  10. args = $4
  11. # do command - switch statement or use a command handler class
  12. c = command_handler(prefix, command, args)
  13. reply(msg, c) if c
  14. elsif msg.text =~ /^!summon (#.*)/
  15. reply(msg, "I am summoned!")
  16. join $1.to_s
  17. elsif msg.text =~ /^!dismiss (#.*)/
  18. reply(msg, "I obey!")
  19. leave $1.to_s
  20. elsif msg.text == "hay"
  21. reply(msg, "hay :v")
  22. elsif msg.text == "!index"
  23. reply(msg, "the index of rules lists: !rules1 for standard knucklebones rules.")
  24. elsif msg.text == "!rules1"
  25. reply(msg, "Though there are hundreds of variations of this game, the simplest rules are presented here, as this is how it is most often played in the temples of Fortuna: A group of players toss the talii. The highest numerical value wins the pot except in the case a non-numerical value is thrown. These are, of course, the Vultures, the Senio, and the Lady. The Dogs represent the lowest possible throw and the failing thrower must place four times the initial bet into the pot when throwing them. The other Vultures, however, beat all numerical values save for the Lady. Those who throw them divide the pot amongst themselves unless the Lady is rolled. The Lady is a special roll, requiring all betters to double the amount of money in the pot. The pot is then split between all players who have thrown The Lady that round. He who throws the Senio is considered ÒSeigneurÓ for the round, meaning that he is the patron of the game. All players who throw a Senio must add a coin (or an increment of bet) to the pot. However, the Senio (from highest, 6,4,4,4) beats the Vultures and other numerical values.")
  26. elsif msg.text == "!Starwars"
  27. @connection.speak "NICK DiceVader"
  28. sleep 1
  29. reply(msg, "what is thy bidding my master?")
  30. elsif msg.text == "!FATAL"
  31. @connection.speak "NICK Dicebitch"
  32. sleep 1
  33. elsif msg.text == "!Poland"
  34. @connection.speak "NICK Winged_Hussar_Maiden"
  35. sleep 1
  36. reply(msg, "Men of the North, we ride forward!")
  37. elsif msg.text == "!CoC"
  38. @connection.speak "NICK Dice-Niggarauth"
  39. sleep 1
  40. reply(msg, "that is not dead which can aeternal lie.")
  41. elsif msg.text == "!DH"
  42. @connection.speak "NICK Sister-of-Dice"
  43. sleep 1
  44. reply(msg, "the Emperor asks only that you hate.")
  45. elsif msg.text == "!AD&D"
  46. @connection.speak "NICK DiceMaiden"
  47. sleep 1
  48. reply(msg, "you'll grow up to be a bard!")
  49. elsif msg.text == "!Shadowrun"
  50. @connection.speak "NICK Johnson"
  51. sleep 1
  52. reply(msg, "Dunklezahn has left you fifteen nuyen in his will.")
  53. elsif msg.text == "!L5R"
  54. @connection.speak "NICK DiceGeisha"
  55. sleep 1
  56. reply(msg, "hone your steel.")
  57. elsif msg.text == "!7thSea"
  58. @connection.speak "NICK DiceCourtesan"
  59. sleep 1
  60. reply(msg, "en gaurde!")
  61. elsif msg.text == "!Conan"
  62. @connection.speak "NICK DiceCrom"
  63. sleep 1
  64. reply(msg, "tread the jeweled thrones of earth under your sandalled feet.")
  65. elsif msg.text == "!Paranoia"
  66. @connection.speak "NICK Dice-U-MAID"
  67. sleep 1
  68. reply(msg, "Friend Computer has good news for you.")
  69. elsif msg.text == "!GURPS"
  70. @connection.speak "NICK BlandMaiden"
  71. sleep 1
  72. reply(msg, "why would you want to play this game?")
  73. elsif msg.text == "!Deadlands"
  74. @connection.speak "NICK Dealer"
  75. sleep 1
  76. elsif msg.text == "!WoD"
  77. @connection.speak "NICK DiceCreep"
  78. sleep 1
  79. reply(msg, "get your Crinos going. Or whatever.")
  80. elsif msg.text == "!info"
  81. reply(msg, "I was birthed from the necromancer Ilmuri, and constantly recieve his improvements. I praise him, for it is right to praise one's Maker!")
  82. elsif msg.text == "grease"
  83. reply(msg, "exploding dude's heads and stuff is way cooler than casting stinking cloud and grease and making some dudes fly down a hill into fart valley.")
  84. elsif msg.text == "Well thief! I smell you and I feel your air."
  85. @connection.speak "NICK Bilbo"
  86. sleep 1
  87. reply(msg, "I did not come for presents. I only wished to have a look at you and see if you were truly as great as tales say. I did not believe them.")
  88. sleep 1
  89. @connection.speak "NICK DiceMaiden"
  90. elsif msg.text == "Surely, O Smaug the unassesably wealthy, you must realise that your success has made you some bitter enemies?"
  91. @connection.speak "NICK Smaug"
  92. sleep 1
  93. reply(msg, "revenge! The King under the Mountain is dead and where are his kin that dare seek revenge? Girion Lord of Dale is dead, and I have eaten his people like a wolf among sheep, and where are his sons' sons that dare approach me? I kill where I wish and none dare resist. I laid low the warriors of old and their like is not in the world today. Then I was but young and tender. Now I am old and strong, strong, strong, Thief in the Shadows! My armour is like tenfold shields, my teeth are swords, my claws spears, the shock of my tail a thunderbolt, my wings a hurricane, and my breath *DEATH*")
  94. sleep 1
  95. @connection.speak "NICK DiceMaiden"
  96. elsif msg.text == "No living man may hinder me!"
  97. @connection.speak "NICK Eowyn"
  98. sleep 1
  99. reply(msg,"no living man am I! You look upon a woman. Eowyn I am, Eomund's daughter. You stand between me and my lord and kin. Begone, if you be not deathless! For living or dark undead, I will smite you, if you touch him.")
  100. sleep 1
  101. @connection.speak "NICK DiceMaiden"
  102. elsif msg.text =~ /^(!|@)(\S+)( (.*))?/
  103. prefix = $1
  104. command = $2
  105. args = $4
  106. #do command
  107. c = command_handler(prefix, command, args)
  108. reply(msg, c) if c
  109. elsif msg.text =~ /^(\d*#)?(\d+)d(\d+)/
  110. # DICE HANDLER
  111. dice = Dicebox::Dice.new(msg.text)
  112. begin
  113. d = dice.roll
  114. if (d.length < 350)
  115. reply(msg, d)
  116. else
  117. reply(msg, "I don't have enough dice to roll that!")
  118. end
  119. rescue Exception => e
  120. puts "ERROR: " + e.to_s
  121. reply(msg, "I don't understand...")
  122.  
  123. if msg.text =~/^s(\d+)/
  124. c = command_handler("s", "run", $1, msg.origin)
  125. reply(msg, c) if c
  126. end
  127. end
  128. end
  129. end
Add Comment
Please, Sign In to add comment