egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Love Match

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
LinkinPark
Voice


Joined: 26 Apr 2011
Posts: 7
Location: Cambodia

PostPosted: Tue Apr 26, 2011 7:20 am    Post subject: Love Match Reply with quote

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
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Thu Jan 31, 2013 4:45 pm    Post subject: Reply with quote

I don`t know if 100% will be triggered to often but thats because its a random process Smile 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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber