| View previous topic :: View next topic |
| Author |
Message |
LinkinPark Voice
Joined: 26 Apr 2011 Posts: 7 Location: Cambodia
|
Posted: Tue Apr 26, 2011 7:20 am Post subject: Love Match |
|
|
Hello all coders/scripters
I want to make a request for Love Match..
Example:
<me> !Love nick1 nick2
<bot> Love Match nick1 + nick2 = 85%
and
<me> !Love nick1 nick2
<bot> Congratulations! Love Match nick1 + nick2 = 100%
Percentage start from 1-100%
also with trigger !Hate nick1 nick2 the same as !Love
Thanks for help me! |
|
| Back to top |
|
 |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Thu Jan 31, 2013 4:45 pm Post subject: |
|
|
I don`t know if 100% will be triggered to often but thats because its a random process nick1 and nick2 must be in the channel if they are not the script won`t work
| Code: |
#### ++++ Author: MadaliN <madalinmen28@yahoo.com>
### ++++ TCL Name: Love & Hate
## ++++
#
# Commands:
# !love nick1 nick2
# !hate nick1 nick2
bind pub - !love love:pub
bind pub - !hate hate:pub
proc love:pub {nick uhost hand chan arg} {
set nick1 [lindex [split $arg] 0]
set nick2 [lindex [split $arg] 1]
if {($nick1 != "") && ($nick2 != "") && [onchan $nick1 $chan] && [onchan $nick2 $chan]} {
set lovematch [minmaxrand 0 101]
if {$lovematch == "100"} {
putserv "PRIVMSG $chan :Congratulations! Love match \00312$nick1\003 + \00312$nick2\003 = \00304\002$lovematch\002%"
} else {
putserv "PRIVMSG $chan :Love match \00312$nick1\003 + \00312$nick2\003 = \00304\002$lovematch\002%"
}
}
}
proc hate:pub {nick uhost hand chan arg} {
set nick1 [lindex [split $arg] 0]
set nick2 [lindex [split $arg] 1]
if {($nick1 != "") && ($nick2 != "") && [onchan $nick1 $chan] && [onchan $nick2 $chan]} {
set hatematch [minmaxrand 0 100]
if {$hatematch == "100"} {
putserv "PRIVMSG $chan :Congratulations! Hate match \002$nick1\002 + \002$nick2\002 = \00304\002$hatematch\002%"
} else {
putserv "PRIVMSG $chan :Hate match \002$nick1\002 + \002$nick2\002 = \002$hatematch\002%"
}
}
}
proc minmaxrand {min max} {
set r [expr ([rand [expr ($max - $min)]] + $min)]
return $r
}
putlog "+++ sucesfully loaded: \00312Love & Hate TCL Script"
|
_________________ https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL |
|
| Back to top |
|
 |
|