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 

regnick

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Fire-Fox
Master


Joined: 23 Sep 2006
Posts: 270
Location: /dev/null

PostPosted: Fri Jun 27, 2008 7:21 am    Post subject: regnick Reply with quote

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:

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
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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