This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
mavericku
Halfop
Posts: 62 Joined: Sun Jun 12, 2005 11:32 pm
Location: somewhere in the world
Contact:
Post
by mavericku » Tue Oct 24, 2006 9:49 am
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: Select all
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
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Wed Oct 25, 2006 5:19 pm
Read about [isban] and [ischanban] commands in tcl-commands.doc.
mavericku
Halfop
Posts: 62 Joined: Sun Jun 12, 2005 11:32 pm
Location: somewhere in the world
Contact:
Post
by mavericku » Wed Oct 25, 2006 6:39 pm
Code: Select all
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
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Thu Oct 26, 2006 12:12 am
if { [isban $hostname $chan] } { return }
You need to negate it with a ! like
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.
mavericku
Halfop
Posts: 62 Joined: Sun Jun 12, 2005 11:32 pm
Location: somewhere in the world
Contact:
Post
by mavericku » Thu Oct 26, 2006 7:45 am
caesar wrote:
if { [isban $hostname $chan] } { return }
You need to negate it with a ! like
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: Select all
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: Select all
[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
r0t3n
Owner
Posts: 507 Joined: Tue May 31, 2005 6:56 pm
Location: UK
Post
by r0t3n » Thu Oct 26, 2006 9:56 am
You forgot a {
Change:
Code: Select all
proc joinreban {chan hand nick uhost}
to
Code: Select all
proc joinreban {chan hand nick uhost} {
r0t3n @ #r0t3n @ Quakenet
mavericku
Halfop
Posts: 62 Joined: Sun Jun 12, 2005 11:32 pm
Location: somewhere in the world
Contact:
Post
by mavericku » Thu Oct 26, 2006 10:33 am
Tosser^^ wrote: You forgot a {
Change:
Code: Select all
proc joinreban {chan hand nick uhost}
to
Code: Select all
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: Select all
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: Select all
[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: Select all
[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
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Thu Oct 26, 2006 2:49 pm
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.
mavericku
Halfop
Posts: 62 Joined: Sun Jun 12, 2005 11:32 pm
Location: somewhere in the world
Contact:
Post
by mavericku » Thu Oct 26, 2006 9:15 pm
Sir_Fz wrote: 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: Select all
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
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Fri Oct 27, 2006 11:49 am
(8) 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
mavericku
Halfop
Posts: 62 Joined: Sun Jun 12, 2005 11:32 pm
Location: somewhere in the world
Contact:
Post
by mavericku » Fri Oct 27, 2006 12:38 pm
Sir_Fz wrote: (8) 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: Select all
[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: Select all
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 $host 1 100 banned"
}
}
O_O
mavericku
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Fri Oct 27, 2006 1:37 pm
$host = ident@host. To split it:
Code: Select all
set host *!*@[lindex [split $host @] 1]
Replacing 1 with 0 will return the ident.
mavericku
Halfop
Posts: 62 Joined: Sun Jun 12, 2005 11:32 pm
Location: somewhere in the world
Contact:
Post
by mavericku » Sat Oct 28, 2006 10:48 am
Sir_Fz wrote: $host = ident@host. To split it:
Code: Select all
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: Select all
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: Select all
[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: Select all
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
mavericku
Halfop
Posts: 62 Joined: Sun Jun 12, 2005 11:32 pm
Location: somewhere in the world
Contact:
Post
by mavericku » Sat Oct 28, 2006 12:32 pm
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
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Sat Oct 28, 2006 5:44 pm
The set should be inside the proc and not outside it (logic).