| View previous topic :: View next topic |
| Author |
Message |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Wed Mar 22, 2017 12:01 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Wed Mar 22, 2017 7:50 pm Post subject: |
|
|
| 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 ! |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Thu Apr 27, 2017 9:11 am Post subject: |
|
|
i came up with this:
| Code: | 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 |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu Apr 27, 2017 11:39 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Thu Apr 27, 2017 5:39 pm Post subject: |
|
|
came up with this:
| Code: | 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 |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Apr 28, 2017 12:41 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Fri Apr 28, 2017 7:43 am Post subject: |
|
|
ok did that tested on dalnet and on my own network got this response:
| Quote: | | :nick!user@host INVITE nick :#channel |
|
|
| Back to top |
|
 |
Arnold_X-P Master

Joined: 30 Oct 2006 Posts: 221 Location: DALnet - Trinidad - Beni - Bolivia
|
Posted: Fri Apr 28, 2017 11:59 pm Post subject: |
|
|
try with
| Code: |
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"
} } |
_________________
thanks to that they help, that others learn  |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Sat Apr 29, 2017 10:34 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Sun Apr 30, 2017 9:30 am Post subject: |
|
|
ill be using this for the moment i guess
i couldnt think of a way to make use of the foreach
| Code: | 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
}
|
|
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon May 01, 2017 6:30 am Post subject: |
|
|
Won't something simple as:
| Code: |
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. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Mon May 01, 2017 8:28 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon May 01, 2017 11:46 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Mon May 01, 2017 6:24 pm Post subject: |
|
|
| works well thx caesar nicely done |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Tue May 02, 2017 8:53 am Post subject: |
|
|
| On some networks like Dalnet it is possible to mass invite so it might be a good option to have. |
|
| Back to top |
|
 |
|