mIRC Homepage
Posted By: CreazioN netsplit thingie for a bot - 17/03/05 09:31 AM
hmm, well.. i want to do.. when a netsplit comes it fetch one/more names into a speciel var, and when they come back it unset/delete the var.. so i have a %var under the whole netsplit so i can do different things. I would be glad if someone would help me out.

thanks
Posted By: NeUtRoN_StaR Re: netsplit thingie for a bot - 17/03/05 10:25 AM
fetch a few names
could you be more specific
what will this be used for
Posted By: CreazioN Re: netsplit thingie for a bot - 17/03/05 10:34 AM
Quote:
fetch a few names
could you be more specific
what will this be used for


well, normaly i have something that check if more than 4 users join very fast and so.. but they will do that when then come back fomr the netsplit.. i need something to avoid that
Posted By: Armada Re: netsplit thingie for a bot - 17/03/05 11:11 AM
well most ircd's and networks prefix quits with Quit: so a netsplit wont have that. So you should check quit messages for something like
on *:quit: { if (*.*.* isin $1) && (*.*.* isin $2) { do stuff } }
Posted By: CreazioN Re: netsplit thingie for a bot - 17/03/05 12:08 PM
Quote:
well most ircd's and networks prefix quits with Quit: so a netsplit wont have that. So you should check quit messages for something like
on *:quit: { if (*.*.* isin $1) && (*.*.* isin $2) { do stuff } }


ah, but im really still lost how i can make it
Posted By: Armada Re: netsplit thingie for a bot - 17/03/05 01:29 PM
whoops forgot you would want to check if Quit: isnt in that also
Posted By: Relinsquish Re: netsplit thingie for a bot - 17/03/05 02:10 PM
When you are using wildcards, the proper function is iswm not isin. Try something like this:

Code:
on *:QUIT: {
  if (!$3) && ($wildtok($1-,*.*.*,0,32) == 2) {
    set $+(%,netsplit.,$network) $addtok($($+(%,netsplit.,$network),2),$nick,32)
  }
}
on *:JOIN:#: {
  if ($istok($+(%,netsplit.,$network),$nick,32)) {
    set $+(%,netsplit.,$network) $remtok($($+(%,netsplit.,$network),2),$nick,1,32)
  }
}

Note that there is no way of telling when the servers are connected back together. The on JOIN event searches for their nickname but users can easily change them during the netsplit.
Posted By: CreazioN Re: netsplit thingie for a bot - 18/03/05 12:10 PM
ossent that try to take all nicks? i just want some simple to say if there still is netsplit
Posted By: Relinsquish Re: netsplit thingie for a bot - 18/03/05 03:16 PM
I can't guarantee for complete accuracy but try this:

Code:
on *:QUIT: {
  if (!$3) && ($wildtok($1-,*.*.*,0,32) == 2) {
    set $+(%,netsplit.,$network) $addtok($($+(%,netsplit.,$network),2),$nick,32)
    if ($numtok($($+(%,netsplit.,$network),32) == 1) {
      amsg There is a netsplit detected between $1 and $2
    }
  }
}
on *:JOIN:#: {
  if ($istok($+(%,netsplit.,$network),$nick,32)) {
    unset $+(%,netsplit.,$network) $remtok($($+(%,netsplit.,$network),2),$nick,1,32)
    amsg There is no longer a netsplit.
  }
}
Posted By: YBNORML Re: netsplit thingie for a bot - 18/03/05 03:43 PM
i didn't realize netsplits still happen, i thought that was a thing from MSN years ago


<33 irc.msn.com:6667 I miss you


~YB
© mIRC Discussion Forums