egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

auto-ban
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
mavericku
Halfop


Joined: 12 Jun 2005
Posts: 62
Location: somewhere in the world

PostPosted: Tue Oct 24, 2006 9:49 am    Post subject: auto-ban Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Oct 25, 2006 5:19 pm    Post subject: Reply with quote

Read about [isban] and [ischanban] commands in tcl-commands.doc.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
mavericku
Halfop


Joined: 12 Jun 2005
Posts: 62
Location: somewhere in the world

PostPosted: Wed Oct 25, 2006 6:39 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Thu Oct 26, 2006 12:12 am    Post subject: Reply with quote

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
View user's profile Send private message
mavericku
Halfop


Joined: 12 Jun 2005
Posts: 62
Location: somewhere in the world

PostPosted: Thu Oct 26, 2006 7:45 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Thu Oct 26, 2006 9:56 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
mavericku
Halfop


Joined: 12 Jun 2005
Posts: 62
Location: somewhere in the world

PostPosted: Thu Oct 26, 2006 10:33 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Oct 26, 2006 2:49 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
mavericku
Halfop


Joined: 12 Jun 2005
Posts: 62
Location: somewhere in the world

PostPosted: Thu Oct 26, 2006 9:15 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Oct 27, 2006 11:49 am    Post subject: Reply with quote

Quote:
(Cool 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
View user's profile Send private message Visit poster's website
mavericku
Halfop


Joined: 12 Jun 2005
Posts: 62
Location: somewhere in the world

PostPosted: Fri Oct 27, 2006 12:38 pm    Post subject: Reply with quote

Sir_Fz wrote:
Quote:
(Cool 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 {![isban $host } { return } {
    putserv "PRIVMSG X :ban $chan $host 1 100 banned"
  }
}


O_O
_________________
mavericku
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Oct 27, 2006 1:37 pm    Post subject: Reply with quote

$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
View user's profile Send private message Visit poster's website
mavericku
Halfop


Joined: 12 Jun 2005
Posts: 62
Location: somewhere in the world

PostPosted: Sat Oct 28, 2006 10:48 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
mavericku
Halfop


Joined: 12 Jun 2005
Posts: 62
Location: somewhere in the world

PostPosted: Sat Oct 28, 2006 12:32 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Oct 28, 2006 5:44 pm    Post subject: Reply with quote

The set should be inside the proc and not outside it (logic).
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber