Changeset 890

Show
Ignore:
Timestamp:
02/17/08 14:00:21 (11 months ago)
Author:
james
Message:

tidy up

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/interbot.tcl

    r885 r890  
    8585 
    8686proc bMotion_interbot_catch { bot cmd args } { 
    87   global bMotionInfo 
    88   bMotion_putloglev 3 * "interbot: incoming !$args!" 
    89   set args [lindex $args 0] 
    90   regexp {([^ ]+) (.+)} $args matches function params 
    91  
    92   bMotion_putloglev 2 * "interbot: got command $function ($params) from $bot" 
    93  
    94   switch -exact $function { 
    95     "say" { 
    96       # bmotion say <channel> <text> 
    97       bMotionCatchSayChan $bot $params 
    98     } 
    99  
    100     "elect_initial" { 
    101       bMotion_interbot_next_incoming $bot $params 
    102     } 
    103  
    104     "elect_reply" { 
    105       bMotion_interbot_next_incoming_reply $bot $params 
    106     } 
    107  
    108     "fake_event" { 
    109       bMotion_interbot_fake_catch $bot $params 
    110     } 
    111  
    112     "HAY" { 
    113       bMotion_interbot_hay $bot $params 
    114     } 
    115  
    116     "SUP" { 
    117       bMotion_interbot_sup $bot $params 
    118     } 
    119   } 
    120  
    121   return 0 
     87        global bMotionInfo 
     88        bMotion_putloglev 3 * "interbot: incoming !$args!" 
     89        set args [lindex $args 0] 
     90        if [regexp {([^ ]+) (.+)} $args matches function params] { 
     91 
     92                bMotion_putloglev 2 * "interbot: got command $function ($params) from $bot" 
     93 
     94                switch -exact $function { 
     95                        "say" { 
     96                                # bmotion say <channel> <text> 
     97                                bMotionCatchSayChan $bot $params 
     98                        } 
     99 
     100                        "elect_initial" { 
     101                                bMotion_interbot_next_incoming $bot $params 
     102                        } 
     103 
     104                        "elect_reply" { 
     105                                bMotion_interbot_next_incoming_reply $bot $params 
     106                        } 
     107 
     108                        "fake_event" { 
     109                                bMotion_interbot_fake_catch $bot $params 
     110                        } 
     111 
     112                        "HAY" { 
     113                                bMotion_interbot_hay $bot $params 
     114                        } 
     115 
     116                        "SUP" { 
     117                                bMotion_interbot_sup $bot $params 
     118                        } 
     119                } 
     120        } else { 
     121                putlog "bMotion: ERROR: received unparsable interbot command from $bot: $cmd $args" 
     122        } 
     123 
     124        return 0 
    122125} 
    123126 
  • trunk/plugins/admin_friendship.tcl

    r862 r890  
    2828        } 
    2929 
    30   if [regexp -nocase {set ([^ ]+) ([0-9]+)} $arg matches nick val] { 
    31      setFriendshipHandle $nick $val 
    32      bMotion_putadmin "Friendship rating for $nick is now [getFriendshipHandle $nick]%" 
     30        if [regexp -nocase {set ([^ ]+) ([0-9]+)} $arg matches nick val] { 
     31                setFriendshipHandle $nick $val 
     32                bMotion_putadmin "Friendship rating for $nick is now [getFriendshipHandle $nick]%" 
    3333                return 0 
    34   } 
    35    
    36   bMotion_putadmin "usage: friendship \[show|set\]" 
     34        } 
     35 
     36        bMotion_putadmin "usage: friendship \[show|set\]" 
    3737} 
    3838