Advertisement
SmokinGrunts

Story Module

Oct 10th, 2018
1,153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 6.75 KB | None | 0 0
  1. #
  2. #
  3. # vim: fdm=indent fdn=1
  4.  
  5. ###############################################################################
  6. # This is a bMotion plugin
  7. # Copyright (C) James Michael Seward 2000-2008
  8. # This Plugin By: Aztec03 (10/10/2018)
  9. #
  10. # This program is covered by the GPL, please refer the to LICENCE file in the
  11. # distribution; further information can be found in the headers of the scripts
  12. # in the modules directory.
  13. ###############################################################################
  14.  
  15. bMotion_plugin_add_complex "story" "^%botnicks,?:?!? tell (me|us|everyone|.+) a (story|tale|legend)" 100 bMotion_plugin_complex_story "en"
  16.  
  17. proc bMotion_plugin_complex_story { nick host handle channel text } {
  18.   global botnicks bMotionInfo
  19.  
  20.   if {![bMotion_interbot_me_next $channel]} {
  21.     return 0
  22.   }
  23.  
  24.   if [regexp -nocase "^${botnicks},?:?!? tell (me|us|everyone|.+) a (story|tale|legend)" $text matches botnick who what] {
  25.     # Following is debugging only
  26.     #putlog "text = $text"
  27.     #putlog "matches = $matches"
  28.     #putlog "botnick = $botnick"
  29.     #putlog "who = $who"
  30.     #putlog "what = $what"
  31.     bMotionTellStory $channel $who $nick
  32.     return 1
  33.   }
  34. }
  35.  
  36. proc bMotionTellStory {channel targetNick forNick} {
  37.   global botnick
  38.   set target ''
  39.  
  40.   # Check if 'me' was the targetNick to tell a story to
  41.   if [string match -nocase "me" $targetNick] {
  42.     set targetNick $forNick
  43.     set target "self"
  44.   }
  45.  
  46.   # Check if 'us' or 'everyone' was the targetNick to tell a story to
  47.   if [regexp -nocase "(us|everyone)" $targetNick] {
  48.     set targetNick $channel
  49.     set intro "%VAR{story_intros_toChannel}"
  50.     set target "channel"
  51.     } else {
  52.     # Check if user is in channel
  53.     set host [getchanhost $targetNick]
  54.     if {$host == ""} {
  55.       bMotionDoAction $channel $forNick "Sorry %%, but $targetNick isn't here"
  56.       return 0
  57.     }
  58.     # Not telling to channel, so tell to nick
  59.     set intro "%VAR{story_intros_toNick}"
  60.     if {$target!="self"} { set target "nick" }
  61.   }
  62.  
  63.   putlog "Was asked to tell a story to '$targetNick' in $channel by $forNick"
  64.  
  65.   set exposition "%VAR{story_exposition}"
  66.   set risingAction "%VAR{story_risingAction}"
  67.   set climax "%VAR{story_climax}"
  68.   set fallingAction "%VAR{story_fallingAction}"
  69.   set resolution "%VAR{story_resolution}"
  70.  
  71.   # Tell the story, using the intro
  72.   bMotionDoAction $channel $targetNick "$intro" $forNick
  73.  
  74.   if {$target=="self"} {
  75.     putlog "story target is $target"
  76.     # Telling a story to self, so make them the star!
  77.     set subject $forNick
  78.     bMotionDoAction $channel $subject "$exposition" $forNick
  79.   }
  80.  
  81.   if {$target=="channel" || $target=="nick"} {
  82.     putlog "story target is $target"
  83.     # Telling a story to channel, so make random user the subject
  84.     set subject "%ruser"
  85.     set prevUser "%ruser{prev}"
  86.     bMotionDoAction $channel $subject "$exposition" $prevUser
  87.   }
  88.  
  89.   return 0
  90. }
  91.  
  92. # %% = targetNick or targetChannel
  93. # %2 = askingNick
  94. bMotion_abstract_register "story_intros_toNick" {
  95.   "Alright %%, the story goes like this..."
  96.   "okay %%, you're in for a treat..."
  97.   "Gather 'round, %%, it goes like this..."
  98.   "If you're sure, %%, then gather around..."
  99.   "Listen carefully, %%..."
  100. }
  101.  
  102. bMotion_abstract_register "story_intros_toChannel" {
  103.   "well %%, %2 would like me to tell you a story, so it goes like this..."
  104.   "if everyone in %% would please listen up..."
  105.   "Okay, this one goes out to everyone in %%, gather 'round..."
  106.   "All those in %% interested in my tale, please gather around..."
  107. }
  108.  
  109. # %| = newline
  110. # %VAR{ABSTRACT_NAME} = pulls in another abstract
  111. # %% = subject or targetNick
  112. # %2 = askingNick
  113. # %ruser = random user in channel
  114.  
  115. bMotion_abstract_register "story_exposition_intro" {
  116.   "Once upon a time"
  117.   "Long, long ago"
  118.   "Eons ago"
  119.   "Many years past"
  120.   "In an ancient age"
  121.   "Some time ago"
  122. }
  123.  
  124. bMotion_abstract_register "story_exposition_subject_bad" {
  125.   "was a terrible curse set upon the land by"
  126.   "was an awful blight thrust across the farmlands by"
  127.   "was a nasty disease spread through the towns by"
  128.   "was disorder and chaos spread about by"
  129. }
  130.  
  131. bMotion_abstract_register "story_exposition_subject_good" {
  132.   "was peace and prosperity given to the land by"
  133.   "were great crops to harvest all across the farmlands due to"
  134.   "was immense prosperity and luck to all in the land, thanks to"
  135.   "was unmatched happiness for everyone in the kingdom, because of"
  136. }
  137.  
  138. bMotion_abstract_register "story_exposition_protagonist" {
  139.   "great wizard"
  140.   "famous paladin"
  141.   "ancient master"
  142.   "good king"
  143. }
  144.  
  145. bMotion_abstract_register "story_exposition_antagonist" {
  146.   "awful wizard"
  147.   "terrible sorcerer"
  148.   "ugly witch"
  149.   "sneaky guy"
  150.   "undead wight"
  151. }
  152.  
  153. bMotion_abstract_register "story_exposition" {
  154.   "%VAR{story_exposition_intro}, there %VAR{story_exposition_subject_bad} the %VAR{story_exposition_antagonist} '%%'.%|%VAR{story_risingaction_bad}%|%VAR{story_climax_bad}"
  155.   "%VAR{story_exposition_intro}, there %VAR{story_exposition_subject_good} the %VAR{story_exposition_protagonist} '%%'.%|%VAR{story_risingaction_good}%|%VAR{story_climax_good}"
  156. }
  157.  
  158. bMotion_abstract_register "story_risingaction_bad" {
  159.   "%2 craved absolute power, and was determined to do anything to get it. They put a price out on the heads of any heroes who might stand in their way."
  160.   "%2 was madly corrupted by his desires of the flesh, and made slaves of every virgin in the land - ordered to be part of his personal harem."
  161.   "None would stand in %2's way, for many had tried - but all were dead."
  162.   "It seemed for a time that %2 would have absolute, terrible power over the land, for none dared to challenge %2's authority."
  163. }
  164.  
  165. bMotion_abstract_register "story_risingaction_good" {
  166.   "%2 was then beset by a sudden illness! Woe unto the land! %2's greatest heroes were called to action to find a cure!"
  167.   "%2 had a terrible accident at the yearly festival honoring their greatness! A sorcerer's trick went terribly awry and paralyzed poor %2..."
  168.   "The faithful partner to %2 was afflicted by a terrible curse! They could no longer make love - a terrible thing, indeed..."
  169. }
  170.  
  171. bMotion_abstract_register "story_climax_bad" {
  172.   "There was one, though, who could take no more of %2's atrocious ways. %ruser prepared their gear, and went out on horseback, intent on ending %2's reign of terror."
  173. }
  174.  
  175. bMotion_abstract_register "story_climax_good" {
  176.   "Many good denizens of %2's land were sought out, and equally many attempts were made to solve The Great %2's problem. Just as all hope seemed lost, a new hero appeared! It was %ruser!!!"
  177. }
  178.  
  179. bMotion_abstract_register "story_fallingAction_bad" {
  180.  
  181. }
  182.  
  183. bMotion_abstract_register "story_fallingAction_good" {
  184.  
  185. }
  186.  
  187. bMotion_abstract_register "story_resolution_bad" {
  188.  
  189. }
  190.  
  191. bMotion_abstract_register "story_resolution_good" {
  192.  
  193. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement