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.

Netsplit - bind rejn

Old posts that have not been replied to for several years.
Locked
d
deadite66
Halfop
Posts: 74
Joined: Mon May 30, 2005 2:49 am
Location: Great Yarmouth, UK

Netsplit - bind rejn

Post by deadite66 »

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: Select all

# 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?
d
deadite66
Halfop
Posts: 74
Joined: Mon May 30, 2005 2:49 am
Location: Great Yarmouth, UK

Post by deadite66 »

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

Code: Select all

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.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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: Select all

 tag when posting logs, code
d
deadite66
Halfop
Posts: 74
Joined: Mon May 30, 2005 2:49 am
Location: Great Yarmouth, UK

Post by deadite66 »

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
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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: Select all

 tag when posting logs, code
d
deadite66
Halfop
Posts: 74
Joined: Mon May 30, 2005 2:49 am
Location: Great Yarmouth, UK

Post by deadite66 »

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.

.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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: Select all

 tag when posting logs, code
d
deadite66
Halfop
Posts: 74
Joined: Mon May 30, 2005 2:49 am
Location: Great Yarmouth, UK

Post by deadite66 »

i don't know how but it does dissapear.

from the nonamescript faq
http://www.nnscript.de/faq.php
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.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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: Select all

 tag when posting logs, code
d
deadite66
Halfop
Posts: 74
Joined: Mon May 30, 2005 2:49 am
Location: Great Yarmouth, UK

Post by deadite66 »

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.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

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...
Locked