source: tags/start/modules/events_support.tcl @ 1143

Revision 2, 5.1 KB checked in by jamesoff, 9 years ago (diff)

Initial revision

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1# bMotion - event supporting functions
2#
3# $Id$
4#
5
6###############################################################################
7# bMotion - an 'AI' TCL script for eggdrops
8# Copyright (C) James Michael Seward 2000-2002
9#
10# This program is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 2 of the License, or
13# (at your option) any later version.
14#
15# This program is distributed in the hope that it will be useful, but
16# WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18# General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with this program; if not, write to the Free Software
22# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23###############################################################################
24
25proc finishdildo {} {
26  global got mood dildoPlays
27
28  set style $got(dildo,style)
29
30  if {$style == "flute"} {
31    global dildoFluteFinishes
32    cum $got(dildo,channel) $got(dildo,nick)
33    bMotionDoAction $got(dildo,channel) $got(dildo,nick) [pickRandom $dildoFluteFinishes]
34    set got(dildo,nick) ""
35    set got(dildo,count) 0
36    incr mood(happy) 1
37    incr mood(horny) -2
38    return 0
39  }
40
41  if {$style == "f_swap"} {
42    global dildoFemaleFemaleSwap
43    bMotionDoAction $got(dildo,channel) $got(dildo,dildo) [pickRandom $dildoFemaleFemaleSwap]
44    set got(dildo,style) "normal"
45    utimer 70 finishdildo
46    return 0
47  }
48 
49  if {$style == "m_swap"} {
50    global dildoMaleMaleSwap
51    bMotionDoAction $got(dildo,channel) $got(dildo,dildo) [pickRandom $dildoMaleMaleSwap]
52    set got(dildo,style) "normal"
53    utimer 70 finishdildo
54    return 0
55  }
56
57  global dildoFinishes
58  cum $got(dildo,channel) $got(dildo,nick)
59  bMotionDoAction $got(dildo,channel) $got(dildo,dildo) [pickRandom $dildoFinishes] $got(dildo,nick)
60  set got(dildo,nick) ""
61  set got(dildo,count) 0
62  incr mood(happy) 1
63  incr mood(horny) -2
64}
65
66## BEGIN lol function (TODO: rename this and calls to it)
67proc lol {nick host handle channel text} {
68  #ignore the J flag users
69  if [matchattr $handle J] {
70    return 0
71  }
72
73  global botnick mood lols bMotionCache
74  if {$nick == $botnick} {return 0}
75
76  if {![bMotionIsFriend $nick]} { return 0 }
77
78  incr bMotionCache(LOLcount)
79  if {[string toupper $text] == $text} { incr bMotionCache(LOLcount) }
80  if {$bMotionCache(LOLcount) > 3} { 
81    if {$mood(happy) < -10} {
82      incr mood(happy)
83      return 0
84    }
85    if {[rand 10] > 6} {
86      set response [pickRandom $lols]     
87      bMotionDoAction $channel $nick $response
88      set bMotionCache(LOLcount) 0
89    }
90    checkmood "" ""
91  }
92}
93## END
94
95proc cum {channel nick} {
96  global bMotionInfo
97  global mood
98  if {![pastWatershedCheck $nick]} { return 0 } 
99  if {![bMotionIsFriend $nick]} { 
100    bMotionDoAction $channel $nick "%VAR{blehs} I can't cum thinking about someone I don't like"
101    return 0
102  }
103  if {$bMotionInfo(gender) == "male"} {
104    bMotionDoAction $channel $nick "/ejaculates over %%"
105    incr mood(horny) -3
106    incr mood(happy) 2
107    return 0
108  }
109  bMotionDoAction $channel $nick "/makes herself cum thinking about %%"
110  incr mood(horny) -3
111  incr mood(happy) 2
112  return 0
113}
114
115proc frightened {nick channel} {
116  global frightens unsmiles mood
117  bMotionDoAction $channel $nick "[pickRandom $frightens] [pickRandom $unsmiles]"
118  incr mood(lonely) -1
119  incr mood(happy) -1
120}
121
122proc bMotionMakeItSo {nick channel} {
123  global makeItSos
124  bMotionDoAction $channel $nick [pickRandom $makeItSos]
125  global bMotionCache
126  set bMotionCache(lastDoneFor) $nick
127}
128
129proc checkPokemon {which channel} {
130  global bMotionInfo
131  if {$bMotionInfo(pokemon) != [string tolower $which]} {
132    bMotionDoAction $channel $which "/morphs into %%!"
133    set bMotionInfo(pokemon) [string tolower $which]
134  }
135}
136
137proc bMotionYesNo {channel} {
138  global yeses nos
139  set yesnos [concat $yeses $nos]
140  bMotionDoAction $channel "" [pickRandom $yesnos]
141  return 0
142}
143
144proc bMotionBlessYou {channel nick} {
145  global bMotionInfo
146  global blessyous
147  if {![bMotionIsFriend $nick]} { return 0 }
148  if {[rand 2] && ($bMotionInfo(balefire) == 1)} {
149    bMotionDoAction $channel $nick [pickRandom $blessyous]
150    bMotionGetUnLonely
151  }
152}
153
154proc bMotionRandomTime {channel nick} {
155        set hour [expr [rand 11] + 1]
156        set min [rand 59]
157        if [rand 2] {
158          set ampm "am"
159        } else {
160          set ampm "pm"
161          }
162
163        if {$min < 30} {
164          set timestr "$min past $hour"
165          }
166
167        if {$min == 30} {
168          set timestr "half-past $hour"
169          }
170
171        if {$min > 30} {
172          set min [expr 60 - $min]
173          set timestr "$min to $hour"
174          }
175
176  if {$min == 0} {
177    set timestr "$hour"
178  }
179
180        bMotionDoAction $channel $nick "%%: about $timestr $ampm"
181        return 0
182}
183
184proc bMotionRandomQuestion {channel} {
185  global sillyThings
186
187  set silly1 [pickRandom $sillyThings]
188  set silly2 [pickRandom $sillyThings]
189
190  bMotionDoAction $channel "" "$silly1 or $silly2?"
191  return 0
192}
193
194proc bMotionEndTeamRocket {} {
195  global bMotionCache
196  set bMotionCache(teamRocket) ""
197}   
198
199bMotion_putloglev d * "bMotion: event support module loaded"
Note: See TracBrowser for help on using the repository browser.