egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

need help in this script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
mrdr
Halfop


Joined: 16 Jun 2005
Posts: 42
Location: Lithuania / Vilnius / Underground

PostPosted: Mon Dec 05, 2005 2:44 pm    Post subject: need help in this script Reply with quote

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

Smile
_________________
IRC: #egghelp @ Aitvaras.NET
IRC: #NASA @ Aitvaras.NET
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Dec 05, 2005 6:34 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
mrdr
Halfop


Joined: 16 Jun 2005
Posts: 42
Location: Lithuania / Vilnius / Underground

PostPosted: Tue Dec 06, 2005 2:05 am    Post subject: Reply with quote

Thank you, Sir_Fz. Smile
_________________
IRC: #egghelp @ Aitvaras.NET
IRC: #NASA @ Aitvaras.NET
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber