I`m trying to make a little code that will work with a pub command...something like this:
and here is the code :-----
For Channel Managers:
<@Manager1> !day
-|Eggdrop- SYNTAX: !day <??> <nick|*!*@host> [reason]
-----
For :
<@Admin1> !day
-|Eggdrop- SYNTAX: !day <1-100> <nick|*!*@host> [reason]
-----
For Channel Senior OPs:
<@SOp1> !day
-|Eggdrop- SYNTAX: !day <1-60> <nick|*!*@host> [reason]
-----
......and so on
-----
For Channel OPs:
<@Op1> !day
-|Eggdrop- SYNTAX: !day <1-7> <nick|*!*@host> [reason]
-----
Code: Select all
set dj(br) "Banned!"
set dj(xp) 1
bind pub n|MASDTO !day s:ban
setudef flag djtools
proc s:ban {nick uhost hand chan text} {
global botnick dj
if {[channel get $chan djtools] && ![isbotnick $nick]} {
if {[matchattr $hand n|MASDTO $chan] || [string tolower $chan]} {
set target [lindex [split $text] 0]
if {![botisop $chan]} {
puthelp "NOTICE $nick :Error I don't have OP!"
} elseif {[matchattr $hand n|- $chan]} {
if {$target == ""} {
puthelp "NOTICE $nick :SYNTAX:\002 !day <??> <nick|*!*@host> \[reason\] \002"
return 0
}
set options $target
foreach item $options {
if {![regexp "\[^0-99999\]" $item]} {
set days $item
}
s:day:ban
return 0
}
} elseif {![matchattr $hand -|O $chan]} {
if {$target == ""} {
puthelp "NOTICE $nick :SYNTAX:\002 !day <1-7> <nick|*!*@host> \[reason\] \002"
return 0
} else {
foreach not $target {
if {![regexp "\[^8-99999\]" $target} {
puthelp "NOTICE $nick :Error max allowed 1-7 days for OP Access Users"
return 0
}
set options $target
foreach item $options {
if {![regexp "\[^0-7\]" $item]} {
set days $item
}
s:day:ban
return 0
}
}
}
}
}
proc s:day:ban {nick uhost hand chan text} {
global botnick dj
if {[channel get $chan djtools] && ![isbotnick $nick]} {
set type [lindex [split $text] 1]
set dtype [nick2hand $type]
set reason [join [lrange [split $text] 3 end]]
if {$reason == ""} {
set reason $dj(br)
}
if {[string match *!*@* $type]} {
set dhost $type
} else {
set dhost "*!*@[lindex [split [getchanhost $type] @] 2]"
}
if {![matchattr $dtype n|MASDTOVU $chan] && ![isop $type $chan] && ![isvoice $type $chan] && ![matchattr $dtype b]} {
newchanban $chan $dhost days "($hand) $reason" [expr $days * 1440]
putquick "MODE $chan +b $dhost"
putquick "KICK $chan $type :($hand) $reason"
if {$dj(xb) == 1} {
putquick "PRIVMSG X :ban $chan $dhost 1 100 ($hand) $reason" -next
}
newignore $dhost days "($hand) $reason" [expr $days * 1440]
return 0
}
}
}
Well the errors are :
1.) Manager1
NO reaction ..... and I`m getting this error in dcc-chat<Manager1> !day
-|Eggdrop- SYNTAX: !day <??> <nick|*!*@host> [reason]
<Manager1> !day 9999 *!*@test.ro lol
...and so on for every user who has specific flags and trys to use this command...<|Eggdrop> [06:06] Tcl error [s:ban]: syntax error in expression "![matchattr $dtype n|MASDTOVU $chan] && ![isop $type $chan] ...": extra tokens at end of expression
any suggestions in how to make this script work ?1