Hi, i am trying to make a trigger script for my clan channel. It will get info about a username that is placed after the !whatis command. But so far, its just fubarred up my Eggdrop, can anyone help? Here is the code...
bind pub - !whatis pub:definition
proc pub:definition {n u h c t} {
if {[string match -nocase "" $text]} { putserv "PRIVMSG $chan :Please specify a member you want info about" } { return 0 }
if {[string match -nocase "scorchin" $text]} { putserv "PRIVMSG $chan :Scorchin is a nublet...." } { return 0 }
}
bind pub - !whatis pub:definition
proc pub:definition {n u h c t} {
set honk [split $t]
if {[llength $honk] == 0} {
putserv "PRIVMSG $chan :Please specify a member you want info about"
return 0
}
set honk [lindex $honk 0]
if {[string match -nocase "scorchin" $honk]} {
putserv "PRIVMSG $chan :Scorchin is a nublet...."
return 0
}
}
It checks if the user gave an argument. Repeat the
bind pub - !whatis pub:definition
proc pub:definition {n u h c t} {
set honk [split $t]
if {[llength $honk] == 0} {
putserv "PRIVMSG $c :Please specify a member you want info about"
return 0
}
set honk [lindex $honk 0]
if {[string match -nocase "scorchin" $honk]} {
putserv "PRIVMSG $c :Scorchin is a nublet...."
return 0
}
}
also it would be better to use the switch command or make a global list of names and do lsearch on it
Last edited by Papillon on Mon Jun 07, 2004 6:00 am, edited 1 time in total.
An array might be not wrong there too.
Then you fill it once (maybe from a file) and access the description(value) by accessing $member_description_array(membername) only.