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 

Netsplit - bind rejn

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
deadite66
Halfop


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Fri Sep 23, 2005 11:36 pm    Post subject: Netsplit - bind rejn Reply with quote

trying to write a topic resync script, as it's hard to test it unless a netsplit happens i'd like someones opinion.
would this work?

Code:
# check for netsplit rejoin then reset topic after 30 minutes
bind rejn - * netsplit:topicpop
proc netsplit:topicpop {nick host handle channel} {
if { $channel == "#moonunittesting"} {
puthelp "PRIVMSG MoonUnit : netsplit rejoin triggered"
timer 30 { set TOTF "./TOTopicfile.txt"
 set TOfile [open $TOTF "r"]
 fconfigure $TOfile -encoding binary
 set oldtopic [read -nonewline $TOfile]
if {[botisop #moonunittesting]} {
 putserv "TOPIC #moonunittesting :Resyncing topic.."
 putserv "TOPIC #moonunittesting :$oldtopic"
   }
 close $TOfile
}}}


EDIT. hmm just had a thought that multiple rejoins would lilkely annoy the script, but appart from that bit would it work?
Back to top
View user's profile Send private message
deadite66
Halfop


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Sat Sep 24, 2005 12:58 am    Post subject: Reply with quote

i think this kind of switch could get me out of the script reseting the topic on every rejoin

Code:
set allowrun 1

bind time - * time:tester
proc time:tester {m h d mo y} {
global allowrun
puthelp "PRIVMSG MoonUnit : $allowrun"
if {$allowrun == 1} {
puthelp "PRIVMSG MoonUnit : - message -"
set allowrun 0
timer 5 {set allowrun 1}
}}


test run:
(05:50:00) (moontesting) 1
(05:50:02) (moontesting) - message -
(05:51:00) (moontesting) 0
(05:52:00) (moontesting) 0
(05:53:00) (moontesting) 0
(05:54:00) (moontesting) 0
(05:55:00) (moontesting) 1
(05:55:02) (moontesting) - message -


EDIT. moved the timer other wise if would keep creating a new timer every minute.


Last edited by deadite66 on Sat Sep 24, 2005 2:38 am; edited 1 time in total
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sat Sep 24, 2005 1:33 am    Post subject: Reply with quote

what does "topic resync" mean to you exactly? you want the bot bouncing a topic set by server on rejoin? (bouncing = setting back old topic)
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
deadite66
Halfop


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Sat Sep 24, 2005 2:31 am    Post subject: Reply with quote

some servers on a netsplit loose the topic and some of the channel user keep asking where the topic is.
so i wanted to detect ppl rejoining from a netsplit then set the topic which should set the topic accross all the servers
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sat Sep 24, 2005 3:38 am    Post subject: Reply with quote

but topic will be lost only if there are no channel users on the server that splits (in which case the channel will be recreated on network rejoin), and on that server only; therefore, you won't even know when it rejoins (since there are no users on that server, or they have joined during the split - either way, [bind rejn] won't be triggered), unless you track LINKS periodically (on Undernet even that won't work)
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
deadite66
Halfop


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Sat Sep 24, 2005 3:56 am    Post subject: Reply with quote

i only know that topics are lost on some servers after netsplits on quakenet

is there another bind that could do it?

the split
[16:53] anircuser (~grep@xxxxxxxxxxxxxx.xx) got netsplit.

i was trying to catch this message
[16:56] anircuser (~grep@xxxxxxxxxxxxxxx.xx) returned to #moonunittesting.

.
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sat Sep 24, 2005 4:14 am    Post subject: Reply with quote

deadite66 wrote:
i only know that topics are lost on some servers after netsplits on quakenet

is there another bind that could do it?

the split
[16:53] anircuser (~grep@xxxxxxxxxxxxxx.xx) got netsplit.

i was trying to catch this message
[16:56] anircuser (~grep@xxxxxxxxxxxxxxx.xx) returned to #moonunittesting.

.


did you understand my point?

anircuser will NOT lose topic
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
deadite66
Halfop


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Sat Sep 24, 2005 4:21 am    Post subject: Reply with quote

i don't know how but it does dissapear.

from the nonamescript faq
http://www.nnscript.de/faq.php
Quote:
Why don't I see the topics on some/all channels?
A: While many users think that this is a problem of the script they're using, it is most often caused by netsplits on the IRC network itself. If you don't see a topic, try to connect to a different server of the same network or ask a channel operator to reset the topic. It's not a NoNameScript problem!


nonamescript is primarily written for quakenet i believe, maybe its a unique quakenet problem.
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sat Sep 24, 2005 4:44 am    Post subject: Reply with quote

deadite66 wrote:
i don't know how but it does dissapear.


the topic CANNOT disappear while there are users on the channel, even a single user. Period.

and if there are no users, there's no bind to be triggered on network rejoin, and the bot can't know if there's no topic on the rejoining server, since it even doesn't know when that server rejoins!

also, if a user has joined on the split side, on network rejoin he/she will trigger [bind join], not [bind rejn], i.e. you (or rather your bot) have no way of knowing about network rejoin - that is, unless you implement some network structure tracking in real time, using LINKS command

do you know what I'm saying?

essentially, what I'm saying is: you can always reset the topic on [bind rejn], but that would work only if you've had channel users who have splitted (but they won't lose topic anyway!); if not, it won't work, and anyone who has joined on the split or thereafter on that server will see no topic
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
deadite66
Halfop


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Sat Sep 24, 2005 11:33 am    Post subject: Reply with quote

ok i'll bow to your superior wisdom on this.

i suppose an alternative is to have a public !topic command to reset it when needed.
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Sat Sep 24, 2005 2:09 pm    Post subject: Reply with quote

another idea might be to sync the topic hourly.

I perosnally use an script that triggers a reset chan 5min after a rejn, so it hopefully waits until the rejoin is over and syncs the user hosts etc.
_________________
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
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive 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