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.

regnick

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
Fire-Fox
Master
Posts: 299
Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null

regnick

Post by Fire-Fox »

Hey all

how can i get the below script to do the follwing

When a user types !regnick is sendt a code, the code is then used on a external php site where the user insert the pass the bot gav a person. and then when they join the chan they vil get auto +v before they can talk in the chan

Code: Select all

bind pub "-|-" !regnick reg:user
proc reg:user {nick uhost hand channel arg} {
global db_handle error_ chan_
  
 set chan [string tolower $channel]
 if {[channel get $chan UserSearch]} { 
      
  if {[mysqlping $db_handle] != 1} { 
      putserv "PRIVMSG $chan : $error_(mysqllost)"
      return 0
  }
    
  set regpassword [md5 [random]]
  
  set sqlnick "SELECT userid, regkode FROM nicks WHERE nick='[mysqlescape $nick]'"
  set resultnick [mysqlquery $db_handle $sqlnick]
        
  set nicki 0
  while {[set record [mysqlnext $resultnick]] != ""} {
    set userid [lindex $record 0]
    incr nicki
  }
        
  if { $nicki != 0 } { 
    if { $userid == "" } { 
       set sqlnick "SELECT regkode FROM nicks WHERE nick='[mysqlescape $nick]'"
       set resultkode [mysqlquery $db_handle $sqlnick]
       while {[set record [mysqlnext $resultkode]] != ""} {
          set regkode [lindex $record 0]
       }
	              
       puthelp "NOTICE $nick : $error_(forgotpassword)"
       puthelp "NOTICE $nick : $regkode"
       return 0
    }
        
    puthelp "NOTICE $nick : $error_(userregged)" 
 }

 if { $nicki == 0 } { 
  
  
   set sqlinsert "INSERT INTO nicks VALUES ( NULL , '[mysqlescape $nick]', '[mysqlescape $regpassword]', NULL, 'englsih' )"
  
   set result [mysqlexec $db_handle $sqlinsert]
  
   puthelp "NOTICE $nick : $error_(addnick1)"
   puthelp "NOTICE $nick : $regpassword"
   puthelp "NOTICE $nick : $error_(addnick2)"
   
 }
}
}
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
Post Reply