| View previous topic :: View next topic |
| Author |
Message |
mavericku Halfop

Joined: 12 Jun 2005 Posts: 62 Location: somewhere in the world
|
Posted: Tue Oct 24, 2006 9:49 am Post subject: auto-ban |
|
|
Hello,
Here i am again ... looking for a script that auto re-bans trough a Service bot like X the bans that it has in his internal banlist.
not looking for the entire script just a start like
| Code: |
setudef flag joinreban
bind join -|- joinreban
proc joinreban (chan hand nick uhost }
globan botnick
if {[botisop $chan || ![channel get $chan joinreban]} {
return
}
.....
|
can someone help me? _________________ mavericku |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Oct 25, 2006 5:19 pm Post subject: |
|
|
Read about [isban] and [ischanban] commands in tcl-commands.doc. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
mavericku Halfop

Joined: 12 Jun 2005 Posts: 62 Location: somewhere in the world
|
Posted: Wed Oct 25, 2006 6:39 pm Post subject: |
|
|
| Code: |
setudef flag joinreban
bind join -|- joinreban
proc joinreban {chan hand nick uhost args}
globan botnick joinread
if {[botisop $chan || ![channel get $chan joinreban]} { return }
if { [isban $hostname $chan] } { return }
if { [isban $hostname] } { return } {
putserv "PRIVMSG X :ban $chan $hostname 1 100 banned"
}
|
????? anyone ... anymore advices ? ... _________________ mavericku |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu Oct 26, 2006 12:12 am Post subject: |
|
|
| Quote: |
if { [isban $hostname $chan] } { return }
|
You need to negate it with a ! like
| Quote: |
if {![isban $hostname $chan]} return
|
Also, don't use 'args' as it has a special meaning in tcl, don't use variables that haven't been previously declared because your eggdrop will die. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
mavericku Halfop

Joined: 12 Jun 2005 Posts: 62 Location: somewhere in the world
|
Posted: Thu Oct 26, 2006 7:45 am Post subject: |
|
|
| caesar wrote: | | Quote: |
if { [isban $hostname $chan] } { return }
|
You need to negate it with a ! like
| Quote: |
if {![isban $hostname $chan]} return
|
Also, don't use 'args' as it has a special meaning in tcl, don't use variables that haven't been previously declared because your eggdrop will die. |
Thank you Caesar
so i have now ...
| Code: |
setudef flag joinreban
bind join -|- joinreban
proc joinreban {chan hand nick uhost}
globan botnick joinread
if {[botisop $chan || ![channel get $chan joinreban]} { return }
if {![isban $hostname $chan] } { return }
if {![isban $hostname] } { return } {
putserv "PRIVMSG X :ban $chan $hostname 1 100 banned"
}
|
but this one ... hits me with this error ...
| Code: |
[01:44:30] (r0b0t): [14:40] 0,4Error while loading test -- Errormsg: wrong # args: should be "proc name args body"
[01:44:30] (r0b0t): [14:40] script: test -- ::errorInfo: wrong # args: should be "proc name args body"
[01:44:30] (r0b0t): while executing
[01:44:30] (r0b0t): "proc joinreban {chan hand nick uhost} "
[01:44:30] (r0b0t): (file "scripts/test.tcl" line 5)
[01:44:30] (r0b0t): invoked from within
[01:44:30] (r0b0t): "source scripts/test.tcl"
[01:44:30] (r0b0t): ("uplevel" body line 1)
[01:44:30] (r0b0t): invoked from within
[01:44:30] (r0b0t): "uplevel #0 [list source scripts/$text.tcl] "
|
_________________ mavericku |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Thu Oct 26, 2006 9:56 am Post subject: |
|
|
You forgot a {
Change:
| Code: | | proc joinreban {chan hand nick uhost} |
to
| Code: | | proc joinreban {chan hand nick uhost} { |
_________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
mavericku Halfop

Joined: 12 Jun 2005 Posts: 62 Location: somewhere in the world
|
Posted: Thu Oct 26, 2006 10:33 am Post subject: |
|
|
| Tosser^^ wrote: | You forgot a {
Change:
| Code: | | proc joinreban {chan hand nick uhost} |
to
| Code: | | proc joinreban {chan hand nick uhost} { |
|
Thank you Tosser^^ the script has loaded without any errors BUT .. it doesn't do nothing..
the script is
| Code: |
setudef flag joinreban
bind join -|- joinreban
proc joinreban {chan hand nick uhost} {
globan botnick joinread
if {[botisop $chan || ![channel get $chan joinreban]} { return }
if {![isban $hostname $chan] } { return }
if {![isban $hostname] } { return } {
putserv "PRIVMSG X :ban $chan $hostname 1 100 banned"
}
}
|
| Code: |
[04:27:18] (r0b0t): [17:23] script: test -- loaded without error.
[04:27:43] (Piglet`): .chanset #buc +joinreban
[04:27:46] (r0b0t): Successfully set modes { +joinreban } on #buc.
|
| Code: |
[04:28:43] *** r0b0t sets mode: +b *!*@ACB2105C.ipt.aol.com
[04:28:43] *** [#buc] Banned- piggy`
[04:28:43] *** [#buc] You were banned by r0b0t
[04:29:15] *** piggy` was kicked by r0b0t (Banned: (mavericku) tocmai te-ai ales de un ban idiãt :))
[04:28:51] *** Piglet` sets mode: -o MApN
[04:29:04] *** [#buc] Inviting piggy` to channel...
[04:29:13] *** piggy` (~mave@ACB2105C.ipt.aol.com) has joined #
[04:29:15] *** piggy` was kicked by r0b0t (Banned: (mavericku) tocmai te-ai ales de un ban idiãt :))
[04:29:37] *** [#buc] Inviting piggy` to channel...
[04:29:44] *** piggy` (~mave@ACB2105C.ipt.aol.com) has joined #
[04:29:45] *** piggy` was kicked by r0b0t (Banned: (mavericku) tocmai te-ai ales de un ban idiãt :))
|
now it should privmsg X ban that host .. but on bot party it doesn't show the answer from X (added ban to *!*@host at level 100)
....
anymore advices ...? _________________ mavericku |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Oct 26, 2006 2:49 pm Post subject: |
|
|
| Quote: | | if {[botisop $chan || ![channel get $chan joinreban]} { return } |
you need to close the bracket after $chan in the [botisop] cmd. That means if the bot is oped in the chan, it won't msg x anything. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
mavericku Halfop

Joined: 12 Jun 2005 Posts: 62 Location: somewhere in the world
|
Posted: Thu Oct 26, 2006 9:15 pm Post subject: |
|
|
| Sir_Fz wrote: | | Quote: | | if {[botisop $chan || ![channel get $chan joinreban]} { return } |
you need to close the bracket after $chan in the [botisop] cmd. That means if the bot is oped in the chan, it won't msg x anything. |
ok , fixed the bracket but it still doesn't work ... but i think i've got it wrong
I WANT it to ban the host IF it has it in the internal banlist, i don't think ifisop will be needed .. because the ban will be trough the service bot ..
so the code will be
| Code: |
setudef flag joinreban
bind join -|- joinreban
proc joinreban {chan hand nick uhost} {
globan botnick joinread
if {![channel get $chan joinreban]} { return }
if {![isban $hostname $chan] } { return }
if {![isban $hostname] } { return } {
putserv "PRIVMSG X :ban $chan $hostname 1 100 banned"
}
}
|
but still nothing ... please help me understand this ... _________________ mavericku |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Oct 27, 2006 11:49 am Post subject: |
|
|
| Quote: | ( JOIN (stackable)
bind join <flags> <mask> <proc>
procname <nick> <user@host> <handle> <channel>
Description: triggered by someone joining the channel. The mask in
the bind is matched against "#channel nick!user@host" and can
contain wildcards.
Module: irc |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
mavericku Halfop

Joined: 12 Jun 2005 Posts: 62 Location: somewhere in the world
|
Posted: Fri Oct 27, 2006 12:38 pm Post subject: |
|
|
| Sir_Fz wrote: | | Quote: | ( JOIN (stackable)
bind join <flags> <mask> <proc>
procname <nick> <user@host> <handle> <channel>
Description: triggered by someone joining the channel. The mask in
the bind is matched against "#channel nick!user@host" and can
contain wildcards.
Module: irc |
|
first i had $hostname instead of $host .. but it have me this error
| Code: |
[06:59:33] (r0b0t): [19:55] Tcl error [joinreban]: can't read "hostname": no such variable
|
after i have changed it in $host .... it doesn't give me nothing ..
pfff
| Code: |
setudef flag joinreban
bind join - * joinreban
proc joinreban {nick host hand chan} {
if {![channel get $chan joinreban]} { return }
if {![isban $host $chan] } { return }
if { |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Oct 27, 2006 1:37 pm Post subject: |
|
|
$host = ident@host. To split it:
| Code: | | set host *!*@[lindex [split $host @] 1] |
Replacing 1 with 0 will return the ident. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
mavericku Halfop

Joined: 12 Jun 2005 Posts: 62 Location: somewhere in the world
|
Posted: Sat Oct 28, 2006 10:48 am Post subject: |
|
|
| Sir_Fz wrote: | $host = ident@host. To split it:
| Code: | | set host *!*@[lindex [split $host @] 1] |
Replacing 1 with 0 will return the ident. |
Sir_Fz
at first i added your code like this
| Code: |
setudef flag joinreban
set host *!*@[lindex [split $host @] 1] #with " " and without them
bind join - * joinreban
proc joinreban {nick host hand chan} {
if {![channel get $chan joinreban]} { return }
if {![isban $host $chan] } { return }
if {![isban $host } { return } {
putserv "PRIVMSG X :ban $chan $host 1 100 banned"
}
}
|
but it gave me an error ...
| Code: |
[04:38:31] (r0b0t): [17:34] script: test -- ::errorInfo: can't read "host": no such variable
[04:38:31] (r0b0t): while executing
[04:38:31] (r0b0t): "split $host @"
[04:38:31] (r0b0t): invoked from within
[04:38:31] (r0b0t): "lindex [split $host @] 1"
[04:38:31] (r0b0t): invoked from within
[04:38:31] (r0b0t): "set host "*!*@[lindex [split $host @] 1]""
[04:38:31] (r0b0t): (file "scripts/test.tcl" line 2)
[04:38:31] (r0b0t): invoked from within
[04:38:31] (r0b0t): "source scripts/test.tcl"
|
but then i've changed it like this
| Code: |
setudef flag joinreban
bind join - * joinreban
proc joinreban {nick host hand chan} {
if {![channel get $chan joinreban]} { return }
if {![isban $host $chan] } { return }
if {![isban $host } { return } {
putserv "PRIVMSG X :ban $chan *!*@[lindex [split $host @] 1] 1 100 banned"
}
}
|
and it's still doesn't work ..
:-< ...damn _________________ mavericku |
|
| Back to top |
|
 |
mavericku Halfop

Joined: 12 Jun 2005 Posts: 62 Location: somewhere in the world
|
Posted: Sat Oct 28, 2006 12:32 pm Post subject: |
|
|
I just figured out that i`m doing something wrong here .. our you guys missunderstood me.
If the bot has the ban *!*@host.com in his internal banlist for channel #foo
and a drone with that host enters #foo i would like it to be banned trough x (the exact ban the bot has in his internal banlist not a new one (there are bans like *monster*!*@* and i don't want it to ban the host..))
Advices ... ?
Thanks _________________ mavericku |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Oct 28, 2006 5:44 pm Post subject: |
|
|
The set should be inside the proc and not outside it (logic). _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|