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.

how to start this..

Help for those learning Tcl or writing their own scripts.
Post Reply
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

how to start this..

Post by Sydneybabe »

on join whois the user if nick is registered..
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

You'll have to at least mention the network (or the server).
Once the game is over, the king and the pawn go back in the same box.
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

Oops sorry sir the network is Dalnet
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

bind join * * registered:join
bind raw - 307 registered:match
bind raw - 311 registered:first
bind raw - 318 registered:last

proc registered:join {nick uhost hand chan} {
	if {[isbotnick $nick]} return
	puthelp "WHOIS $nick"
}

proc registered:first {from key text} {
	global registered
	set user [lindex [split $text] 1]
	set registered($user) 0
}

proc registered:match {from key text} {
	global registered
	set user [lindex [split $text] 1]
	set registered($user) 1

	# user has identified for this nick
	# use $user to do whatever you need with it
}

proc registered:last {from key text} {
	global registered
	set user [lindex [split $text] 1]
	if {!$registered($user)} {

	# user didn't identified for this nick
	# use $user to do whatever you need with it
	
	}
	
	# don't remove the following line
	array unset registered $user
}
As always, I haven't tested this, but should work. If it doesn't then let me know.

Edit: fixed.
Last edited by caesar on Thu Oct 20, 2011 6:27 am, edited 1 time in total.
Once the game is over, the king and the pawn go back in the same box.
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

Hi sir caesar, how can i halt the script on netsplit since it will autovoice all registered nick that came from netsplit? Thanks in advance. :D
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

Hello sir caesar, i am encountering an error on the script this is what appear on the partyline:

Code: Select all

<eggdrop> [14:56:21] Tcl error [registered:first]: can't read "user": no such variable
<eggdrop> [14:56:21] Tcl error [registered:match]: can't read "user": no such variable
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Ah, sorry, mixed two lines and forgot to add one. Fixed the code in my previous post.
Once the game is over, the king and the pawn go back in the same box.
Post Reply