comparison tj.tcl @ 5:5ac4fd6d011a

tj: Handle command arguments better.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 22 Jun 2011 19:56:31 +0300
parents 1c4e2814cd41
children 15fc72bc3f3e
comparison
equal deleted inserted replaced
4:8c9049f2b2b0 5:5ac4fd6d011a
1 ############################################################################ 1 ############################################################################
2 # 2 #
3 # TJ (Army Mornings Left-counter) v0.60 by ccr/TNSP 3 # TJ (Army Mornings Left-counter) v0.60 by ccr/TNSP
4 # (C) Copyright 2000,2009 Tecnic Software productions (TNSP) 4 # (C) Copyright 2000,2009,2011 Tecnic Software productions (TNSP)
5 # Send comments and shit via e-mail: <ccr@tnsp.org> 5 # Send comments and shit via e-mail: <ccr@tnsp.org>
6 # 6 #
7 # This script is freely distributable under GNU GPL (version 2) license. 7 # This script is freely distributable under GNU GPL (version 2) license.
8 # 8 #
9 # Laskee aamuja tiettyyn paivamaaraan. TJ-paivamaara annettava 9 # Laskee aamuja tiettyyn paivamaaraan. TJ-paivamaara annettava
24 24
25 25
26 ############################################################################ 26 ############################################################################
27 # No need to look below this line 27 # No need to look below this line
28 ############################################################################ 28 ############################################################################
29 set tj_message "TJ (SA-INT model) v0.60 by ccr/TNSP" 29 set tj_message "TJ (SA-INT model) v0.65 by ccr/TNSP"
30 set tj_dateident "tjdate" 30 set tj_dateident "tjdate"
31 set tj_preferredmsg "PRIVMSG" 31 set tj_preferredmsg "PRIVMSG"
32 32
33 putlog "$tj_message" 33 putlog "$tj_message"
34 bind pub - !tj tj_pubmsg 34 bind pub - !tj tj_pubmsg
59 } 59 }
60 60
61 61
62 # ------------------------------------------------------------------------- 62 # -------------------------------------------------------------------------
63 proc tj_pubmsg {nick uhost hand chan args} { 63 proc tj_pubmsg {nick uhost hand chan args} {
64 if {$args == "{}" || $args == ""} { set args $hand } 64 set args [string trim [join $args ""]]
65 set args [lindex [split $args " "] 0] 65 if {$args == ""} { set args $hand }
66 66
67 tj_smsg $chan [tj_gettj $args $chan] 67 tj_smsg $chan [tj_gettj $args $chan]
68 return 1 68 return 1
69 } 69 }
70 70