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.

botonchan and channel add problems

Old posts that have not been replied to for several years.
Locked
B
Black Byte

botonchan and channel add problems

Post by Black Byte »

Hi

I've some Problem getting the testpart of my script working.
(I know the script isn't very nice and all - I'm just testing, before getting it all together and cleaning)

The problem is, botonchan always gives false though the bot is definitly on the chan and has op (set by chanserv - the bot is registered by NickServ)

my joining of channels:

Code: Select all

           
  ...                                                                     
  puthelp "PRIVMSG $channel :Ich geh nach $text"
  channel add $text
  ...
(started by a bind)

and after that i'm testing, if he's on:

Code: Select all

proc pub:op:test { nick user hand chan arg } {
  global channel botnick
                                                                                
  set dchan [channame2dname $chan]
  resetchan "$chan"
                                                                                
  if {![hlp:user $nick]} {
     puthelp "PRIVMSG $chan :Leider kenn ich dich nicht !"
     return 1
  }
                                                                                
  if { [onchan $botnick $chan] } {
    puthelp "PRIVMSG $chan : hm hm - so scheints zu gehen !"
  } else {
    puthelp "PRIVMSG $chan : wenigstens geht garnichts !"
  }
  if { [botonchan [string tolower $dchan]] } {
    puthelp "PRIVMSG $chan : ich bin da !"
  } else {
    puthelp "PRIVMSG $chan : Haehm - hier ist definitv was nicht richtig ! ($chan - $dchan)"
  }
...
the command always goes to the second branch

with dcc .status i get:

Code: Select all

Tcl library: /usr/lib/tcl8.3
Tcl version: 8.3.3 (header version 8.3.3)
   Channels: #Drizzit (trying), #cb-tempel (trying)
    Online as: Woelfchen!~eggdrop@eu-irc-19999F9C.dip.t-dialin.net (/msg Woelfchen hello)
    Server irc.swissirc.net:6667 (connected for 01:18)
    #Drizzit  : (pending), enforcing "+ltn 5"  (greet, bitch)
    #cb-tempel: (pending), enforcing "+tn"  (greet)
in the temp *.chan file the status of both chans is -inactive

I think the problem lies somewhere in the (trying) but I can't figure out how to solve it, or where I'm wrong

Please help !! - I'm stuck !
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

resetchan makes eggdrop just forget the old channel data and do a 'WHO #chan' to refresh its memory :P
<user> .tcl putlog "Before: [onchan user #tcl]"; resetchan #tcl; putlog "After: [onchan user #tcl]"
<tclsh> Before: 1
<tclsh> After: 0
The WHO message is not sent (and no answer would be recieved and parsed if it were) untill the proc returns, so you'll have to return and wait for the "END OF WHO" message from the server if you insist on calling resetchan :)
Have you ever read "The Manual"?
B
Black Byte

Post by Black Byte »

The resetchan is just one of the things, I tried to get the botonchan working.
As I understood it, I won't need it.

The main Problem, as fare as I can see, is that the bot is always trying to get on the channel, but never quite succeed. By the way sometimes it seems to work. I got a positive answer once in a while. But mostly only after I restarted the bot.

Hmm - as I think of it, may there be a problem, if I rehash the bot, that he looses his channel information?

But I will test the whole thing without the resetchan again.

EDIT:
I tried it without the resetchan - it worked once (after rehash) - but then never again - not even after restart or a resetchan in another proc.

The bot is always trying to get on the damned channels but never quite succeed. %@!&
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Black Byte wrote:The bot is always trying to get on the damned channels but never quite succeed. %@!&
when/how is pub:op:test called?
Have you ever read "The Manual"?
Locked