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.

Need help with making sure nick is associated with handle

Help for those learning Tcl or writing their own scripts.
Post Reply
K
Kraka
Voice
Posts: 19
Joined: Thu Apr 21, 2005 9:25 pm

Need help with making sure nick is associated with handle

Post by Kraka »

What I am trying to accomplish is to make sure that the nick they are using to perform the !join is the handle that is on the bots so that they will get the proper flags set on the handle. the code that i am using is below...i was trying to mess around with adding in nick2hand but can not get it to work right, also saw finduser but not to sure which way i should go...any help would be great

Code: Select all

proc pub_lol_join {me host hand chan arg} {
	set arg [charfilter $arg]
	global lol botnick
	global nb_sendcmd
	set nb_control "eggie1,eggie2,eggie3"
	set chansset "+mc.protect_ops +bitch +shared -statuslog +joinpart"
	if {![check $hand $me $host]} {
		if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
            puthelp "NOTICE $me :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
		return 0
	}
	if {[llength $arg] < 1} {
		puthelp "NOTICE $me :\002Usage:\002 [string trim $lol(cmdchar)]join <chan> \[chan pass\]"
		return 0
	}
	set chan [lindex $arg 0]
	if {$chan != ""} {set chan [chanaddapt $chan]}
	set pass [lindex $arg 1]
	if {[validchan $chan]} {
		puthelp "NOTICE $me :I'm already monitoring $chan. "
		if {$pass != ""} {
			if {$lol(chankey) == 1} {
				puthelp "NOTICE $me :New pass set for $chan: $pass."
				channel set $chan need-key "chankey $chan $pass"
			} {
				puthelp "NOTICE $me :I can't memorize password to keep compatibility with getops.tcl"
			}
		}
		if {![onchan [strlwr $botnick] $chan]} {
			puthelp "NOTICE $me :I'll now try to join it."
			putserv "JOIN $chan $pass"
			return 0
		}
		puthelp "NOTICE $me :I'm already in $chan."
		return 0
	}
	channel add $chan
	tellaboutjoin $me $chan
	chattr $me |+moN $chan
	nb_sendcmd $nb_control netjoin [list $hand $chan $pass]
	channel set $chan chanmode $lol(chanmode)
	channel set $chan flood-chan $lol(chan_flood)
	channel set $chan flood-deop $lol(deop_flood)
	channel set $chan flood-kick $lol(kick_flood)
	channel set $chan flood-join $lol(join_flood)
	channel set $chan flood-ctcp $lol(ctcp_flood)
	puthelp "NOTICE $me :New chan monitoring : $chan."
    nb_sendcmd $nb_control netchanset [list $hand $chan $chansset]
	foreach param $lol(chan_parameters) { channel set $chan $param }
	if {$pass != ""} {
		if {$lol(chankey) == 1} {
			puthelp "NOTICE $me :New pass set for $chan : $pass. "
			channel set $chan need-key "chankey $chan $pass"
		} {
			puthelp "NOTICE $me :I can't memorize password to keep compatibility with getops.tcl"
		}
	}
	puthelp "NOTICE $me :$chan is now configured. I'll now try to join it."
	putserv "JOIN $chan $pass"
}
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

If it's the handle of the user saying "!join" then just use $hand to identify if the user has a valid handle. Otherwise, use [nick2hand] on the nick to identify if he/she has a valid handle.
K
Kraka
Voice
Posts: 19
Joined: Thu Apr 21, 2005 9:25 pm

Post by Kraka »

sometimes the person typing the Join command changes their nick, but they have a vaild handle on the bot and their ident is logged, so the bot will join the chan, but when it trys to chattr the handle and give them flags, if they are using a different nick, it will not give them the flags. So what I am trying to accomplish is this.

nick1 !join #dfsdfds
bot nick1 is not a registed to your ident.

becuase nick1 is actually registerd in the bots as nick. I tired to use the nick2hand but am unsure on how to incorporate it into the script. I tried variations like this:
if {nick2hand == "*" } {puthelp "NOTICE $me" "$me is not registered in the bot."}

if i can get any more help thanks.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

The nick has nothing to do with the handle. You can have a completely different handle from your nickname. I don't see why you want them to be the same, but you can simply do it like this:

Code: Select all

if {$me == $hand} {
 # nick is the same as hand
}
K
Kraka
Voice
Posts: 19
Joined: Thu Apr 21, 2005 9:25 pm

Post by Kraka »

thats what i was looking for..thanks for your help
Post Reply