Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Tcl by Statium ( 15 years ago )
#####################################################################################
# #
# .::[ The Russian Official Source Portal Of EggDrop ]::. #
# ____ __ #
# / __/___ _ ___ _ ___/ /____ ___ ___ ____ __ __ #
# / _/ / _ `// _ `// _ // __// _ \ / _ \ / __// // / #
# /___/ \_, / \_, / \_,_//_/ \___// .__/ __ /_/ \___/ #
# /___/ /___/ /_/ /_/ #
# #
# #
#####################################################################################
## claim scripts
# Скрипт заявки.
# Текущая версия
set claim(ver) "1.0"
# Авторы
set claim(authors) "Suriel and hunt"
# Для того, чтобы отключить скрипт на определенном канале нужно
# в partyline боту подать команду .chanset #channel +nopubclaim
setudef flag nopubclaim
bind pub -|- !+заявка claim
bind pub mn|mn !-заявка delclaim
bind pub mn|mn !читать read
proc claim { nick uhost hand chan text } {
if {![file exists "/home/users/s/t/a/statium/eggdrop/scripts/claim.txt"]} {
::egglib::writedata "/home/users/s/t/a/statium/eggdrop/scripts/claim.txt" ""
}
set data [::egglib::readdata "/home/users/s/t/a/statium/eggdrop/scripts/claim.txt"]
if {[llength $text]!=2} {
putserv "privmsg $chan :Используйте: !+заявка #название_канала <постоянная средняя посещаемость>"
return
}
set channel [lindex $text 0]
set attendance [lindex $text 1]
set founder $nick
if { $channel == ""} { ::egglib::out $nick $chan "вы не указали канал."
return
}
if { $attendance == ""} { ::egglib::out $nick $chan "вы не указали постоянную среднюю посещаемость."
return
}
if { [regexp \[^0-9\] $attendance] } { ::egglib::out $nick $chan "посещаемость нужно указывать цифрами."; return }
set data2 [::egglib::readdata "/home/users/s/t/a/statium/eggdrop/scripts/claim.txt"]
foreach a $data2 {
if {[lindex $a 0] == "$channel"} { ::egglib::out $nick $chan "Заявка на канал \002$channel\002 уже существует... ^\\m/^"
return
}
}
set all "$channel $attendance $founder"
set data [linsert $data end $all]
::egglib::writedata "/home/users/s/t/a/statium/eggdrop/scripts/claim.txt" $data
putserv "privmsg $chan :$nick, ваша заявка добавлена. В ближайшее время администрация рассмотрит её."
}
proc delclaim { nick uhost hand chan text } {
set data [::egglib::readdata "/home/users/s/t/a/statium/eggdrop/scripts/claim.txt"]
if {$data == ""} { putserv "notice $nick :В базе нет ни одной заявки."
return
}
if {($text == "") || ([llength $data]<$text) || (![expr $text]) || ($text<1)} {
putserv "privmsg $chan :Используйте: !-заявка <номер>"
return
}
set data [lreplace $data [expr $text-1] [expr $text-1]]
::egglib::writedata "/home/users/s/t/a/statium/eggdrop/scripts/claim.txt" $data
putserv "privmsg $chan :Заявка номер $text удалена."
}
proc read { nick uhost hand chan text } {
set data [::egglib::readdata "/home/users/s/t/a/statium/eggdrop/scripts/claim.txt"]
if {$data == ""} { putserv "notice $nick :В базе нет ни одной заявки."
return
}
foreach a $data {
putserv "NOTICE $nick :Канал: [lindex $a 0] Посещаемость: [lindex $a 1] Заказал: [lindex $a 2]"}
}
putlog "claim.tcl $claim(ver) by $claim(authors) loaded."
Revise this Paste