Code: Select all
set firstletter "a b c d e f g h i j k l m n o p q r s t u v w x y z"
bind join - * lcase:voice
proc lcase:voice {nick uhost hand chan} {
set flnick [lindex [split $nick [lindex $nick 1]] 0]
if {![botisop $chan]} {return 0}
if {$flnick == [split $a]} {
pushmode $chan +v $nick
}
}
no, but I admire your bold attemptSir_Fz wrote:I'm just curious; would this work?
Code: Select all
set flnick [lindex [split $nick [lindex $nick 1]] 0]
Code: Select all
set flnick [lindex [split $nick ""] 0]
Code: Select all
if {$flnick == [split $a]} {
pushmode $chan +v $nick
}
Or to maintain compatibility with lower tcl versions,user wrote:Tip1: running the code will usually help you determine if it works or not.
Tip2: 'string index' provides an easy way of accessing single chars from a string, but why go through all this trouble when a simple 'string match \[a-z\]* $nick' would give you the answer?
Code: Select all
set firstletter "a b c d e f g h i j k l m n o p q r s t u v w x y z"
bind join - * lcase:voice
proc lcase:voice {nick uhost hand chan} {
global firstletter
set flnick [lindex [split $nick ""] 0]
if {![botisop $chan]} {return 0}
if {$flnick == [split $firstletter]} {
pushmode $chan +v $nick
}
}
If we're to believe the manual, the syntax is as follows: lsearch ?options? list pattern ...and the index of the first element matching is returned or -1 if it was not found..so something like this should do the trick:Sir_Fz wrote:so how should it be ? $flnick == [lsearch $firstletter] ?
Code: Select all
if {[lsearch -exact $firstletter $flnick]>-1} {found} {not}
Code: Select all
bind join - * lcase:voice
proc lcase:voice {nick uhost hand chan } {
if {[!botisop $chan]} {return 0}
if { stringmatch /[a-z/]* $nick } {
pushmode $chan +v $nick
}
}
You've got all the right commands in the right order, but the syntax is a bit offBlackRaven wrote:ok, it's obvious the script DOES have a syntax error....
HELP!
Code: Select all
proc lcase:voice {nick uhost hand chan} {
if {[botisop $chan] && [string match \[a-z\]* $nick]} {
pushmode $chan +v $nick
}
}
Code: Select all
set collar1 "{"
Code: Select all
proc lcase:voice {nick uhost hand chan} {
if {[botisop $chan] &&{ [string index $nick 0] == $collar1 } {
pushmode $chan +v $nick
}
}