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 

script to auto-send WHO for channel sync after join

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
3rdBAR
Voice


Joined: 15 May 2006
Posts: 15

PostPosted: Mon May 15, 2006 7:03 am    Post subject: script to auto-send WHO for channel sync after join Reply with quote

I have a need for my bot to issue WHO <channel name> for each channel it joins upon connection. The bot is running through psyBNC and it often loses sync on a few channels after reconnecting. Whenever I issue .dump who #channel it always resyncs for the given channel. I'd like to make this automatic if possible.

I've searched the tcl archives as well as this forum for a small script that will do this but have not been able to find one. If someone can provide such a script I'd be gateful.

TIA
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Mon May 15, 2006 8:23 am    Post subject: Reply with quote

If you can run psybnc 24/7 then why not an eggdrop?
Back to top
View user's profile Send private message
3rdBAR
Voice


Joined: 15 May 2006
Posts: 15

PostPosted: Mon May 15, 2006 9:57 am    Post subject: Reply with quote

MeTroiD wrote:
If you can run psybnc 24/7 then why not an eggdrop?


Because it's a relay bot running locally and linked to other relay bots running on the same box. There is less lag of the relay echos that way.

Can you help with a script that will achieve the automatic WHO operations for my channels?
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Mon May 15, 2006 10:29 am    Post subject: Reply with quote

well, actually the bot already sends a WHO request on each join. All you can use is used some kind of timed WHO.

I myself found it usefull to use this script:

Code:
bind rejn - "*" resync:s
bind time - "59 *" resync:t

proc resync:s {nick uhost hand chan} {
   if {[matchattr chanserv "|l" $chan] && ![info exists ::resync($chan)] || !$::resync($chan)} {
      set ::resync($chan) 1
      utimer 30 [list resync:reset $chan]
   }
   return 0
}

proc resync:t {min h d m y} {
   set timer 5
   foreach chan [channels] {
      if { ![info exists ::resync($chan)] || !$::resync($chan) } {
         set ::resync($chan) 1
         utimer $timer [list resync:reset $chan]
         incr timer 5
      }
   }
   return 0
}

proc resync:reset {chan} {
   resetchan $chan
   set ::resync($chan) 0
   return 0
}

you might not have a user named "chanserv", delete the matchattr in that case. It simply resets one channel each 5 secs every 1h and on rejoin of a netsplit. I made this not because I use psybnc, but because of masked hosts from hostserv which need nickserv auth Very Happy.
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
3rdBAR
Voice


Joined: 15 May 2006
Posts: 15

PostPosted: Mon May 15, 2006 10:43 am    Post subject: Reply with quote

De Kus wrote:
well, actually the bot already sends a WHO request on each join. All you can use is used some kind of timed WHO.

I myself found it usefull to use this script:

Code:
blah

you might not have a user named "chanserv", delete the matchattr in that case. It simply resets one channel each 5 secs every 1h and on rejoin of a netsplit. I made this not because I use psybnc, but because of masked hosts from hostserv which need nickserv auth Very Happy.


Thanks. I'll give it a try Very Happy
Back to top
View user's profile Send private message
3rdBAR
Voice


Joined: 15 May 2006
Posts: 15

PostPosted: Mon May 15, 2006 1:28 pm    Post subject: Reply with quote

De Kus wrote:
you might not have a user named "chanserv", delete the matchattr in that case. It simply resets one channel each 5 secs every 1h and on rejoin of a netsplit. I made this not because I use psybnc, but because of masked hosts from hostserv which need nickserv auth Very Happy.


Hmm, I took out the 'matchattr chanserv' part and it loads fine but doesn't seem to be working. The bot is in 8 channels and all but 2 are showing "(pending)" status. That's the same kind of result I had before calling this script into play. Any ideas?
Back to top
View user's profile Send private message
3rdBAR
Voice


Joined: 15 May 2006
Posts: 15

PostPosted: Wed May 17, 2006 12:32 pm    Post subject: Reply with quote

Greetings scripting gurus,

I still haven't found a solution to my egg/psy issue Sad I've tried a few things with the code that De Kus so kindly provided. I tried removing this part completely:

Code:
[matchattr chanserv "|l" $chan] &&


which unfortunately made no difference.

I then added it back and tried changing the chanserv to a handle that actually exists and is in the bot's user record and is connected to the IRC network. That didn't work either. In case you're wondering, I always confirm the script changes and rehash after each test mod is added. But these changes never cause the channels showing 'pending' status to sync. The channels always return in the same state, either after a server change by the eggdrop or a disconnect/reconnect from the IRC server by psyBNC.

I DID have a bit of luck with simple server JOIN script lines in psyBNC, but loading the ones that work results in zombied processes on the shell. I'd really like to be able to somehow do a timed resync of all of my channels with a tcl running on the eggdrop. If there were only a script that would duplicate the effect of an on-connect and periodic .dump WHO #channel for each channel that the bot auto-joins, it would make things so much nicer. I've searched this forum and others as well as the web for an answer with no luck.

Does anyone have further ideas?

Thanks


Last edited by 3rdBAR on Thu May 18, 2006 1:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Thu May 18, 2006 6:00 am    Post subject: Reply with quote

does a manual ".tcl resetchan #chan" solve current issues? Please check also raw logging of your bot.
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
3rdBAR
Voice


Joined: 15 May 2006
Posts: 15

PostPosted: Thu May 18, 2006 10:18 am    Post subject: Reply with quote

De Kus wrote:
does a manual ".tcl resetchan #chan" solve current issues? Please check also raw logging of your bot.


Thanks for the response.

.tcl resetchan #chan renders a What? You need '.help', despite that unbind dcc n tcl *dcc:tcl is commented out in the conf file. I'm not sure why it doesn't work; I probably failed to set some other directive properly.

I checked raw log activity occurrence after issuing .jump (note: the psyBNC IP:port is the only server in the bot's server list). What I found is that raw 352 only appears for 2 channels out of my 8. This seems consistent with the failed sync matter in that these 2 channels are the ones that usually always sync properly, whereas the other 6 never seem to sync upon connect. Raw 353 returns for all 8 channels though. Would other information from the output be helpful? If I post the raw log data here I'll have to first do a search & replace for certain items. But please let me know if it would be helpful and I'll do it.
Back to top
View user's profile Send private message
3rdBAR
Voice


Joined: 15 May 2006
Posts: 15

PostPosted: Thu May 18, 2006 10:43 am    Post subject: Reply with quote

One other observation from the raw data: Each WHO #channel sent automatically after connect is prefixed with [!m]... whereas when I manually issue .dump who #channel (which is always successful) the log shows my request prefixed with [!s]. Also, the 2 successful automatic WHO requests upon connect are prefixed with [m=>] with no channel indicated after this. But the correct sync data is returned for both respective channels in response to each [m=>] WHO
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Fri May 19, 2006 7:58 pm    Post subject: Reply with quote

!s = server queue
!m = mode queue
guess what !h is Smile
! is adding for queue, while -> is actually flushing.

About the .tcl thing... maybe you should read the stickings: http://forum.egghelp.org/viewtopic.php?t=10215
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
3rdBAR
Voice


Joined: 15 May 2006
Posts: 15

PostPosted: Sat May 20, 2006 1:07 am    Post subject: Reply with quote

De Kus wrote:

About the .tcl thing... maybe you should read the stickings: http://forum.egghelp.org/viewtopic.php?t=10215


The instructions in the sticky you've cited are exactly what I'd done. To wit: I commented unbind dcc n tcl *dcc:tcl and unbind dcc n set *dcc:set, saved the file, and restarted the bot. I even did it again to make sure I didn't miss any of these simple steps, but experienced the same result . The result being that neither the .set nor the .tcl commands do anything except generate the response What? You need .help.

As for my request for correct scripting to resolve the sync issue, it's easy to see that for whatever reason this is a problem without a known solution. I can see that it may help tcl script experts to know exactly what the bot and the IRC server are doing (and not doing) before fashioning a script to remedy a problem. However, I was merely hoping that someone with good tcl experience would know exactly how to make a simple script that would send time-delayed WHO $chan requests for each active channel the bot has joined. Apparently it's not as easy as this.

Thanks anyway.
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 -> Script Requests 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