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.

How do I bind to Chanserv messages?

Help for those learning Tcl or writing their own scripts.
Post Reply
A
Acadian
Voice
Posts: 1
Joined: Sun Sep 27, 2009 7:38 pm

How do I bind to Chanserv messages?

Post by Acadian »

How do you bind to messages from chanserv,

E.g. An unauthorized user enters a channel that is restricted and gets booted and banned from the channel. Chanserv bans, boots then announces it to the channel. I'm trying to pick up this announcement and remove the ban, because sometimes ops don't ident properly and then they have to wait for someone to unban them.

I tried bind pub, bind pubm, bind msgm etc.

I checked in the partyline with .bind and I can see the binds, but my proc never gets executed.

Code: Select all

bind MODE - "% +b" unban

proc unban {nick uhost hand chan mode} {
resetbans $chan
putserv "PRIVMSG $chan :Tsk tsk how dare they enter without permission"
}
Thanks
w
willyw
Revered One
Posts: 1209
Joined: Thu Jan 15, 2009 12:55 am

Re: How do I bind to Chanserv messages?

Post by willyw »

Acadian wrote: ...
I tried bind pub, bind pubm, bind msgm etc.

...
Could it be a notice?

Check out
bind notc
here: http://www.eggheads.org/support/egghtml ... mands.html


I hope this helps.
User avatar
CrazyCat
Revered One
Posts: 1334
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

No, it's a bind mode.

Wich eggdrop version are you using ? Peharps the target argument is lacking, don't you have any error in party-line (with console +d) ?
w
willyw
Revered One
Posts: 1209
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

CrazyCat wrote:No, it's a bind mode.
...
It is?
... I'm trying to pick up this announcement ...

Ok.
I was considering the above quoted when I said that.
User avatar
CrazyCat
Revered One
Posts: 1334
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

The annoucement is a client interpretation of the irc raw (or mode).
Chanserv doesn't make any notice or message when adding a ban, so an eggdrop can just catch a mode change.
w
willyw
Revered One
Posts: 1209
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

CrazyCat wrote:The annoucement is a client interpretation of the irc raw (or mode).
Chanserv doesn't make any notice or message when adding a ban, so an eggdrop can just catch a mode change.
ah... ok.
Got it.
Tnx.
w
willyw
Revered One
Posts: 1209
Joined: Thu Jan 15, 2009 12:55 am

Re: How do I bind to Chanserv messages?

Post by willyw »

Acadian wrote:
...

Code: Select all

bind MODE - "% +b" unban

proc unban {nick uhost hand chan mode} {
resetbans $chan
putserv "PRIVMSG $chan :Tsk tsk how dare they enter without permission"
}

I just tried your above code, and the problem quickly appears.

Go here:
http://www.eggheads.org/support/egghtml ... mands.html
and find:
MODE (stackable)

and read about bind mode.

See:
proc-name <nick> <user@host> <handle> <channel> <mode-change> <target>

You have the wrong number of arguments for a bind mode.

Fix that, and it works:
Chanserv bans a user that is on the akick list, immediately upon them joining. Bot makes announcement in channel, and removes the just-set ban.

I hope this helps.
User avatar
CrazyCat
Revered One
Posts: 1334
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: How do I bind to Chanserv messages?

Post by CrazyCat »

willyw wrote:See:
proc-name <nick> <user@host> <handle> <channel> <mode-change> <target>

You have the wrong number of arguments for a bind mode.
This is exactly the reason for wich I asked for the eggdrop version.
The proc syntax is right, for eggdrop less than 1.3.18. Quite old, I know :)
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Also, due to a typo, mode binds were broken completely in 1.3.17 but were fixed in 1.3.18. Mode bindings are not triggered at all in 1.3.17.
I wouldn't be surprised if he has 1.3.17. :D
Once the game is over, the king and the pawn go back in the same box.
User avatar
CrazyCat
Revered One
Posts: 1334
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Peharps he found a shell setted in 2000 :)
w
willyw
Revered One
Posts: 1209
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

CrazyCat wrote:Peharps he found a shell setted in 2000 :)
That was just yesterday....

Here's the CPU from my first shell:
http://tinyurl.com/7vf5kw2


:wink:
User avatar
CrazyCat
Revered One
Posts: 1334
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Why did I follow this link ??? :lol:

But being a little bit more serious: we often find tcl examples outdated, so before any question we (I include myself) must think "is the syntax up to date ?" and check the tcl-commands.doc
Post Reply