🔔 Çevrimdışı bildirim almak ister misiniz?
Bir konuya etiketlendiğinizde, özel mesaj aldığınızda, bir mesajınız alıntılandığında forumda olmasanız bile anlık bildirim almak için lütfen izni verin.
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
Kod: Kodu kopyalamak için üzerine çift tıklayın!
setudef flag romen
bind pub -|- ".no" no_search
bind pub -|- ".romen" roman_search
proc no_search {nick uhost hand chan text} {
if {![channel get $chan romen]} { return }
set q [lindex [split [string toupper $text]] 0]
if {[regexp {[0-9]+} $q] || [llength $q] eq "0"} {
puthelp "privmsg $chan :\00304$::lastbind <romen rakkamı>\003"
return
}
puthelp "privmsg $chan :$nick ->\00304 $q \003== \00312[roman:get $q]\003"
return 0
}
proc roman_search {nick uhost hand chan text} {
if {![channel get $chan romen]} { return }
set q [lindex [split $text] 0]
if {![regexp {[0-9]+} $q] || [llength $q] eq "0"} {
puthelp "privmsg $chan :\00304$::lastbind <sayı>\003"
return
}
puthelp "privmsg $chan :$nick ->\00304 $q \003== \00312[roman:number $q]\003"
return 0
}
# http://goo.gl/HCXci1
proc roman:number {i} {
set res ""
foreach {value roman} {
1000 M 900 CM 500 D 400 CD 100 C 90 XC 50 L 40 XL 10 X 9 IX 5 V 4 IV 1 I} {
while {$i>=$value} {
append res $roman
incr i -$value
}
}
set res
}
proc roman:get {s} {
array set r_v {M 1000 D 500 C 100 L 50 X 10 V 5 I 1}
set last 99999; set res 0
foreach i [split [string toupper $s] ""] {
if [catch {set val $r_v($i)}] {
putlog "hatalı arama"
}
incr res $val
if {$val>$last} {incr res [expr -2*$last]}
set last $val
}
set res
}
putlog "ok..."