Pages

Sunday, August 28, 2011

jodoh.tcl

## Enjoy,
## Sincerely,
## eggoez.blogspot.com!
##
bind pub - .jodoh Matcher
proc Matcher {nick uhost hand chan args} {
regsub -nocase -all \[{}] $args "" args
set origargs $args
set args [string tolower $args]
if {[llength $args] < 2} {
 putserv "privmsg $nick :!04Jo04Do04h! Penggunaan .jodoh <nama cowok> <nama cewek>"
 return
}

set counter 0
set compatmarker 0
while {$counter != [string length $args]} {
 if {[string range $args $counter $counter] == "l"} {incr compatmarker 2}
 if {[string range $args $counter $counter] == "o"} {incr compatmarker 2}
 if {[string range $args $counter $counter] == "v"} {incr compatmarker 2}
 if {[string range $args $counter $counter] == "e"} {incr compatmarker 2}
 if {[string range $args $counter $counter] == "y"} {incr compatmarker 3}
 if {[string range $args $counter $counter] == "o"} {incr compatmarker 1}
 if {[string range $args $counter $counter] == "u"} {incr compatmarker 3}
 incr counter
}

set compatability 0
if {$counter > 0} {set compatability [expr 5 - ([string length $args] /2)]}
if {$counter > 2} {set compatability [expr 10 - ([string length $args] /2)]}
if {$counter > 4} {set compatability [expr 20 - ([string length $args] /2)]}
if {$counter > 6} {set compatability [expr 30 - ([string length $args] /2)]}
if {$counter > 8} {set compatability [expr 40 - ([string length $args] /2)]}
if {$counter > 10} {set compatability [expr 50 - ([string length $args] /2)]}
if {$counter > 12} {set compatability [expr 60 - ([string length $args] /2)]}
if {$counter > 14} {set compatability [expr 70 - ([string length $args] /2)]}
if {$counter > 16} {set compatability [expr 80 - ([string length $args] /2)]}
if {$counter > 18} {set compatability [expr 90 - ([string length $args] /2)]}
if {$counter > 20} {set compatability [expr 100 - ([string length $args] /2)]}
if {$counter > 22} {set compatability [expr 110 - ([string length $args] /2)]}

if {$compatability < 0} {set compatability 0}
if {$compatability > 100} {set compatability 100}
if {$compatability < 50} {
  set jodoh "boleh percaya.. boleh tidak.. tapi kemungkinan anda berdua belum jodoh. Maaf yah.. :)"
} elseif {$compatability < 75} {
  set jodoh "Perlu usaha lebih giat lagi untuk melakukan pendekatan hati kalian berdua =p"
} elseif {$compatability < 90} {
  set jodoh "awal yang bagus.. mendekati jodoh.. cuit cuit.. ayo lebih mesra lagi akh.. =p"
} else {
  set jodoh "BRAVO!! anda berdua jodoh! percaya...?! tidak juga tidak apa-apa minimal anda tahu yang terbaik untuk anda yah.. =p"
}
putserv "privmsg $chan :14Kecocokan antara03 $origargs 10sebesar04 $compatability% ($jodoh)"
return
}

###############################################################################
##### GENERAL SETTINGS ####
# on the old scripts, it's on particular channel. but now, i made it for all channels.
set channel "*"

# Edit the time cycle which is in minutes format depending on the time intervals you want the bot to flow out the advertisment
set time 20

# EDIT the text or REMOVE or ADD lines including inverted commas at the starting and ending at each line 
set text {
  "seen g0eZ"
  "seen egGo"
  "eggoez@yahoo.com"
  "ojok_add@ymail.com"
}

##### DO NOT EDIT ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING #####

if {[string compare [string index $time 0] "!"] == 0} { set timer [string range $time 1 end] } { set timer [expr $time * 60] }
if {[lsearch -glob [utimers] "* go *"] == -1} { utimer $timer go }

proc go {} {
  global channel time text timer
  foreach chan $channel {
    set line [lindex $text [rand [llength $text]]]
    putserv "PRIVMSG $chan :$line"
  }
  if {[lsearch -glob [utimers] "* go *"] == -1} { utimer $timer go }
}

putlog "\00315(\003dcL\00304\002!\002\00315)\003 versi 1.0 By g0eZ egGo Di Jalankan.."

No comments:

Post a Comment