| View previous topic :: View next topic |
| Author |
Message |
Salik83 Voice
Joined: 19 Apr 2009 Posts: 6 Location: Pk
|
Posted: Tue Apr 21, 2009 4:24 pm Post subject: Whats wrong in this code :/ |
|
|
| Code: | if {$numversion < 1060200} {
bind join v|v * join:sv
proc join:sv {nick host hand chan} { global sv
utimer [expr [lindex [split $sv(delay) :] 0] + [rand [lindex [split $sv(delay) :] 1]]] [list sv:voice $nick $host $hand
}
proc sv:voice {nick host hand chan} {
if {[botisop $chan]} { global sv
switch -- "$sv(method)" {
"1" {
if {((![isbotnick $nick]) && (![isbotnick [hand2nick $hand $chan]]))} {
if {(([onchan $nick $chan]) && ("[getchanhost $nick $chan]" == "$host") && (![isvoice $nick $chan]) && (($sv
# They still have the nick they joined with.
puthelp "MODE $chan +v $nick"
} elseif {((![onchan $nick $chan]) && ([handonchan $hand $chan]) && (![isvoice [hand2nick $hand $chan] $chan
# They most likely changed nicks after joining.
puthelp "MODE $chan +v [hand2nick $hand $chan]"
}
}
}
"2" {
foreach u "[chanlist $chan]" {
if {[string match {*@119.*} [getchanhost $u $chan]]} { return }
if {[string match {*@116.*} [getchanhost $u $chan]]} { return }
if {((![isvoice $u $chan]) && ([matchattr [nick2hand $u $chan] v|v $chan]) && (![isbotnick $u]) && (($sv(voi
pushmode $chan +v $u
}
}
}
}
}
}
if {"[info commands isbotnick]" == ""} {
proc isbotnick {nick} { global botnick
if {"[string tolower $nick]" == "[string tolower $botnick]"} { set nick 1 } { set nick 0 }
}
}
} |
i want this script to exempt users from *!*@119.* and *!*@116.* , not to voice them :/
Edit:
Placed the code within proper tags to ease reading.
/NML_375 |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Apr 21, 2009 6:06 pm Post subject: |
|
|
It would seem part of the code was cut from the post on the right side.
From what I can see, the code is not coherent, as when $sv(method) is set to 1, the check for 116/119 IP's is not done. Try adding the "string match" checks to the first case, in the beginning. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Salik83 Voice
Joined: 19 Apr 2009 Posts: 6 Location: Pk
|
Posted: Wed Apr 22, 2009 3:28 pm Post subject: |
|
|
| Code: |
set sv(delay) 60:180
set sv(voiceops) 0
set sv(method) 2
if {$numversion < 1060200} {
bind join v|v * join:sv
proc join:sv {nick host hand chan} { global sv
utimer [expr [lindex [split $sv(delay) :] 0] + [rand [lindex [split $sv(delay) :] 1]]] [list sv:voice $nick $host $hand $chan]
}
proc sv:voice {nick host hand chan} {
if {[botisop $chan]} { global sv
switch -- "$sv(method)" {
"1" {
if {((![isbotnick $nick]) && (![isbotnick [hand2nick $hand $chan]]))} {
if {(([onchan $nick $chan]) && ("[getchanhost $nick $chan]" == "$host") && (![isvoice $nick $chan]) && (($sv(voiceops)) || (![isop $nick $chan])))} {
# They still have the nick they joined with.
puthelp "MODE $chan +v $nick"
} elseif {((![onchan $nick $chan]) && ([handonchan $hand $chan]) && (![isvoice [hand2nick $hand $chan] $chan]) && (($sv(voiceops)) || (![isop [hand2nick $hand $chan] $chan])))} {
# They most likely changed nicks after joining.
puthelp "MODE $chan +v [hand2nick $hand $chan]"
}
}
}
"2" {
foreach u "[chanlist $chan]" {
if {((![isvoice $u $chan]) && ([matchattr [nick2hand $u $chan] v|v $chan]) && (![isbotnick $u]) && (($sv(voiceops)) || (![isop $u $chan])))} {
pushmode $chan +v $u
}
}
}
}
}
}
if {"[info commands isbotnick]" == ""} {
proc isbotnick {nick} { global botnick
if {"[string tolower $nick]" == "[string tolower $botnick]"} { set nick 1 } { set nick 0 }
}
}
foreach c "[channels]" { channel set "$c" -autovoice }
catch { unset $c }
} else {
putlog "slowvoice.tcl: Your Eggdrop version already supports delayed auto-voiceing."
}
putlog "slowvoice.tcl v1.4 by FireEgl@EFNet <FireEgl@LinuxFan.com> - Loaded."
|
here is a complete code.. all i want to add *!*@119.* and *!*@116.* ips to ignore by this script. so people matching those ips wont get +v :/. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Wed Apr 22, 2009 7:17 pm Post subject: |
|
|
Quite like your code, but it should do the trick:
Or do you need DNS resolving as well?
Btw, mind if I ask why you are using such an old eggdrop?
| Code: | set sv(delay) 60:180
set sv(voiceops) 0
set sv(method) 2
if {$numversion < 1060200} {
bind join v|v * join:sv
proc join:sv {nick host hand chan} { global sv
utimer [expr [lindex [split $sv(delay) :] 0] + [rand [lindex [split $sv(delay) :] 1]]] [list sv:voice $nick $host $hand $chan]
}
proc sv:voice {nick host hand chan} {
if {[botisop $chan]} { global sv
switch -- "$sv(method)" {
"1" {
if {[string match "*@116.*" $host] || [string match "*@119.*" $host]} {return}
if {((![isbotnick $nick]) && (![isbotnick [hand2nick $hand $chan]]))} {
if {(([onchan $nick $chan]) && ("[getchanhost $nick $chan]" == "$host") && (![isvoice $nick $chan]) && (($sv(voiceops)) || (![isop $nick $chan])))} {
# They still have the nick they joined with.
puthelp "MODE $chan +v $nick"
} elseif {((![onchan $nick $chan]) && ([handonchan $hand $chan]) && (![isvoice [hand2nick $hand $chan] $chan]) && (($sv(voiceops)) || (![isop [hand2nick $hand $chan] $chan])))} {
# They most likely changed nicks after joining.
puthelp "MODE $chan +v [hand2nick $hand $chan]"
}
}
}
"2" {
foreach u "[chanlist $chan]" {
set uhost [getchanhost $u]
if {[string match "*@116.*" $uhost] || [string match "*@119.*" $uhost]} {continue}
if {((![isvoice $u $chan]) && ([matchattr [nick2hand $u $chan] v|v $chan]) && (![isbotnick $u]) && (($sv(voiceops)) || (![isop $u $chan])))} {
pushmode $chan +v $u
}
}
}
}
}
}
if {"[info commands isbotnick]" == ""} {
proc isbotnick {nick} { global botnick
if {"[string tolower $nick]" == "[string tolower $botnick]"} { set nick 1 } { set nick 0 }
}
}
foreach c "[channels]" { channel set "$c" -autovoice }
catch { unset $c }
} else {
putlog "slowvoice.tcl: Your Eggdrop version already supports delayed auto-voiceing."
}
putlog "slowvoice.tcl v1.4 by FireEgl@EFNet <FireEgl@LinuxFan.com> - Loaded." |
Edit:
Fixed issue with "string match". Thanks for pointing it out, arfer. _________________ NML_375, idling at #eggdrop@IrcNET
Last edited by nml375 on Thu Apr 23, 2009 10:04 am; edited 1 time in total |
|
| Back to top |
|
 |
arfer Master

Joined: 26 Nov 2004 Posts: 436 Location: Manchester, UK
|
Posted: Thu Apr 23, 2009 5:15 am Post subject: |
|
|
In a string match the pattern comes first and the string to match it against second. I think you have it the wrong way about.
I do the same thing quite a lot because lsearch for lists is the opposite way. List first and pattern second.
Confusing! _________________ I must have had nothing to do |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu Apr 23, 2009 10:02 am Post subject: |
|
|
Darn!
Thanks for pointing it out. I'll update my post in a sec. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Salik83 Voice
Joined: 19 Apr 2009 Posts: 6 Location: Pk
|
Posted: Thu Apr 23, 2009 3:22 pm Post subject: |
|
|
| cant use new version, i know it comes with slowvoice feature, have to get some auto voice script so i can add some exemptions, i cant ignore *!*@119.* from bot because most of master are using same ip. thanks nml.. code worked. (F)! |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu Apr 23, 2009 3:31 pm Post subject: |
|
|
Nice you got it working.
I hope you are aware that there's been numerous bugfixes since 1.6.2, several of them critical. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Salik83 Voice
Joined: 19 Apr 2009 Posts: 6 Location: Pk
|
Posted: Thu Apr 23, 2009 3:33 pm Post subject: |
|
|
yeah, i updated all bug fixers.. thanks well +g is for autovoice too i guess, so we need to .adduser for this? |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu Apr 23, 2009 3:34 pm Post subject: |
|
|
Yup, it'll only voice members having the v userflag. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|