| View previous topic :: View next topic |
| Author |
Message |
mrdr Halfop

Joined: 16 Jun 2005 Posts: 42 Location: Lithuania / Vilnius / Underground
|
Posted: Mon Dec 05, 2005 2:44 pm Post subject: need help in this script |
|
|
| Code: | set birthday(file) "birth.txt"
if {[file exists $birthday(file)]} {
set birthday(data) [split [read [set inf [open $birthday(file) r]]] \n][close $inf]
unset inf
} else {
set birthday(data) [list]
}
bind pub - !birth pub:birthdays
proc pub:birthdays {nick uhost hand chan text} {
global birthday
set day [lindex [split $text] 0]
set line [list]
foreach i [lsearch -regexp $birthday(data) "$day *"] {
lappend line [join [lrange [split [lindex $birthday(data) $i]] 1 end]]
}
set line [join $line]
putserv "PRIVMSG $chan :$day $line"
} |
I got this script, I think you know what it does.
How to make that when I enter !birth bot notice how to use it.
ex.
(@me) !birth
Notice -- (bot) -- Usage: !birth month.day
 _________________ IRC: #egghelp @ Aitvaras.NET
IRC: #NASA @ Aitvaras.NET |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Dec 05, 2005 6:34 pm Post subject: |
|
|
After
| Code: | | set day [lindex [split $text] 0] |
add
| Code: | if {$day == ""} {
puthelp "NOTICE $nick :Usage: !birth month.day"
return 0
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
mrdr Halfop

Joined: 16 Jun 2005 Posts: 42 Location: Lithuania / Vilnius / Underground
|
Posted: Tue Dec 06, 2005 2:05 am Post subject: |
|
|
Thank you, Sir_Fz.  _________________ IRC: #egghelp @ Aitvaras.NET
IRC: #NASA @ Aitvaras.NET |
|
| Back to top |
|
 |
|