| View previous topic :: View next topic |
| Author |
Message |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Fri Sep 23, 2005 11:36 pm Post subject: Netsplit - bind rejn |
|
|
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 |
|
 |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Sat Sep 24, 2005 12:58 am Post subject: |
|
|
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 |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Sep 24, 2005 1:33 am Post subject: |
|
|
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 |
|
 |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Sat Sep 24, 2005 2:31 am Post subject: |
|
|
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 |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Sep 24, 2005 3:38 am Post subject: |
|
|
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 |
|
 |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Sat Sep 24, 2005 3:56 am Post subject: |
|
|
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 |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Sep 24, 2005 4:14 am Post subject: |
|
|
| 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 |
|
 |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Sat Sep 24, 2005 4:21 am Post subject: |
|
|
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 |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Sep 24, 2005 4:44 am Post subject: |
|
|
| 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 |
|
 |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Sat Sep 24, 2005 11:33 am Post subject: |
|
|
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 |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Sat Sep 24, 2005 2:09 pm Post subject: |
|
|
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 |
|
 |
|