| View previous topic :: View next topic |
| Author |
Message |
Kraka Voice
Joined: 21 Apr 2005 Posts: 19
|
Posted: Mon Sep 29, 2008 4:58 pm Post subject: Need help with making sure nick is associated with handle |
|
|
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: |
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"
}
|
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Sep 29, 2008 6:55 pm Post subject: |
|
|
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. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Kraka Voice
Joined: 21 Apr 2005 Posts: 19
|
Posted: Mon Sep 29, 2008 8:06 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Sep 30, 2008 8:47 am Post subject: |
|
|
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: | if {$me == $hand} {
# nick is the same as hand
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Kraka Voice
Joined: 21 Apr 2005 Posts: 19
|
Posted: Tue Sep 30, 2008 5:07 pm Post subject: |
|
|
| thats what i was looking for..thanks for your help |
|
| Back to top |
|
 |
|