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.

Question about onchan and netsplits

Help for those learning Tcl or writing their own scripts.
Post Reply
s
silenus
Voice
Posts: 10
Joined: Sat Jan 05, 2008 12:37 pm

Question about onchan and netsplits

Post by silenus »

Does onchan see nicks which are absent due to a netsplit?

I have a trivia bot ("Bot_A" with an alternate nick "Bot_A_Backup"), and another bot ("Bot_B"), which is on the channel to do other things. Sometimes Bot_A stalls and it nice to have Bot_B force a restart. It issues a restart command when Bot_A has been silent for 3 minutes.

I do not, however, want Bot_B issuing restarts if Bot_A has disappeared due to a netsplit or for some other reason. I am using following code, but Bot B is issuing a restart during netsplits, when neither Bot_A nor Bot_A_Backup is on the channel.

If onchan is not seeing the absent nicks, then am I making some stupid error here?

Code: Select all

proc botsilent {} {
	if { [onchan "Bot_A" "#game"] || [onchan "Bot_A_Backup" "#game"] } {
		putserv "PRIVMSG #game :!trivia"
	}	
}
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

onchan does indeed "see" netsplit'd nicks. You'll have to add an additional check for split'd nicks (see the onchansplit command for this, documented in the tcl-commands.doc file accompanying your eggdrop)
NML_375
s
silenus
Voice
Posts: 10
Joined: Sat Jan 05, 2008 12:37 pm

Post by silenus »

Many thanks nml375 - I am just starting on writing these scripts - I had not noticed that command.
Post Reply