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.

Trying to get need-op to send message

Old posts that have not been replied to for several years.
Locked
t
tabaxi

Post by tabaxi »

I must be lame, I'm trying to get my bot to send a message to another channel when it needs op and it isn't working. I did the following:

.chanset #channel need-op putserv "PRIVMSG #channel2 :!opnow"

I don't get any errors but I never see the !opnow message in #channel2. What the hell am I doing wrong.
m
masskilla
Op
Posts: 172
Joined: Wed Oct 03, 2001 8:00 pm
Location: Croatia

Post by masskilla »

Hi

Is the bot on that other channel? If not, does the channel have +n mode? If it's so, you can't message it from outside.


MaSsKilla

#eggdrop
Undernet
P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

he's using 1.6.9 or 1.6.10 where someone broke need-op
m
masskilla
Op
Posts: 172
Joined: Wed Oct 03, 2001 8:00 pm
Location: Croatia

Post by masskilla »


I just tested it in 1.6.10, works fine.


MaSsKilla

#eggdrop
Undernet
P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

hmm, didnt when i last tested. maybe its an os/tcl library specfic problem
m
masskilla
Op
Posts: 172
Joined: Wed Oct 03, 2001 8:00 pm
Location: Croatia

Post by masskilla »

Could be, only thing I changed was that I used puthelp instead of putserv.
But putserv works just fine too.


_________________
MaSsKilla

#eggdrop
Undernet

<font size=-1>[ This Message was edited by: masskilla on 2002-05-16 02:19 ]</font>
h
hero

Post by hero »

Hi,

Most of the need-* functions (key, unban, limit, invite) are broken in 1.6.10, there's some new code inserted in them:

from src/mod/irc.mod/chan.c:

chan = findchan(chname);
if (!chan)
return 0;

This code has been added right before the tcl in the need-* settings is executed. First of all, chan is already correctly set, so this code is totally unnecessary. Secondly, it's also wrong, since the bot is not in the channel when it's requesting the key or limit. Thus findchan won't see it, findchan_by_dname would have to be used.

Also, need-op seems to function normally.

-stu.
g
guppy
eggdrop engineer
Posts: 199
Joined: Mon Sep 24, 2001 8:00 pm
Location: Canada
Contact:

Post by guppy »

Do you even know what findchan and findchan_by_dname do? Sure doesn't sound like you do -- findchan doesn't care if the bot is on or off the channel, it does care though if the bot knows about the channel. That type of code was added to prevent the bot from crashing when people remove a channel via a bind.
h
hero

Post by hero »

You're right, I didn't investigate the differences between findchan and findchan_by_dname precisely. I made up my mind based on the comment in the proc from which I got that snip of code:

/* We use dname because name is first set on JOIN and we might not
* have joined the channel yet.
*/

So, if findchan_by_dname was used for a reason up above, stands to reason it should be used again since the bot is still in the same state. And again, this code is completely unnecessary since chan is already set and verified:

chan = findchan_by_dname(chname);
if (chan) {
<snip>
} else
putlog(LOG_JOIN, chname, IRC_BADCHANKEY, chname);
return 0;
}

If the code mentioned in my first post is removed need-key et al work again. Whether or not findchan would work as well as findchan_by_dname I didn't test, but at the very least, findchan is used improperly since the variable chname is set with "!channel" for use by findchan_by_dname only.

It's all moot really, the code shouldn't even exist there.

-stu.
g
guppy
eggdrop engineer
Posts: 199
Joined: Mon Sep 24, 2001 8:00 pm
Location: Canada
Contact:

Post by guppy »

The code is there to prevent the commands from crashing if the channel is removed ..

i.e..

bind join - * blah
proc blah {nick uhost hand chan} {
channel remove $chan
}

use to make the bot crash ..

I'll look at fixing need-* (need-op seems to work) sometime soon.

Locked