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.

+ban / -ban

Old posts that have not been replied to for several years.
M
MeJseL
Halfop
Posts: 61
Joined: Tue Nov 18, 2003 7:30 am
Location: Gothenburg , sweden

+ban / -ban

Post by MeJseL »

Any one have a +ban/-ban msg script? ... insted of using dcc/telenet .. that would be very nice :o
yeah!
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

bind msg n +ban ban:user
bind msg n -ban unban:user
        
proc ban:user {nick uhost hand arg} {
if {[validchan [lindex [split $arg] 0]]} {
 newchanban [lindex [split $arg] 0] [lindex [split $arg] 1] $nick "[join [lrange [split $arg] 2 end]]"
} {
 newban [lindex [split $arg] 0] $nick "[join [lrange [split $arg] 1 end]]"
 }
}

proc ban:user {nick uhost hand arg} {
if {[validchan [lindex [split $arg] 0]]} {
 killchanban [lindex [split $arg] 0] [lindex [split $arg] 1]
} {
 killban [lindex [split $arg] 0]
 }
}
this will add permanent bans, you can't specify duration. If you want to specify duration, then use string isalpha to catch if the last word is digits.
if a channel is not specified then it will add a global ban.
(+ban [channel] <ban> <reason>)
M
MeJseL
Halfop
Posts: 61
Joined: Tue Nov 18, 2003 7:30 am
Location: Gothenburg , sweden

Post by MeJseL »

hmm didnt work :/
yeah!
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

replace the second proc:

Code: Select all

proc ban:user {nick uhost hand arg} {
to

Code: Select all

proc unban:user {nick uhost hand arg} {
notice the un Sir_Fz :mrgreen:
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 »

Sorry, thats because I wrote the first proc, then pasted it, changed newchanban to killchanban and newban to killban :P good notice caesar (I am the who has to pay attention now, hehe)
E
EEggy
Op
Posts: 122
Joined: Thu Sep 26, 2002 11:46 pm

Post by EEggy »

HI, how this will work, if i do /msg bot -ban, i mean whoever will type /msg bot -ban, it should check that person's nick/ip, and if its in the banlist, it should remove it.

thanks
EEggy
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

EEggy easiest way is to let the bot use chanserv (or whatever services) to unban the user when he commands it to unban him.
E
EEggy
Op
Posts: 122
Joined: Thu Sep 26, 2002 11:46 pm

Post by EEggy »

thanks, but i am trying to figure out, what changes i should do, so when the person will msg the bot /msg bot -ban , and it should check the person, who msged the bot, script should check his/her nick/ip, and if its ban, remove it...


Thanks
EEggy
M
MeJseL
Halfop
Posts: 61
Joined: Tue Nov 18, 2003 7:30 am
Location: Gothenburg , sweden

Post by MeJseL »

hmm thx .. but can u add like if i typ just +ban .. then the bot notice like usage: +ban <channel> <host> <reason> and the same on -ban
and like if i add a ban the bot notice: banned: $host Reason: $reason ..
and the same on -ban ... that would be verry nice if u could do that :D
yeah!
M
MeJseL
Halfop
Posts: 61
Joined: Tue Nov 18, 2003 7:30 am
Location: Gothenburg , sweden

Post by MeJseL »

plz :o
yeah!
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

After the proc add something like:

Code: Select all

if {[llength $arg] < 3} {
putserv "PRIVMSG $nick :Usage: +ban <channel> <host> <reason>"
}
same thing goes for the -ban..
Once the game is over, the king and the pawn go back in the same box.
M
MeJseL
Halfop
Posts: 61
Joined: Tue Nov 18, 2003 7:30 am
Location: Gothenburg , sweden

Post by MeJseL »

ok thx, but if i set a ban i would like to know that thge bot responde with like notice nick banned: host reason: reason
and the same with unban :D
yeah!
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Actualy newban should be replaced by newchanban and the script should be changed in order to work this way..
Once the game is over, the king and the pawn go back in the same box.
M
MeJseL
Halfop
Posts: 61
Joined: Tue Nov 18, 2003 7:30 am
Location: Gothenburg , sweden

Post by MeJseL »

work what way ? :o
yeah!
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

caesar wrote:Actualy newban should be replaced by newchanban and the script should be changed in order to work this way..
The code says if first arg is a valid channel then the bot will add a newchanban else it will add a newban (global ban)

Mejsel, add after newchanban putserv "NOTICE $nick :Added new ban \002[lindex [split $arg] 1]\002 on \002[lindex [split $arg] 1]\002"

and after newban putserv "NOTICE $nick :Added global new ban \002[lindex [split $arg] 1]\002"

same thing after killban and killchan ban but change the message.
Locked