egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Event when the bot is banned from a channel?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Sun Apr 19, 2015 5:29 am    Post subject: Event when the bot is banned from a channel? Reply with quote

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 Smile
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Sun Apr 19, 2015 5:55 am    Post subject: Reply with quote

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
View user's profile Send private message
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Sun Apr 19, 2015 3:52 pm    Post subject: Reply with quote

Thanks caesar works fine. Smile
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 Smile
Back to top
View user's profile Send private message
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Sun Apr 19, 2015 11:06 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Mon Apr 20, 2015 1:11 am    Post subject: Reply with quote

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
View user's profile Send private message
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Mon Apr 20, 2015 11:00 am    Post subject: Reply with quote

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:
Quote:
!0

And:
Code:
[matchaddr $target "$::botnick![getchanhost $::botnick]"]
Return
Quote:
0


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 Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber