02 Şubat 2012, 00:15
|
#13 |
Çevrimdışı
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
| Cevap: aciL tcl Lazım
Eğer sabaha kadar işlerim biterse ve uyuyakalmassam yardımcı olmaya çalışırım .selamlar
| Stroom Nickli Üyeden Alıntı
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir. |
## Request script with pointsystem by jlykkegaard@[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...].com
## This script was made for my own enjoyment, and for learning TCL!
## I dont think there exist a request script, with or without point system, thats why i decided to go public with my script!
## All the text is in danish, so unless you are from denmark translating it to english would be a good idea
## If you decide to translate it, please upload the new version to the tcl archive( we are here to help each other out, right?)
## There are probarly bugs, and the script is not good documented, so if some scripters out there feels like making it 100% correct it would be great!
## One know bug is that it is having a hard time with people with \ in their names, but that should be easy to fix
## you should replace #req in this script with your channel name
## Then add the users with !reguser
## then registered users can do !addreq
## To see the list of reqeusts, you should use a webbrowser, and connect to port 8002
## To customize my script, and make it work great some basic tcl understanding is required, i do not claim this is a perfect script!
## I just think it has potential, and someone out there could make it great!
## This Script Has Been Translated Into English By Country|Rocker Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir. )
bind pub - !request requests
bind pub - !requests requests
bind pub - !addreq addreq
bind pub - !addreg addreq
bind pub - !addrequest addreq
bind pub - !delreq delreq
bind pub - !Hjælp commands
bind pub - !setftp setftp
bind pub - !getftp getftp
bind pub - !ftp getftp
bind pub - !help commands
bind pub - !regnick regnick
bind pub - !reguser reguser
bind pub - !disablenotify disablenotify
bind pub - !enablenotify enablenotify
bind pub - !point showpoints
bind pub - !points showpoints
bind pub - !setpoint setpoints
bind pub - !setpoints setpoints
bind pub - !updatechan updatechan
bind pub - !changehandle changehandle
bind pub - !GiveAllAPoint GiveAllAPoint
bind pub - !showpoints showallpoints
bind join * * onjoin
set http(port) "8002"
set http(port2) "8003"
if {![info exists http(socket2)]} {
socket -server httpserver2 $http(port2)
set http(socket2) 1
}
if {![info exists http(socket)]} {
socket -server httpserver $http(port)
set http(socket) 1
}
proc updatechan {nick uhost hand chan arg} {
resetchan $chan
}
proc changehandle {nick uhost hand chan arg} {
chhandle [lindex $arg 0] [lindex $arg 1]
putserv "PRIVMSG $chan :Handle Changed!"
}
proc GiveAllAPoint {nick uhost hand chan arg} {
if {[matchattr [mynick2hand $nick $chan] o|o $chan]} {
set splitteddata [userlist X]
for { set number 0 } { $number < [llength $splitteddata ] } { incr number } {
set newpoint [expr [getuser [lindex $splitteddata $number] XTRA point]+1]
setuser [lindex $splitteddata $number] XTRA Point $newpoint
}
puthelp "PRIVMSG $chan Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir. one"
} else {
puthelp "PRIVMSG $chan :Forget That, Only @,! Can!"
}
}
proc setpoints {nick uhost hand chan arg} {
if {[matchattr [mynick2hand $nick $chan] o|o $chan]} {
if {([onchan [lindex $arg 0] $chan]==0) && ([validuser [lindex $arg 0]]==0) } {
putserv "PRIVMSG $chan :User Not Found!"
} else {
setuser [mynick2hand [lindex $arg 0] $chan] XTRA Point [lindex $arg 1]
putserv "PRIVMSG $chan :Point Set!"
}
} else {
putserv "PRIVMSG $chan :$nick Your Balls Aint Big Enough To Do That!"
}
}
proc showpoints {nick uhost hand chan arg} {
if {$arg==""} {
putserv "PRIVMSG $chan :You Have [getuser [mynick2hand $nick $chan] XTRA point] Points!"
} else {
if {([onchan $arg $chan]==0) && ([validuser [lindex $arg 0]]==0) } {
putserv "PRIVMSG $chan :User Not Found"
} else {
putserv "PRIVMSG $chan :[mynick2hand $arg $chan] Have [getuser [mynick2hand $arg $chan] XTRA point] Points!"
}
}
}
proc onjoin {nick uhost hand chan} {
if {[nick2hand $nick $chan]!="*"} {
putserv "NOTICE $nick :Hello and Welcome To #req [mynick2hand $nick $chan]! You Have [getuser [mynick2hand $nick $chan] XTRA point] Points!"
} else {
putserv "NOTICE $nick :$nick Your Host Mask Was Not Recognized, Please Identify You To The Bottom! To Do This, Write /msg |reqbot| auth ditpassword"
}
}
proc enablenotify {nick uhost hand chan arg} {
if {[nick2hand $nick $chan]!="*"} {
chattr $nick |\-X \#req
putserv "NOTICE $nick :Enabled!"
} else {
putserv "NOTICE $nick :You Are Not Added To The Bottom!"
}
}
proc disablenotify {nick uhost hand chan arg} {
if {[nick2hand $nick $chan]!="*"} {
chattr $nick |\+X \#req
putserv "NOTICE $nick Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir. isabled!"
} else {
putserv "NOTICE $nick :You Are Not Added To The Bottom!"
}
}
proc reguser {nick uhost hand chan arg} {
if {[nick2hand $arg $chan]=="*"} {
if {[matchattr [nick2hand $nick $chan] o|o $chan]} {
adduser $arg [maskhost [getchanhost $arg $chan]]
chattr $arg |\+v \#req
chattr $arg \+X
setuser [nick2hand $arg $chan] XTRA Point 5
putserv "PRIVMSG $chan :User Added!"
putserv "NOTICE $arg :$arg: Write /msg |Reqbot| pass indsætditpassher To Put Your Password, It Is Recommended Especially If You Have a Changing Ip, So That The Bot Can Identify You From a Different Host Mask!"
} else {
putserv "PRIVMSG $chan :$nick Your Balls Aint Big Enough To Do That!"
}
resetchan $chan
} else {
putserv "PRIVMSG $chan :$arg Is Already Registered!"
}
}
proc commands {nick uhost hand chan arg} {
if {[nick2hand $nick $chan]!="*"} {
set chancmds {
"THE REQUEST SCRIPT COMMANDS"
"!help <nick> <-- sends the command list to the specified nick"
"!disablenotift <-- turn's OFF notice messages from the request commands"
"!enablenotify <-- turn's ON notice messages from the request commands"
"!addreq <-- adds a request! example: !addreq Dj_skør_vandballong_-_haha-cda-dk-2004-PATTAH (2004-10-05)"
"!delreq <number> <-- deletes the request"
"!request <-- shows url to reqsite"
"!setftp <-- sets your ftp string/addline example: ftp://gonzles:fraspanien@[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...].har.en.ftpp.dk:1337"
"!getftp <nick> <-- lists the <nick's> ftp addline/sting"
"THE OTHER COMMANDS"
"!rules <-- displays the rules of req"
"!rules <nick> <-- sends the rules to the specified nick"
"!imdb <movietitle> <-- shows url to imdb.com's review of the movie"
"!seen <nick> <-- displays when the nick last was seen in the channel examples: !seen p0nk, !seen p0* "
"THAT'S ALL DUDE...."
}
if {$arg != ""} {
if {[onchan $arg $chan]} {
puthelp "PRIVMSG $arg :Watch and Learn!"
foreach line $chancmds { puthelp "PRIVMSG $arg :$line" }
} else {
puthelp "PRIVMSG $nick :Nick Not Found!"
}
} else {
foreach line $chancmds {puthelp "PRIVMSG $nick :$line" }
}
} else {
putserv "PRIVMSG $chan :You Are Not Added To The Bottom!"
}
}
proc httpserver {s ipaddr port} {
fconfigure $s -blocking 0 -buffering line
gets $s x
set i 0
set info($i) $x
incr i
while {$i<20} {
gets $s info($i)
incr i
}
unset i
puts $s "\
HTTP/1.1 200 OK\n\
Server: Eggdrop http server\n\
Connection: close\n\
Content-Type: text/html; charset=iso-8859-1\n\
Cache-Control: no-cache; no-store; max-age=0\n\
Pragma: no-cache\n\n\n\
<html>\n\
<head>\n\
</head>\n\
<body style=\"font-family: fixedsys\">\n\
<table>\n\
<tr>\n\
<td><b>Number: </b></td><td><b>Request:</b></td><td><b>User Nick:</b></td><td><b>Date Established:</b></td><td><b>Point:</b></td>\n\
</tr>\n\
"
set rf [open "requests.txt" r]
fconfigure $rf -translation binary
fconfigure $s -translation binary
puts $s "[read $rf]"
close $rf
puts $s "\
</body>
</html>
"
close $s
}
proc httpserver2 {s ipaddr port} {
fconfigure $s -blocking 0 -buffering line
gets $s x
set i 0
set info($i) $x
incr i
while {$i<20} {
gets $s info($i)
incr i
}
unset i
puts $s "\
HTTP/1.1 200 OK\n\
Server: Eggdrop http server\n\
Connection: close\n\
Content-Type: text/html; charset=iso-8859-1\n\
Cache-Control: no-cache; no-store; max-age=0\n\
Pragma: no-cache\n\n\n\
<html>\n\
<head>\n\
</head>\n\
<body style=\"font-family: fixedsys\">\n\
"
set splitteddata [userlist X]
for { set number 0 } { $number < [llength $splitteddata ] } { incr number } {
puts $s [lindex $splitteddata $number]
puts $s [getuser [lindex $splitteddata $number] XTRA Point]
puts $s "<BR>"
}
puts $s "\
</body>
</html>
"
close $s
}
proc addreq {nick uhost hand chan arg} {
set isregged false
if {[nick2hand $nick $chan]!="*"} {
if {[string match -nocase *|* $arg]!=0} {
if {[string is integer -strict [lindex [split $arg "|"] 1] ]!=0} {
set point [lindex [split $arg "|"] 1]
set arg [lindex [split $arg "|"] 0]
if { ([expr [getuser [mynick2hand $nick $chan] XTRA Point] - $point > -1]) && ([expr $point > 0]) } {
setuser [mynick2hand $nick $chan] XTRA point [expr [getuser [mynick2hand $nick $chan] XTRA Point] - $point]
######## FIND NEXT NUMBER!!!!!!!!!!!!!!!
set fp [open "requests.txt" r]
set data [read $fp]
close $fp
set datasplitted [split $data "\n"]
set nextnumber 0
for { set number 1 } { $number < [expr [llength $datasplitted]+1] } { incr number } {
if {[string match -nocase *#$number* $datasplitted]==0} {
if {$nextnumber==0} {
set nextnumber $number
}
}
}
######### ADD VERY REQUEST
set fp [open "requests.txt" r]
set data [read $fp]
close $fp
set data [split $data "\n"]
set fid [open requests.txt a]
fconfigure $fid -buffering line
set current_date [strftime "%b %d %Y %H:%M" [expr [clock seconds] - 86400]]
regsub "#" $arg "%" arg
puts $fid "<tr><td>#$nextnumber</td><td>$arg</td><td>[nick2hand $nick $chan]</td><td>$current_date</td><td>$point<td></tr>"
close $fid
putserv "PRIVMSG $chan :- \[NEW REQUEST\]-\[\0037$arg\003\]-\[ADDED BY\]-\[\0037[nick2hand $nick $chan]\003\]-\[NR\]-\[\0037#$nextnumber\003\]-\[DATE\]-\[\0037$current_date\003\]"
putserv "PRIVMSG $chan :Request Added, Sending Notices!"
foreach line [chanlist $chan] {
if {![matchattr $line |X $chan]} {
# putserv "NOTICE $line :- \[NEW REQUEST\]-\[\0037$arg\003\]-\[ADDED BY\]-\[\0037[nick2hand $nick $chan]\003\]-\[NR\]-\[\0037#$nextnumber\003\]-\[DATE\]-\[\0037$current_date\003\]"
}
}
} else {
putserv "PRIVMSG $chan :Sorry That You Do Not Have Enough Points!"
}
} else {
putserv "PRIVMSG $chan :Number Of Points Must Be Greater !"
}
} else {
putserv "PRIVMSG $chan :You Must Enter Score, It Makes You. By Writing !addreq Request|1 It Will Put 1 Point On Request!"
}
} else {
putserv "PRIVMSG $chan :You Are Not Added To Bottom!"
}
}
proc requests {nick uhost hand chan arg} {
if {[nick2hand $nick $chan]!="*"} {
putserv "PRIVMSG $chan :4http://IPTOBOT:8002/"
} else {
putserv "PRIVMSG $chan :User Not Added To Bottom!"
}
}
proc showallpoints {nick uhost hand chan arg} {
if {[nick2hand $nick $chan]!="*"} {
putserv "PRIVMSG $chan :4http://IPTOBOT:8003/"
} else {
putserv "PRIVMSG $chan :You Are Not Added To Bottom!"
}
}
proc delreq {nick uhost hand chan arg} {
regsub "#" $arg "" arg
set error "false"
set deleted "false"
if {[nick2hand $nick $chan]!="*"} {
if {[string match -nocase *|* $arg]!=0} {
set reward [lindex [split $arg "|"] 1]
set arg [lindex [split $arg "|"] 0]
if {[isnumber $arg]} {
if {([validuser $reward]) || ([onchan $reward $chan]!=0) } {
set fp [open "requests.txt" r]
set data [read $fp]
close $fp
set data [split $data "\n"]
set fs [open "requests.txt" w]
for { set number 0 } { $number < [expr [llength $data]-1] } { incr number } {
set currline [lindex $data $number]
if {([string match -nocase *#[lindex $arg 0]* $currline]!=1) } {
puts $fs $currline
} else {
if {[string match -nocase *<td>[nick2hand $nick $chan]</td>* $currline]==1} {
set deleted "true"
set tempsplit [lindex [split $currline ">"] 4]
set point [lindex [split $currline ">"] 10]
regsub "<td" $point "" Point
putserv "PRIVMSG $chan :Requester Was At $point Point, It Has Now Received $reward, and He Has Now[expr [getuser [mynick2hand $reward $chan] XTRA Point] + $point ] Point!"
setuser [mynick2hand $reward $chan] XTRA point [expr [getuser [mynick2hand $reward $chan] XTRA Point] + $point ]
} else {
puts $fs $currline
}
}
}
close $fs
} else {
putserv "PRIVMSG $chan :The User You Want To Give Points To Does Not Exist!"
set error "true"
}
} else {
putserv "PRIVMSG $chan :Invalid Number Entered!"
set error "true"
}
} else {
set error "true"
putserv "PRIVMSG $chan :You Must Specify Who Should Have Points, It Makes You Know, For Example. Write! delreq 23|filler, It Will Remove The Request 23, and Give Points To The User With The Nickname filler. If Your Requests Have Not Been Filled But Just Have To Be Removed Should You Write Your Own Nickname!"
set valid "false"
}
} else {
set error "true"
putserv "PRIVMSG $chan :You Are Not Added To The Bottom!"
}
if {($error=="false") && ($deleted=="false")} {
putserv "PRIVMSG $chan :Requester Was Not Removed, It May Not Be You Who Created It?"
}
if {$deleted=="true"} {
regsub "</td" $tempsplit "" tempsplit
putserv "PRIVMSG $chan :Requesten\0037 $tempsplit (#[expr [lindex $arg 0]])\003 Has Been Deleted "
}
}
proc mynick2hand {nick chan} {
if {[nick2hand $nick $chan]==""} {
set result $nick
} else {
set result [nick2hand $nick $chan]
}
if {$result=="*"} {
set result ""
}
return $result
}
proc getftp {nick uhost hand chan arg} {
if {[nick2hand $nick $chan]!="*"} {
set ftpstring "[getuser [mynick2hand $arg $chan] XTRA ftp]"
if {$ftpstring!=""} {
putserv "NOTICE $nick :$ftpstring"
} else {
putserv "NOTICE $nick :The User Has Not Entered Any PUBLIC Available Information, Try To Ask Him/Her Instead!"
}
} else {
putserv "PRIVMSG $chan :You Are Not Added To Bottom!"
}
}
proc setftp {nick uhost hand chan arg} {
if {[nick2hand $nick $chan]!="*"} {
setuser [nick2hand $nick $chan] XTRA ftp $arg
putserv "NOTICE $nick :Your FTPstring Set!"
} else {
putserv "PRIVMSG $chan :You Are Not Added To Bottom!"
}
}
Şunu türkceleşdirseniz ya :d
| |
| |