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.

script for unban all

Old posts that have not been replied to for several years.
M
MINImi
Voice
Posts: 30
Joined: Sat Oct 11, 2003 6:52 am

script for unban all

Post by MINImi »

hi
i need a script for the bot that unset all the bans which the bots sets with a command

i dont mean the channel bans

i mean the bans which are in the bots memory, dynamic bans:)

i hope you unterstand me :)
User avatar
CrazyCat
Revered One
Posts: 1253
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

something like:

Code: Select all

foreach thisban [bans] {
unban $thisban
}
This is totally false, but the principe is this :)
just adapt it
M
MINImi
Voice
Posts: 30
Joined: Sat Oct 11, 2003 6:52 am

Post by MINImi »

i think i better need a complete script :P
User avatar
CrazyCat
Revered One
Posts: 1253
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

learn tcl-command.doc :)

Code: Select all

set channel "#mychan"
foreach thisban [banlist $channel] {
   set banhost [lindex $thisban 0]
   killchanban $channel $banhost
}
But I'm not sure of the killchanban syntax (argument used???) and I've no time to spend to test it
M
MINImi
Voice
Posts: 30
Joined: Sat Oct 11, 2003 6:52 am

Post by MINImi »

there must be scripts for :)
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

MINImi wrote:there must be scripts for :)
And by reading docs/tcl-commands.doc and http://www.suninet.nl plus the information already given you should be able to make it yourself.
User avatar
CrazyCat
Revered One
Posts: 1253
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Hey master :)
can't you say if my syntax was good or, if no, wich is the good?
I think that killchanban prefers the id of ban, not the host.
If yes, how to get the ID ?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

i see that the syntax is correct.

Code: Select all

bind pub mo|mo !unbanall unban:all

proc unban:all {nick uhost hand chan arg} {
foreach thisban [banlist $chan] {
   set banhost [lindex $thisban 0] 
   killchanban $channel $banhost 
 }
}
Tested, works fine.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Probably you mean killchanban $chan $banhost not $channel :P
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

yeah :p I copied it from crazycat and forgot to change it to $chan
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

And how did it worked fine if you had $channel instead of $chan? :D
Once the game is over, the king and the pawn go back in the same box.
J
Jag
Halfop
Posts: 90
Joined: Fri Sep 19, 2003 10:06 am

Post by Jag »

didn't work :(

Code: Select all

bind pub - !unbanall unban:all
proc unban:all {nick uhost hand chan arg} {
  foreach thisban [banlist $chan] {
    set banhost [lindex $thisban 0]
    killchanban $chan $banhost
  }
}
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

i added some bans into #channel and in partyline:
.tcl foreach thisban [banlist #channel] { set banhost [lindex $thisban 0] ; killchanban #channel $banhost }
the bot removed all bans from the channel.

if it didn't work for you, then the ban is probably a global ban not a channel specific ban.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Doh! It's impossible not to work with #channel in bouth places as in [banlist #channel] and in killchanban #channel.. Test this and tell me if it's working:

Code: Select all

.tcl set $chan #channel ; foreach thisban [banlist $chan] { set banhost [lindex $thisban 0] ; killchanban $channel $banhost }
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

dude caesar! you're talking about something completely different from the issue, okay i tested the correct code, but pasted a wrong code used $channel instead of $chan (oh God please forgive me), comeon let it go.

also Jag used the correct code, and it should work.
Locked