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.

private message ban

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
s
scooterh
Voice
Posts: 12
Joined: Fri May 01, 2009 10:32 pm

private message ban

Post by scooterh »

i'm new to eggdrop bots and tcl as ewll.

All i'm needing is something simple to where if they msg the bot which will be opped they are banned and put in a ban list.

Thanks in advance
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

I'd suggest using the msgm binding to match any incoming message.

Next, test that whoever sent the message isn't a "friend" or such. The matchattr command does the trick here. Best approach would be to test against fpo flags, and if matched, abort the script (return 1).

If the user did not match those flags, use the newban or newchanban command to create a new ban. Depending on settings, this will also kick the offender from the channel.

Also, if your eggdrop supports the exclusive-binds setting, make sure it's set to 0 to allow the OP, INVITE, etc msg commands to remain functioning for registered users...

Edit: Think my eyes are playing tricks with me today, thought this was posted in the "Scripting Help" forum. I'll see about posting a script such as above shortly.
NML_375
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

This should do the trick:

Code: Select all

bind msgm * - msgmDoBan

proc msgmDoBan {nick host handle text} {
 if {[matchattr "ofvb|ofv" $handle]} {
  return 1
 }
 newban [maskhost "${nick}!${host}"] $::botnick "Automated Ban: Do not msg bots" 0
 return 0
}
NML_375
s
scooterh
Voice
Posts: 12
Joined: Fri May 01, 2009 10:32 pm

Post by scooterh »

and i just put that in the eggdrop.conf file correct, along with all the other configs?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Either at the end of eggdrop.conf, or in a separate file that you then load using the source command.
NML_375
s
scooterh
Voice
Posts: 12
Joined: Fri May 01, 2009 10:32 pm

Post by scooterh »

ok great i'll give it a shot shortly.
s
scooterh
Voice
Posts: 12
Joined: Fri May 01, 2009 10:32 pm

Post by scooterh »

doesn't seem to be working, but the peolpe who are helping me test are logged into X and they do have op priv but are not opped at this time, would that affect it?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

This script does not care for X users, but only users added to the bot.

Do you see any error messages logged in your bot?
Also, could you double-check that the people testing the command is not recognized by the bot? Use the .channels #yourchannel dcc chat command for this.
NML_375
s
scooterh
Voice
Posts: 12
Joined: Fri May 01, 2009 10:32 pm

Post by scooterh »

only user that has access to bot is myself and don't see anything in the eggdrop log
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Issue the command ".bind msgm all" and post the result.
Also issue the command ".channel #yourchan" and post the result.
NML_375
s
scooterh
Voice
Posts: 12
Joined: Fri May 01, 2009 10:32 pm

Post by scooterh »

[09:43] #tater-sal# binds msgm all
Command bindings:
TYPE FLGS COMMAND HITS BINDING (TCL)
msgm -|- - 0 msgmDoBan
msgm -|- help seenstats 0 bs_help_msg_seenstats
msgm -|- help chanstats 0 bs_help_msg_chanstats
msgm -|- help seen 0 bs_help_msg_seen

.channel #texas
[09:44] #tater-sal# (#texas) channel
Channel #texas, 41 members, mode +tn:
Channel Topic: <LiquidChickn> i have no IQ
(n = owner, m = master, o = op, d = deop, b = bot)
NICKNAME HANDLE JOIN IDLE USER@HOST
@girl_on_cam * 09:15 <- it's me!
`Tom * --- 11m IceChat7@dhcp7-163.geusnet.com
Fantine * --- 29m ~Fantine@ppp-70-249-34-95.dsl.austtx.swbell.net
tater-salad tater-sal --- N 16m ~scooter@h189.116.155.207.dynamic.ip.windstream.net
gnaja * --- 29m ~stashash@ganjamonsta.users.undernet.org
KillaZ * --- 5m KillaZ@Lucretia.users.undernet.org
YlwRosie * --- 21m ~bumblebee@cpe-72-183-229-194.satx.res.rr.com
Budweiser84 * --- 29m ~Budweiser@76.6.67.92
radi0chik * --- 16m ~youwish@vide0chik.users.undernet.org
^Jenn^ * --- 29m ~jenn@JennAngel.users.undernet.org
lynnn * --- 29m ~lynnnn@lynnc.users.undernet.org
km5r_aux * --- 29m ~none@adsl-70-129-113-78.dsl.rcsntx.swbell.net
phil * --- 29m phil@philg.users.undernet.org
SuperBoY` * --- 29m ~mellanie@89.123.154.205
AwesumPossum * --- 29m ~get@tx-71-54-110-228.dhcp.embarqhsd.net
@slvrzzz * --- 29m ~slvr@cpe-24-242-202-232.tx.res.rr.com
darvie * --- 29m ~darva@70.240.206.168
WebAlmighty * --- 29m ~webalmigh@webadillo.users.undernet.org
Aenima * --- 4m ~A.hayes@Aenima.users.undernet.org
NegPol * --- 29m ~negpol@cpe-76-187-78-200.tx.res.rr.com
FemDragon * --- 29m ~femdragon@FemDragon.users.undernet.org
Lobster * --- 29m ~rakim@98.225.16.170
Tom` * --- 29m mAdcLoWnZ@WongFoU.users.undernet.org
tacoman * --- 29m tacoman@99.184.81.134
WarKnight * --- 29m WK1@StormKnight.users.undernet.org
zx|hashing * --- 29m ~zxorph@140M41.oasis.mediatti.net
GOATBOY * --- 29m ghost@cpe-70-112-54-19.austin.res.rr.com
@JacklynAnn * --- 29m JacklynAnn@cpe-76-183-121-218.tx.res.rr.com
zonker * --- 29m ebf@thirdshift.org
darvawrk * --- 29m ~jenn@ng1.cptxoffice.net
teri * --- 29m ~doodlebug@teri.users.undernet.org
MytiMouth * --- 29m ~MytiMouth@user-105n5gv.cable.mindspring.com
+Trey * --- 29m bacchus@pool-173-74-225-16.dllstx.fios.verizon.net
vlaad-sc440 * --- 29m vlaad@99-13-214-109.lightspeed.hstntx.sbcglobal.net
Pyro-VM * --- 16m ~pyro1rob@pyro1rob.users.undernet.org
Area-51 * --- 29m ~jamie@nelroshennie.users.undernet.org
sa * --- 29m ~zitz@99-153-75-18.lightspeed.austtx.sbcglobal.net
@`Jadey` * --- 29m jade@10.0.0.50
@X * --- 18m cservice@undernet.org
Tr|p * 09:43 ~trip@99.8.37.246
GreyBeer`D * 09:43 ~bnkjw@cpe-72-183-249-172.satx.res.rr.com
End of channel info.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Ahh, I see the issue now. Seems I swapped two arguments in the binding..
Alter the bind command to read as follows, and reload:

Code: Select all

bind msgm - * msgmDoBan
NML_375
s
scooterh
Voice
Posts: 12
Joined: Fri May 01, 2009 10:32 pm

Post by scooterh »

Great thanks chief that did the trick.

Now how does one unban them as if i use X or myself the bot rebans this as they have thier own DB it seems
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

You'd use the .bans and .-ban dcc chat commands to manage the internal banlist within your eggdrop.
NML_375
s
scooterh
Voice
Posts: 12
Joined: Fri May 01, 2009 10:32 pm

Post by scooterh »

thank you for your time and help
Post Reply