Trouble with a ctcp join channel script

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
mcdarby
Halfop
Posts: 69
Joined: Tue Jul 16, 2002 7:46 pm
Location: Bangor, Pennsylvania
Contact:

Trouble with a ctcp join channel script

Post by mcdarby »

I'm having a bit of trouble, I'm trying to script it so that when a ctcp from a +A global flag user is sent to the bot that is "join #channel", the bot should set -inactive for that channel and join the channel. The script I have that doesn't seem to work is currently this and I'm not sure what I'm doing wrong after I have tried a number of things.

Code: Select all

bind ctcp A|- "join-chan *" secallchan

proc secallchan {nick uhost hand dest keyword text} {
    set chantojoin [lindex $keyword 1]
    channel set $chantojoin -inactive
}
w
willyw
Revered One
Posts: 1200
Joined: Thu Jan 15, 2009 12:55 am

Re: Trouble with a ctcp join channel script

Post by willyw »

mcdarby wrote:I'm having a bit of trouble, I'm trying to script it so that when a ctcp from a +A global flag user is sent to the bot that is "join #channel",
I suspect that the ctcp command must be one word.
the bot should set -inactive for that channel and join the channel.
While you can set channel options when adding a channel, it isn't necessary if you want -inactive, as that is the default.

Experiment with this:

Code: Select all

bind ctcp A|- "JOIN" secallchan
proc secallchan {nick uhost hand dest keyword text} {
	set chantojoin [lindex [split $text] 0]
	channel add $chantojoin
}
I tested it briefly, and it worked.

You can play around with substituting in these lines, for the current
"channel add" line:

Code: Select all

	channel add $chantojoin +inactive

Code: Select all

	channel add $chantojoin -inactive
I hope this helps.

Reference:
http://www.eggheads.org/support/egghtml ... mands.html
http://www.peterre.info/characters.html
User avatar
mcdarby
Halfop
Posts: 69
Joined: Tue Jul 16, 2002 7:46 pm
Location: Bangor, Pennsylvania
Contact:

Post by mcdarby »

Okay, there is something really wrong here, I tried your script and it seems to only work when I have -|- for the bind flag. Anything else doesn't seem to work even though I have the client added to the bot with the matching hostmask. Also doesn't seem to op the client when I put +n and +a global flags to it and have client join the channel the bot is op in. I attempted to reinstall the bot in case something is wrong, but that did not appear to fix it.
w
willyw
Revered One
Posts: 1200
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

mcdarby wrote: ...
Anything else doesn't seem to work even though I have the client added to the bot with the matching hostmask. Also doesn't seem to op the client when I put +n and +a global flags to it and have client join the channel the bot is op in. I attempted to reinstall the bot in case something is wrong, but that did not appear to fix it.
I really question that the bot recognizes you.

Try this:
Join a channel that the bot is in.
In the partyline, do:
.channel #channel
and view the results. Find yourself. Examine the info... if the bot recognizes you there will be a big N just to the right of the Join time, and left of the Idle time column.

Perhaps someone else will also jump in here with ideas for you.
User avatar
mcdarby
Halfop
Posts: 69
Joined: Tue Jul 16, 2002 7:46 pm
Location: Bangor, Pennsylvania
Contact:

Post by mcdarby »

Okay, after checking a few things including .channel to see who and what is being recognized as what userfile entry, it turns out I have to question how this eggdrop is reading it. Apparently, I have an A entry after an S entry showing up in .match * and I had an AllUser entry with *!*@* for the host and had +U to three different channels. I believe the reason I have that entry is because I was using the +U flag with another tcl script to kick ban on spammy links in certain channels while exempting those on my userfile. After temporary deleting that and re-adding that, which appears to put it at the end of the .match * output, it seems to fix the recognition problem. I have to check the .conf again and sees if there is an entry in it for alphabetizing the userfile and I may have to start using ZZ- entries if it is reading the userfile from beginning to end, to try to fix any conflicts.
Post Reply