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.

kick/ban on invite

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

Wow, that's strange.

I didn't test the code, as stated, but it seemed logical to me. I did take into consideration that nicks invite nicks, not just to channels, I added the string match *#* but didn't add an else (which would have been for nick based invites).
The bots I do run are currently in an RPG, which means any restarts cause penalties, which is why I don't use them to test. I had expected the code to work, but expectations always have a way of not working out in my favor.
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

willyw wrote:
If we can get the hostmask of the inviter every time, then : Yes.

But until then, we are stuck.
Just to let anyone following this thread know:

This has been reported to the eggdrop people. Apparently, it is a bug.
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
s
simo
Revered One
Posts: 1106
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

i came up with this:

Code: Select all

bind raw - INVITE show:invite
 
proc show:invite { nick host key args } {
 global botnick si
  set nik [lindex [split $nick !] 0]
  set host [lindex [split $nick !] 1]
  set ban [lindex [split $nick @] 1]
  set text [lindex [split $key] 1 end] 
     putserv "PRIVMSG #cappuccino :INVITE SPAM by\0032 $nik \003\[$host\]: invited to $text"
}


is there a way we can make sure bot bans the inviter on all channels bot has halfOP access or above without the use of internal ban ( i like the channel ops to have the freedom to remove bans at any time ) ( and possibly kick as well if inviter is actually is in channel the eggbot has halfOP and up acces as well )


would it also be possibe to use Spikes way of setting banmasks and stacking bans and ( and kicks if inviter is in common chan )



thanx in advance


http://forum.egghelp.org/viewtopic.php?t=19955
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Two problems:
- the bind raw accepts 3 arguments and you given it 4.
- stop using arg or args as they have a special meaning in TCL, and instead use text, txt or something else to better represent the argument the proc is awaiting.

Give me an example of a raw INVITE output and will help you out with a proper code.
Once the game is over, the king and the pawn go back in the same box.
s
simo
Revered One
Posts: 1106
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

came up with this:

Code: Select all

bind raw - INVITE show:invite
 
proc show:invite { nick host key} {
 global botnick si
  set nik [lindex [split $nick !] 0]
  set host [lindex [split $nick !] 1]
  set text [lindex [split $key] 1 end]
     putserv "PRIVMSG #channel :INVITE SPAM by\0032 $nik \003\[$host\]: invited to $text"
}
what kind of an output did you mean ?

the message in channel seems to get hostmask everytime as well as the channel
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

On Undernet network where i tested an invite the RAW i seen was: INVITE my_name #channel.

If you have mIRC type in status window /debug @raw and a window called @raw should appear. Now ask a friend to invite you to a channel and copy/paste what you get there, maybe on your network you get something different.
Once the game is over, the king and the pawn go back in the same box.
s
simo
Revered One
Posts: 1106
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

ok did that tested on dalnet and on my own network got this response:
:nick!user@host INVITE nick :#channel
User avatar
Arnold_X-P
Master
Posts: 226
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Post by Arnold_X-P »

try with

Code: Select all

set mychansk "#cappuccino"

bind raw - INVITE show:invite
 
proc show:invite { nick key txt} {
 global mychansk
 foreach channel [split $mychansk] {
  set nik [lindex [split $nick !] 0] 
  set xhost [lindex [split $nick !] 1]
  set xtext [lindex $txt 1]
    putserv "PRIVMSG $channel :INVITE SPAM by \2$nik\2  (\2$xhost\2): invited to \2$xtext\2"
} }
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
s
simo
Revered One
Posts: 1106
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

does anyone know how to modify this to get this it to set ban ( for inviter ) on all channels the bot is opped ( and possibly kick inviter if in channel ) and i would prefer a channel ban to allow more freedom for channel ops to remove bans at any time

tnx in advance.
s
simo
Revered One
Posts: 1106
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

ill be using this for the moment i guess

i couldnt think of a way to make use of the foreach

Code: Select all

bind raw - INVITE show:invite
 
proc show:invite { nick host key } {
 global botnick si
  set nik [lindex [split $nick !] 0]
  set host [lindex [split $nick !] 1]
  set text [lindex [split $key] 1 end]
  putquick "MODE #channel1 +b *!*@[lindex [split $host @] 1]" -next
  putquick "MODE #channel2 +b *!*@[lindex [split $host @] 1]" -next
  putquick "MODE #channel3 +b *!*@[lindex [split $host @] 1]" -next
  putquick "MODE #channel4 +b *!*@[lindex [split $host @] 1]" -next
  putquick "MODE #channel5 +b *!*@[lindex [split $host @] 1]" -next
  putquick "MODE #channel6 +b *!*@[lindex [split $host @] 1]" -next
}

User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Won't something simple as:

Code: Select all

bind raw - INVITE show:invite

proc show:invite {from key txt} {
	# get the nick, user and host
	scan $from {%[^!]!%[^@]@%s} nick user host
	
	# loop all channels
	foreach chan [channels] {
		
		# if the bot is not channel operator no point into continuing
		if {![botisop $chan]} continue
		
		# if the inviter isn't on the channel continue
		if {![onchan $nick $chan]} continue
		
		# do the +b and kick?
		pushmode $chan +b "*!*@$host"
		putkick $chan $nick "Invite spam"
	}
}
do what you wanted?

I see previous comments but I don't understand where's the problem with the invite command. mind giving an example?
Once the game is over, the king and the pawn go back in the same box.
s
simo
Revered One
Posts: 1106
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

that seems to work

is it possible to have the same method of banmask like spike used in

http://forum.egghelp.org/viewtopic.php?t=19955

the stacked bans and kicks seem a good method incase a mass invite accures
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

See how works as is right now and if needed I guess we can add that, but doubt will get so many invites at the same time to make this worth adding.
Once the game is over, the king and the pawn go back in the same box.
s
simo
Revered One
Posts: 1106
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

works well thx caesar nicely done
s
simo
Revered One
Posts: 1106
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

On some networks like Dalnet it is possible to mass invite so it might be a good option to have.
Post Reply