###################################################################### # phonebook By Fast666 - #eggdrop irc6.eggdrop.eu # admin@hackingcode.co.cc # Version 1.0 # 03 agustus 2010 ###################################################################### bind pub - !phonebook pub:phonebook set activechan "#eggdrop" set txthope "/home/fast/allnet/scripts/phone.txt" set delay 60 set init-server { timer [expr $delay] gethope } proc pub:phonebook { nick uhost hand chan text } { global activechan set hope [lrange $text 0 end] if { $hope != "" } { if { [isvoice $nick $chan] } { savehope "13-=- $hope (by. $nick) -=-" putserv "NOTICE $nick :6$nick data telah tesimpan" } else { putserv "NOTICE $nick :anda belum memiliki voice!" } } else { putserv "PRIVMSG $nick :Format salah! Ketik !phonebook " } } proc gethope {} { global txthope activechan delay set lines [getdatafromtxt $txthope] set line [lindex $lines [rand [llength $lines]]] putserv "NOTICE $activechan :$line" putserv "NOTICE $activechan : ketik !phonebook " timer [expr $delay] gethope } proc savehope { message } { global txthope set con [open $txthope r] set data [read $con] close $con set con [open $txthope "w"] puts $con "$message" puts -nonewline $con $data close $con } proc getdatafromtxt { filepath } { set con [open $filepath r] set data [read $con] close $con set data [split $data "\n"] return $data } putlog "loaded by Fast666"