Scripts

From Mk

(Difference between revisions)
m (Large Hadron Collider countdown)
m (useless formatting +1)
Line 5: Line 5:
==Coin flipping script==
==Coin flipping script==
<pre>
<pre>
-
; +----------------------------------------------------------------------------------------------------
+
/* +---------------------------------------------------------------------------------------------------+ */
-
; | MK's coin flipping script. Use /coin to activate yourself, or have others use ^coin
+
/* | MK's coin flipping script. Use /coin to activate yourself, or have others use ^coin               | */
-
; | This first part is the alias:
+
/* | This first part is the alias:                                                                     | */
 +
/* |                                                                                                  | */
 +
 
alias coin {
alias coin {
   if ($nick == $null) { var %coinnick $me }  
   if ($nick == $null) { var %coinnick $me }  
Line 16: Line 18:
   else { msg $chan %coinnick flips a coin...and it landed on its edge. o_O }
   else { msg $chan %coinnick flips a coin...and it landed on its edge. o_O }
}
}
-
; | This second part is the trigger for the alias:
+
 
 +
/* |                                                                                                  | */
 +
/* | This second part is the trigger for the alias:                                                   | */
 +
/* |                                                                                                  | */
 +
 
on *:text:^coin:#:{ coin }
on *:text:^coin:#:{ coin }
-
; | End of coin flipping script
+
 
-
; +----------------------------------------------------------------------------------------------------
+
/* |                                                                                                  | */
 +
/* | End of coin flipping script                                                                       | */
 +
/* +---------------------------------------------------------------------------------------------------+ */
</pre>
</pre>
==Dice rolling script==
==Dice rolling script==
<pre>
<pre>
-
; +----------------------------------------------------------------------------------------------------
+
/* +---------------------------------------------------------------------------------------------------+ */
-
; | MK's di(c)e rolling script. Use /roll to activate yourself, or have others use ^roll #x d #y
+
/* | MK's di(c)e rolling script. Use /roll to activate yourself, or have others use ^roll #x d #y     | */
-
; | This first part is the alias:
+
/* | This first part is the alias:                                                                     | */
 +
/* |                                                                                                  | */
 +
 
alias roll {
alias roll {
   if ($nick == $null) { set %rollnick $me }  
   if ($nick == $null) { set %rollnick $me }  
Line 63: Line 73:
   else { msg $chan Sorry %rollnick $+ ; please use natural numbers between 1 and 50. }
   else { msg $chan Sorry %rollnick $+ ; please use natural numbers between 1 and 50. }
}
}
-
; | This second part is the trigger for the alias:
+
 
 +
/* |                                                                                                  | */
 +
/* | This second part is the trigger for the alias:                                                   | */
 +
/* |                                                                                                  | */
 +
 
on *:text:^roll *:#:{ roll $2- }
on *:text:^roll *:#:{ roll $2- }
-
; | End of dice rolling script
+
 
-
; +---------------------------------------------------------------------------------------------------
+
/* |                                                                                                  | */
 +
/* | End of dice rolling script                                                                       | */
 +
/* +---------------------------------------------------------------------------------------------------+ */
</pre>
</pre>
==Large Hadron Collider countdown==
==Large Hadron Collider countdown==
<pre>
<pre>
-
; +----------------------------------------------------------------------------------------------------
+
/* +---------------------------------------------------------------------------------------------------+ */
-
; | MK's LHC countdown script. Activates on Use /coin to activate yourself, or have others use ^coin
+
/* | MK's LHC countdown script. Activates on Use /coin to activate yourself, or have others use ^coin | */
-
; | This first part is the alias:
+
/* | This first part is the alias:                                                                     | */
 +
/* |                                                                                                  | */
 +
 
alias lhc {
alias lhc {
   var %lhc_current $ctime($date $time)
   var %lhc_current $ctime($date $time)
Line 89: Line 107:
   msg $chan The Large Hadron Collider $iif(%lhc_neg1,began,will begin) circulating protons $datecon($duration(%lhc_dif1)) $iif(%lhc_neg1,ago,from now) and $iif(%lhc_neg2,began,will begin) collisions $datecon($duration(%lhc_dif2)) $iif(%lhc_neg2,ago,from now) $+ .  
   msg $chan The Large Hadron Collider $iif(%lhc_neg1,began,will begin) circulating protons $datecon($duration(%lhc_dif1)) $iif(%lhc_neg1,ago,from now) and $iif(%lhc_neg2,began,will begin) collisions $datecon($duration(%lhc_dif2)) $iif(%lhc_neg2,ago,from now) $+ .  
}
}
-
; | This second part is the trigger for the alias:
+
 
 +
/* |                                                                                                  | */
 +
/* | This second part is the trigger for the alias:                                                   | */
 +
/* |                                                                                                  | */
 +
 
on *:text:^lhc:#:{ lhc }
on *:text:^lhc:#:{ lhc }
-
; | End of LHC countdown script
+
 
-
; +---------------------------------------------------------------------------------------------------
+
/* |                                                                                                  | */
 +
/* | End of LHC countdown script                                                                       | */
 +
/* +---------------------------------------------------------------------------------------------------+ */
</pre>
</pre>

Revision as of 23:29, 12 September 2008

I'll be putting some scripts I no longer use here:

Contents

mIRC

Coin flipping script

/* +---------------------------------------------------------------------------------------------------+ */
/* | MK's coin flipping script. Use /coin to activate yourself, or have others use ^coin               | */
/* | This first part is the alias:                                                                     | */
/* |                                                                                                   | */

alias coin {
  if ($nick == $null) { var %coinnick $me } 
  else { var %coinnick $nick } 
  var %coinrand $rand(1,6001)
  if ((%coinrand >= 1) && (%coinrand <= 3000)) { msg $chan %coinnick flips a coin! Heads! }
  elseif ((%coinrand >= 3001) && (%coinrand <= 6000)) { msg $chan %coinnick flips a coin! Tails! }
  else { msg $chan %coinnick flips a coin...and it landed on its edge. o_O }
}

/* |                                                                                                   | */
/* | This second part is the trigger for the alias:                                                    | */
/* |                                                                                                   | */

on *:text:^coin:#:{ coin }

/* |                                                                                                   | */
/* | End of coin flipping script                                                                       | */
/* +---------------------------------------------------------------------------------------------------+ */

Dice rolling script

/* +---------------------------------------------------------------------------------------------------+ */
/* | MK's di(c)e rolling script. Use /roll to activate yourself, or have others use ^roll #x d #y      | */
/* | This first part is the alias:                                                                     | */
/* |                                                                                                   | */

alias roll {
  if ($nick == $null) { set %rollnick $me } 
  else { var %rollnick $nick } 
  if ($1 == help) { 
    notice %rollnick Syntax: ^roll �x� d �y�; �x� is the number of dice to roll; �y� is the number of sizes on each die; between 1 and 50. 
    halt
  }
  elseif (($2 != d) || ($3 == $null)) { 
    msg $chan %rollnick $+ , you somehow managed to screw up a fairly simple script. Type �^roll �help�� for help.
  }
  elseif (($calc($1) > 0) && ($calc($1) < 51) && ($2 == d) && ($calc($3) > 0) && ($calc($3) < 51)) {
    if ($calc($1) == 1) { msg $chan %rollnick rolled a d $+ $3 and got a $rand(1,$calc($3)) $+ ! | unset %roll* | halt }
    var %roll $calc($calc($1) - 1)
    var %rollout %rollnick rolled $1 d $+ $3 $+ 's and got 
    var %rolltotal1 0
    var %rolltotal2 0
    :1
    if (%roll == 0) {
      var %rollrand $rand(1,$calc($3))
      var %rolltotal1 $calc(%rolltotal + %rollrand)
      var %rolltotal2 $calc(%rolltotal2 + $calc($3))
      var %rollout %rollout $+ � and %rollrand $+ ! (Total: %rolltotal1 out of a possible %rolltotal2 $+ )
    }
    else { 
      var %rollrand $rand(1,$calc($3))
      var %rolltotal $calc(%rolltotal + %rollrand)
      var %rolltotal2 $calc(%rolltotal2 + $calc($3))
      var %rollout %rollout $+ � %rollrand $+ ,
      var %roll
      goto 1
    }
    :2
    msg $chan %rollout
  }
  else { msg $chan Sorry %rollnick $+ ; please use natural numbers between 1 and 50. }
}

/* |                                                                                                   | */
/* | This second part is the trigger for the alias:                                                    | */
/* |                                                                                                   | */

on *:text:^roll *:#:{ roll $2- }

/* |                                                                                                   | */
/* | End of dice rolling script                                                                        | */
/* +---------------------------------------------------------------------------------------------------+ */

Large Hadron Collider countdown

/* +---------------------------------------------------------------------------------------------------+ */
/* | MK's LHC countdown script. Activates on Use /coin to activate yourself, or have others use ^coin  | */
/* | This first part is the alias:                                                                     | */
/* |                                                                                                   | */

alias lhc {
  var %lhc_current $ctime($date $time)
  var %lhc_circulate $ctime(2008 September 10 03:35:00)
  var %lhc_collision $ctime(2008 October 10 00:00:00)
  var %lhc_dif1 $calc(%lhc_circulate - %lhc_current)
  var %lhc_dif2 $calc(%lhc_collision - %lhc_current)
  if (%lhc_dif1 < 0) { 
    var %lhc_dif1 $remove(%lhc_dif1,-) 
    var %lhc_neg1 1 
  }
  if (%lhc_dif2 < 0) { 
    var %lhc_dif2 $remove(%lhc_dif2,-) 
    var %lhc_neg2 1
  }
  msg $chan The Large Hadron Collider $iif(%lhc_neg1,began,will begin) circulating protons $datecon($duration(%lhc_dif1)) $iif(%lhc_neg1,ago,from now) and $iif(%lhc_neg2,began,will begin) collisions $datecon($duration(%lhc_dif2)) $iif(%lhc_neg2,ago,from now) $+ . 
}

/* |                                                                                                   | */
/* | This second part is the trigger for the alias:                                                    | */
/* |                                                                                                   | */

on *:text:^lhc:#:{ lhc }

/* |                                                                                                   | */
/* | End of LHC countdown script                                                                       | */
/* +---------------------------------------------------------------------------------------------------+ */
Personal tools