like creating a bridge in which the eggdrop by means of the command / msg bot auth <pass>
that is to say that when I should identify so / msg bot auth <pass> in bot answers me
recognized password and at the same time I joined in temporary form like proprietor
as for example:. +host Sedition! * *
he believes and add a host in the file.user for example:. +host Sedition! * *
nota. - the aggregate user is not a real proprietor the idea is that only he adds it in temporary form
that the method of adding host is only temporary, that is to say that only lasts 24 hours
and later the same eggdrop removes it that is to say the aggregate host removes example
+host Sedition! * *
save
utimer 216000-host Sedition! * *
Code: Select all
# To authenticate: /msg bot auth <pass>
#### tcl based on the Opposing code
############# code tcl ###############
bind msg auth fz:mauth
## Set Commands script logo:
set fzcom(logo) "\[\002Shrider\002\]"
proc fz:mauth {nick uhost hand arg} {
global botnick fzcom host save
+host mdrt!*@*
save
utimer 216000 -host Sedition!*@*
return 0
}
if {[set pw [lindex [split $arg] 0]] == ""} {
puthelp "NOTICE $nick :$fzcom(logo): SYNTAX: /msg $botnick auth <password>"
return 0
}
if {[passwdok $hand ""]} {
puthelp "NOTICE $nick :$fzcom(logo): You haven't set your password. Type: \[/msg $botnick pass <password>\] to set-up Your password."
return 0
}
if {[matchattr $hand Q]} {
puthelp "NOTICE $nick :$fzcom(logo): You have authenticate before, no need another authentication."
return 0
}
if {![passwdok $hand $pw]} {
puthelp "NOTICE $nick :$fzcom(logo): Authentication \002rejected\002!!, check out Your password."
return 0
}
chattr $hand +Q
puthelp "NOTICE $nick :$fzcom(logo): Authentication \002accepted\002!!, thank you for Your authentication."
putcmdlog "$fzcom(logo): <<$nick>> !$hand! Authentication."
return 0
}
bind msg pass fz:mpass
proc fz:mpass {nick uhost hand arg} {
global botnick fzcom
if {[set pw [lindex [split $arg] 0]] == ""} {
puthelp "NOTICE $nick :$fzcom(logo): SYNTAX: /msg $botnick pass <password>"
return 0
}
if {![passwdok $hand ""]} {
puthelp "NOTICE $nick :$fzcom(logo): Your password has been set before, you don't need to set it again. Simply type: \[/msg $botnick auth <password>\] to authenticate yourself."
return 0
}
setuser $hand PASS $pw
puthelp "NOTICE $nick :$fzcom(logo): Your password is now set to: \002$pw\002, remember your password for future use."
putcmdlog "$fzcom(logo): <<$nick>> !$hand! Set Password."
return 0
}
proc cmdbtype [list name [list type 3]] {
if {[scan $name {%[^!]!%[^@]@%s} nick user host]!=3} {
error "Usage: cmdbtype <nick!user@host> \[type\]"
}
if [string match {[3489]} $type] {
if [string match {*[0-9]} $host] {
set host [join [lrange [split $host .] 0 2] .].*
} elseif {[string match *.*.* $host]} {
set host *.[join [lrange [split $host .] end-1 end] .]
}
}
if [string match {[1368]} $type] {
set user *[string trimleft $user ~]
} elseif {[string match {[2479]} $type]} {
set user *
}
if [string match {[01234]} $type] {
set nick *
}
set name $nick!$user@$host
}
proc wordwrap {str {len 100} {splitChr { }}} {
set out [set cur {}]; set i 0
foreach word [split [set str][unset str] $splitChr] {
if {[incr i [string len $word]]>$len} {
lappend out [join $cur $splitChr]
set cur [list $word]
set i [string len $word]
} {
lappend cur $word
}
incr i
}
lappend out [join $cur $splitChr]
}