Code: Select all
bind pub o|o [string trim $lol(cmdchar)]draugas pub_lol_addfriend
bind pub o|o +friend pub_lol_addfriend
bind pub o|o [string trim $lol(cmdchar)]nedraugas pub_lol_delfriend
bind pub o|o -friend pub_lol_delfriend
### !draugas <nick> [hand]
proc pub_lol_addfriend {me b c chan arg} {
set arg [charfilter $arg]
global lol botnick
if {![check $c $me $b]} {
if {$lol(silent) == 1 || [checksilent $c]} {return 0}
puthelp "NOTICE $me :15,1DËMESIO! Tu 4privalai15,1 identifikuotis prieð naudojantis ðia komanda. Komanda: /msg 4$botnick id15,1 <slaptaþodis>."
return 0
}
if {[llength $arg] < 1} {
puthelp "NOTICE $me :15,1Sintakse:4 [string trim $lol(cmdchar)]draugas 15,1<nick> [hand]"
return 0
}
set nick [lindex $arg 0]
set alternate [lindex $arg 1]
set bot [strlwr $botnick]
set hostmask "$nick![getchanhost $nick $chan]"
set hand [nick2hand $nick $chan]
if {![onchan $nick $chan]} {
puthelp "NOTICE $me :15,1Atsipraðau, bet ash nematau4 $nick 15,1kanale4 $chan15,1."
return 0
}
if {[strlwr $nick] == $bot} {
puthelp "NOTICE $me :15,1Atsipraðau, bet að negaliu átraukti 4savæs15,1 á draugø sàraðà."
return 0
}
if {[getting-users]} {
puthelp "NOTICE $me :15,1Atsipraðau, bet ðiuo metu að esu uþsiëmæs, bandyk vëliau..."
return 0
}
if {[validuser $hand]} {
puthelp "NOTICE $me :$nick is already recognized with this hand: $hand"
} {
if {[validuser $nick] && $alternate == ""} {
puthelp "NOTICE $me :15,1Toks vartotojas:4 $nick 15,1jau egzistuoja. Naudok:4 !draugas <nickas> [hand]15,1."
return 0
}
if {$alternate != ""} {
if {[validuser $alternate]} {
puthelp "NOTICE $me :15,1Toks handas4 $alternate 15,1jau egzsituoja. Pasirink kità. Naudok:4 !draugas <nickas> [hand]15,1."
return 0
}
adduser $alternate $nick!*@*.*
#adduser $alternate [maskhost $hostmask]
#setuser $alternate hosts $nick!*@*.*
chattr $alternate +p|+fv $chan
adduser $alternate [maskhost $hostmask]
puthelp "NOTICE $me :15,1Sukurtas naujas vartotojas:4 $alternate15,1 ([maskhost $hostmask])."
puthelp "NOTICE $nick :4$nick 15,1átrauktas á 4$chan 15,1kanalo draugø sàraðà."
puthelp "NOTICE $nick :15,1Labas, tu kà tik buvai átrauktas(-a) á4 $chan15,1 kanalo draugø sàraðà. :Tu 4PRIVALAI15,1 uþsidëti slaptaþodá, komanda: /msg4 $botnick pass <tavo_slaptaþodis>15,1."
return 0
}
adduser $nick [maskhost $hostmask]
puthelp "NOTICE $me :15,1Sukurtas naujas vartotojas:4 $alternate15,1 ([maskhost $hostmask])."
puthelp "NOTICE $nick :4$nick 15,1átrauktas á 4$chan 15,1kanalo draugø sàraðà."
puthelp "NOTICE $nick :15,1Tu 4PRIVALAI15,1 uþsidëti slaptaþodá, komanda: /msg4 $botnick pass <tavo_slaptaþodis>15,1."
return 0
}
if {$alternate != ""} {
if {[validuser $alternate]} {
puthelp "NOTICE $me :The hand $alternate already exist. \002Usage:\002 !adduser <nick> <hand>"
return 0
}
adduser $alternate [maskhost $hostmask]
puthelp "NOTICE $me :New user: $alternate ([maskhost $hostmask])"
puthelp "NOTICE $nick :You have been added in $botnick userlist by $me with the hand: $alternate."
puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick PASS <your_password>\002"
return 0
}
return 0
}
### !nedraugas <nick>
proc pub_lol_delfriend {me b c chan arg} {
set arg [charfilter $arg]
global lol botnick
if {![check $c $me $b]} {
if {$lol(silent) == 1 || [checksilent $c]} {return 0}
puthelp "NOTICE $me :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
return 0
}
if {[llength $arg] != 1} {
puthelp "NOTICE $me :\002Usage:\002 [string trim $lol(cmdchar)]nedraugas <nick>"
return 0
}
set nick [lindex $arg 0]
set bot [strlwr $botnick]
set hand [nick2hand $nick $chan]
if {![onchan $nick $chan]} {
puthelp "NOTICE $me :15,1Atsipraðau, bet ash nematau4 $nick 15,1kanale4 $chan15,1."
return 0
}
if {[strlwr $nick] == $bot} {
puthelp "NOTICE $me :Yeah right, like I'm going to let you delete ME!"
return 0
}
if {[getting-users]} {
puthelp "NOTICE $me :Sorry, but I'm transferring the userfile, try later."
return 0
}
if {[matchattr $hand n]} {
puthelp "NOTICE $me :You can't delete a bot owner."
return 0
}
chattr $hand -p|-fv $chan
-user $hand $chan
boot $hand "You have been deleted"
puthelp "NOTICE $me :4$nick 15,1ka tik buvo 4ištrintas15,1 iš kanalo draugu sarašo."
puthelp "NOTICE $nick :15,1Tu katik buvai 4ištrintas15,1 iš kanalo draugu sarašo."
if {[botisop $chan]} {pushmode $chan -o $nick}
return 0
}