egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need help with making sure nick is associated with handle

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Kraka
Voice


Joined: 21 Apr 2005
Posts: 19

PostPosted: Mon Sep 29, 2008 4:58 pm    Post subject: Need help with making sure nick is associated with handle Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Sep 29, 2008 6:55 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Kraka
Voice


Joined: 21 Apr 2005
Posts: 19

PostPosted: Mon Sep 29, 2008 8:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Sep 30, 2008 8:47 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Kraka
Voice


Joined: 21 Apr 2005
Posts: 19

PostPosted: Tue Sep 30, 2008 5:07 pm    Post subject: Reply with quote

thats what i was looking for..thanks for your help
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber