Can anybody help me with the script phone.tcl.
I should be quiet easy but when your are a n00b to tcl it isn't
The code is this.
Code: Select all
##################################################################
#Phone1.0.tcl By JaSonic #
#Allows users to set their phone no.s up on the bot #
#AND can be displayed to a channel ONLY if permitted by the user #
##################################################################
bind msg h phone msg:phone
bind msg h home msg:home
bind msg h mobile msg:mobile
bind msg h office msg:office
bind msg h fax msg:fax
bind msg h sms msg:smsphone
bind pub o !phone pub:phone
bind dcc n phone dcc:phone
proc msg:phone {nick uhost handle arg} {
global botnick
set pass [lindex $arg 0]
set top [lindex $arg 1]
set phone [lrange $arg 2 end]
if {$pass == ""} {
putserv "PRIVMSG $nick :To set your phone details, pls do the following"
putserv "PRIVMSG $nick :-----------------------------------------------"
putserv "PRIVMSG $nick :To set your home phone, please do:-"
putserv "PRIVMSG $nick :/msg $botnick phone <passwd> home <phone no.>"
putserv "PRIVMSG $nick :To set your mobile phone, please do:-"
putserv "PRIVMSG $nick :/msg $botnick phone <passwd> mobile <phone no.>"
putserv "PRIVMSG $nick :To set your office phone, please do:-"
putserv "PRIVMSG $nick :/msg $botnick phone <passwd> office <phone no.>"
putserv "PRIVMSG $nick :To set your fax, please do:-"
putserv "PRIVMSG $nick :/msg $botnick phone <passwd> fax <fax no.>"
putserv "PRIVMSG $nick :To set your sms address, please do:-"
putserv "PRIVMSG $nick :/msg $botnick phone <passwd> sms <address>"
putserv "PRIVMSG $nick :To see your phone settings do:-"
putserv "PRIVMSG $nick :/msg $botnick phone <passwd> me"
putserv "PRIVMSG $nick :To see a users details if they permit it:-"
putserv "PRIVMSG $nick :do !phone <handle> in chan"
putserv "PRIVMSG $nick :==============================================="
putserv "PRIVMSG $nick :All info you input is not displayed to channel "
putserv "PRIVMSG $nick :unless otherwise stated by you and you alone "
putserv "PRIVMSG $nick :further details available as you set your no.s "
return 0
} {
if {[passwdok $handle $pass]} {
if {$top == "me"} {
set home [getuser $handle XTRA HOME]
set mobile [getuser $handle XTRA MOBILE]
set office [getuser $handle XTRA OFFICE]
set fax [getuser $handle XTRA FAX]
set sms [getuser $handle XTRA SMS]
set homeyn [getuser $handle XTRA HOMEYN]
set mobileyn [getuser $handle XTRA MOBILEYN]
set officeyn [getuser $handle XTRA OFFICEYN]
set faxyn [getuser $handle XTRA FAXYN]
set smsyn [getuser $handle XTRA SMSYN]
putserv "PRIVMSG $nick :Your current phone settings are as follows"
putserv "PRIVMSG $nick :------------------------------------------"
putserv "PRIVMSG $nick :HOME: $home | Visible: $homeyn"
putserv "PRIVMSG $nick :MOBILE: $mobile | Visible: $mobileyn"
putserv "PRIVMSG $nick :OFFICE: $office | Visible: $officeyn"
putserv "PRIVMSG $nick :FAX: $fax | Visible: $faxyn"
putserv "PRIVMSG $nick :SMS: $sms | Visible: $smsyn"
} {
if {$top == "home"} {
setuser $handle XTRA HOME $phone
putserv "NOTICE $nick :Home No. set to $phone"
putserv "NOTICE $nick :To state whether people can see your home no. or not, pls type /msg $botnick home <passwd> yes/no"
set home [getuser $handle XTRA HOMEYN]
if {$home == ""} {
setuser $handle XTRA HOMEYN "no"
}
} {
if {$top == "mobile"} {
setuser $handle XTRA MOBILE $phone
putserv "NOTICE $nick :Mobile No. set to $phone"
putserv "NOTICE $nick :To state whether people can see your mobile no. or not, pls type /msg $botnick mobile <passwd> yes/no"
set mobile [getuser $handle XTRA MOBILEYN]
if {$mobile == ""} {
setuser $handle XTRA MOBILEYN "no"
}
} {
if {$top == "office"} {
setuser $handle XTRA OFFICE $phone
putserv "NOTICE $nick :Office No. set to $phone"
putserv "NOTICE $nick :To state whether people can see your office no. or not, pls type /msg $botnick office <passwd> yes/no"
set office [getuser $handle XTRA OFFICEYN]
if {$office == ""} {
setuser $handle XTRA OFFICEYN "no"
}
} {
if {$top == "fax"} {
setuser $handle XTRA FAX $phone
putserv "NOTICE $nick :Fax No. set to $phone"
putserv "NOTICE $nick :To state whether people can see your fax no. or not, pls type /msg $botnick fax <passwd> yes/no"
set fax [getuser $handle XTRA FAXYN]
if {$fax == ""} {
setuser $handle XTRA FAXYN "no"
}
} {
if {$top == "sms"} {
setuser $handle XTRA SMS $phone
putserv "NOTICE $nick :Sms address set to $phone"
putserv "NOTICE $nick :To state whether people can see your sms address or not, pls type /msg $botnick sms <passwd> yes/no"
set smsyn [getuser $handle XTRA SMSYN]
if {$smsyn == ""} {
setuser $handle XTRA SMSYN "no"
}
} {putserv "NOTICE $nick :Sorry, I dont recognise that phone type, please user either home, mobile, office, fax or sms"}
}
}
}
}
}
} {putserv "NOTICE $nick :Invalid Password"}
}
}
proc msg:home {nick uhost handle arg} {
global botnick
set pass [lindex $arg 0]
set yn [lindex $arg 1]
if {[passwdok $handle $pass]} {
if {($yn == "yes") || ($yn == "no")} {
setuser $handle XTRA HOMEYN $yn
putserv "NOTICE $nick :Allowing users to see your home phone no.: $yn"
} { putserv "NOTICE $nick :Command not performed, pls do /msg $botnick home <passwd> yes/no" }
} {putserv "NOTICE $nick :Invalid Password"}
}
proc msg:mobile {nick uhost handle arg} {
global botnick
set pass [lindex $arg 0]
set yn [lindex $arg 1]
if {[passwdok $handle $pass]} {
if {($yn == "yes") || ($yn == "no")} {
setuser $handle XTRA MOBILEYN $yn
putserv "NOTICE $nick :Allowing users to see your mobile phone no.: $yn"
} { putserv "NOTICE $nick :Command not performed, pls do /msg $botnick mobile <passwd> yes/no" }
} {putserv "NOTICE $nick :Invalid Password"}
}
proc msg:office {nick uhost handle arg} {
global botnick
set pass [lindex $arg 0]
set yn [lindex $arg 1]
if {[passwdok $handle $pass]} {
if {($yn == "yes") || ($yn == "no")} {
setuser $handle XTRA OFFICEYN $yn
putserv "NOTICE $nick :Allowing users to see your office phone no.: $yn"
} { putserv "NOTICE $nick :Command not performed, pls do /msg $botnick office <passwd> yes/no" }
} {putserv "NOTICE $nick :Invalid Password"}
}
proc msg:fax {nick uhost handle arg} {
global botnick
set pass [lindex $arg 0]
set yn [lindex $arg 1]
if {[passwdok $handle $pass]} {
if {($yn == "yes") || ($yn == "no")} {
setuser $handle XTRA FAXYN $yn
putserv "NOTICE $nick :Allowing users to see your fax phone no.: $yn"
} { putserv "NOTICE $nick :Command not performed, pls do /msg $botnick fax <passwd> yes/no" }
} {putserv "NOTICE $nick :Invalid Password"}
}
proc msg:smsphone {nick uhost handle arg} {
global botnick
set pass [lindex $arg 0]
set yn [lindex $arg 1]
if {[passwdok $handle $pass]} {
if {($yn == "yes") || ($yn == "no")} {
setuser $handle XTRA SMSYN $yn
putserv "NOTICE $nick :Allowing users to see your sms address: $yn"
} { putserv "NOTICE $nick :Command not performed, pls do /msg $botnick sms <passwd> yes/no" }
} {putserv "NOTICE $nick :Invalid Password"}
}
proc pub:phone {nick uhost handle chan arg} {
set auth [getuser $handle XTRA AUTH]
if {$auth == "0"} {
set person [lindex $arg 0]
set home [getuser $person XTRA HOME]
set mobile [getuser $person XTRA MOBILE]
set office [getuser $person XTRA OFFICE]
set fax [getuser $person XTRA FAX]
set sms [getuser $person XTRA SMS]
putserv "PRIVMSG $chan :Phone details for $person"
putserv "PRIVMSG $chan :========================="
set homeyn [getuser $person XTRA HOMEYN]
if {$homeyn == "no"} {
putserv "PRIVMSG $chan :HOME: Classified"
} {
putserv "PRIVMSG $chan :HOME: $home"
}
set mobileyn [getuser $person XTRA MOBILEYN]
if {$mobileyn == "no"} {
putserv "PRIVMSG $chan :MOBILE: Classified"
} {
putserv "PRIVMSG $chan :MOBILE: $mobile"
}
set officeyn [getuser $person XTRA OFFICEYN]
if {$officeyn == "no"} {
putserv "PRIVMSG $chan :OFFICE: Classified"
} {
putserv "PRIVMSG $chan :OFFICE: $office"
}
set faxyn [getuser $person XTRA FAXYN]
if {$faxyn == "no"} {
putserv "PRIVMSG $chan :FAX: Classified"
} {
putserv "PRIVMSG $chan :FAX: $fax"
}
set smsyn [getuser $person XTRA SMSYN]
if {$smsyn == "no"} {
putserv "PRIVMSG $chan :SMS: Classified"
} {
putserv "PRIVMSG $chan :SMS: $sms"
}
} {putserv "NOTICE $nick :you are not authorised to do that"}
}
proc dcc:phone {hand idx arg} {
set person [lindex $arg 0]
if {$person == ""} {
putdcc $idx "Usage: .phone <handle>"
return 0
}
set home [getuser $person XTRA HOME]
set homeyn [getuser $person XTRA HOMEYN]
if {$home == ""} {
putdcc $idx "$person has no home no. set"
} {
putdcc $idx "$person HOME: $home | Visible: $homeyn"
}
set mobile [getuser $person XTRA MOBILE]
set mobileyn [getuser $person XTRA MOBILEYN]
if {$mobile == ""} {
putdcc $idx "$person has no mobile no. set"
} {
putdcc $idx "$person MOBILE: $mobile | Visible: $mobileyn"
}
set office [getuser $person XTRA OFFICE]
set officeyn [getuser $person XTRA OFFICEYN]
if {$office == ""} {
putdcc $idx "$person has no office no. set"
} {
putdcc $idx "$person OFFICE: $office | Visible: $officeyn"
}
set fax [getuser $person XTRA FAX]
set faxyn [getuser $person XTRA FAXYN]
if {$fax == ""} {
putdcc $idx "$person has no fax no. set"
} {
putdcc $idx "$person FAX: $fax | Visible: $faxyn"
}
set sms [getuser $person XTRA SMS]
set smsyn [getuser $person XTRA SMSYN]
if {$sms == ""} {
putdcc $idx "$person has no sms set"
} {
putdcc $idx "$person SMS: $sms | Visible: $smsyn"
}
}
putlog "phone.tcl loaded on $botnick by JaSonic"
Code: Select all
bind pub o !phone pub:phone
Code: Select all
bind pub v|v !phone pub:phone
and this
Code: Select all
if {$auth == "0"} {
Code: Select all
if {$auth == "1"} {
I got that error message when i tried to see some of the numbers on the user.{17|19|04} -|TpE-cs|- you are not authorised to do that
But no can do....
I can add the numbers to the user with out any problems.
The help text doesn't work either...
Can anybody tell me how i do get AUTH to the phone script.
I hope some of you guys can help me.
Thanks
sQuiZZ