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.

help with public command

Old posts that have not been replied to for several years.
d
detonated
Voice
Posts: 16
Joined: Sat Mar 13, 2004 3:10 am

Post by detonated »

i changed some mistakes in the coding and its working fine now. anyways, big thank you to Expert for your help. :)

Code: Select all

set pass "[lindex $arg 1]" 
  if {$hand == "*"} { 
    putserv "privmsg $nick :You are not permitted to use my commands." 
    return 0 
should have been this:

Code: Select all

set pass "[lindex $arg 0]" 
  if {$hand == "*"} { 
    putserv "privmsg $nick :You are not permitted to use my commands." 
    return 0 
the whole coding:

Code: Select all

#Usage: /msg $botnick auth <password> 
proc auth:auth {nick uhost hand arg} { 
  global botnick 
  set found 0 
  foreach n [channels] { 
    if {[onchan $nick $n]} { 
      set found 1 
    } 
  } 
  if {$found == 0} { 
    return 0 
  } 
  if {[llength $arg] < 1} { 
    putserv "notice $nick :Usage: /msg $botnick auth <pass>" 
    return 0 
  } 
  set pass "[lindex $arg 0]" 
  if {$hand == "*"} { 
    putserv "privmsg $nick :You are not permitted to use my commands." 
    return 0 
  } 
  if {[getuser $hand XTRA AUTH] == "DEAD"} { 
    putserv "privmsg $nick :Sorry, but you have been disabled from using my commands." 
    return 0 
  } 
  if {[passwdok $hand $pass]} { 
    setuser $hand XTRA "AUTH" "1" 
    putcmdlog "<<$nick>> ($uhost) !$hand! Authenticated" 
    putserv "notice $nick :Password accepted." 
    return 0 
    } else { 
    putserv "notice $nick :Password denied." 
  } 
} 

proc auth:signcheck {nick uhost hand chan reason} { 
  if {$hand == "*"} { 
    return 0 
  } 
  set auth "[getuser $hand XTRA "AUTH"]" 
  if {($auth == "") || ($auth == "0") || ($auth == "DEAD")} { 
    return 0 
  } 
  setuser $hand XTRA "AUTH" "0" 
  putlog "Auth for $nick has been expired." 
} 

proc auth:check {hand} { 
  set auth "[getuser $hand XTRA "AUTH"]" 
  if {($auth == "") || ($auth == "0") || ($auth == "DEAD")} { 
    return 0 
    } else { 
    return 1 
  } 
} 

proc auth:deauth {nick uhost hand arg} { 
  if {[getuser $hand XTRA AUTH] == "DEAD"} { 
    putserv "privmsg $nick :Sorry, but you have been disabled from using my commands." 
    return 0 
  } 
  if {$hand != "*"} { 
    setuser $hand XTRA "AUTH" "0" 
    putlog "<<$nick>> ($uhost) !$hand! De-authenticated" 
    putserv "notice $nick :Authentication has been removed." 
  } 
}
this should work just fine now. :wink:
User avatar
Xpert
Halfop
Posts: 88
Joined: Mon Mar 08, 2004 7:03 am

Post by Xpert »

Your welcome.... :P
Xpert.
Locked