| View previous topic :: View next topic |
| Author |
Message |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Sun Apr 19, 2015 5:29 am Post subject: Event when the bot is banned from a channel? |
|
|
I need to make a code to report when the BoT has been banned from a channel.
My idea is that the BoT report the channel, who banned and reason.
<bot> DeViL ban me in #chan1 for "do not want you on this channel".
I dont know event to trigger when the bot is banned. _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sun Apr 19, 2015 5:55 am Post subject: |
|
|
| Code: |
bind mode - "% +b" check:ban
proc check:ban {nick host hand chan mode target} {
if {![matchaddr $target $::botname]} return
# do whatever you wish as the ban mask matches bot address
}
|
The matchaddr is a eggdrop 1.6.20 function, so if you are using an older version would have to replace:
| Code: |
if {![matchaddr $target $::botname]} return
|
with:
| Code: |
if {![string match -nocase $target $::botname]} return
|
_________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Sun Apr 19, 2015 3:52 pm Post subject: |
|
|
Thanks caesar works fine.
For a KICK event would be so?
| Code: | bind kick - "% *!*@*" check:kick
proc check:kick {nick user@host hand chan target reason} {
global canal_admin
if {"$target" != $::botnick} return
putmsg $canal_admin "$nick kick me $chan $reason"
} |
It does not work that way.
EDIT:
I already fixed
| Code: | | bind kick - "*" check:kick |
_________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Sun Apr 19, 2015 11:06 pm Post subject: |
|
|
caesar have a problem with the type 2 ban.
| Quote: | | +b *!*@virtual.host.of.my.bot |
The [matchaddr $target $::botname] command return the internet company real host.
| Quote: | | mybot!botijo@anteldata.net.uy |
I need a command to return vhost bot.
See this post _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon Apr 20, 2015 1:11 am Post subject: |
|
|
The botname variable should have stored his actual nick!user@host mask and should be updated when vhost changes (I think). Apparently it doesn't so give this a try:
| Code: |
bind mode - "% +b" check:ban
proc check:ban {nick host hand chan mode target} {
global botnick
if {![matchaddr $target "$botnick![getchanhost $botnick]"]} return
# do whatever you wish as the ban mask matches bot's current vhost
}
|
_________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Mon Apr 20, 2015 11:00 am Post subject: |
|
|
| caesar wrote: | The botname variable should have stored his actual nick!user@host mask and should be updated when vhost changes (I think). Apparently it doesn't so give this a try:
| Code: |
bind mode - "% +b" check:ban
proc check:ban {nick host hand chan mode target} {
global botnick
if {![matchaddr $target "$botnick![getchanhost $botnick]"]} return
# do whatever you wish as the ban mask matches bot's current vhost
}
|
|
Not work.
| Code: | | [matchaddr $target "$botnick![getchanhost $botnick]"] |
Error: Tcl error [check:ban]: can't read "botnick": no such variable.
Return:
And:
| Code: | | [matchaddr $target "$::botnick![getchanhost $::botnick]"] | Return
Edit:format _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
|