Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 20th, 2010 | Syntax: None | Size: 5.67 KB | Hits: 55 | Expires: Never
Copy text to clipboard
  1. on *:TEXT:Roll *:*:{
  2.   if ($2 isalpha) halt
  3.   if (-showface isin $2-) || (showface isin $2-) || (-SF isin $2-) { var %showface yes }
  4.   if (d isin $2) { }
  5.   else { halt }
  6.   if (. isin $2) halt
  7.   if (, isin $2) halt
  8.   if (~ isin $2) halt
  9.   if (! isin $2) halt
  10.   if (? isin $2) halt
  11.   if ($pos($2,d,1) == 1) { var %prestring $chr(58) $+ $replacex($replacex($replacex($replacex($replacex($replacex($replacex($replacex($replacex($2,+,:+:),-,:-:),*,:*:),/,:/:),&,:&:),$chr(40),: $+ $chr(40) $+ :),$chr(41),: $+ $chr(41) $+ :),$chr(35),#:),$chr(68),$chr(100)) }
  12.   else { var %prestring $replacex($replacex($replacex($replacex($replacex($replacex($replacex($replacex($replacex($2,+,:+:),-,:-:),*,:*:),/,:/:),&,:&:),$chr(40),: $+ $chr(40) $+ :),$chr(41),: $+ $chr(41) $+ :),$chr(35),#:),$chr(68),$chr(100)) }
  13.   if ($3 = target) || ($3 = TN) var %success 0
  14.   var %string $replacex(%prestring,:d,:1d)
  15.   var %stringfetch $matchtok(%string,d,0,58)
  16.   var %stringfetch2 $matchtok(%string,d,0,58)
  17.   var %ismath $calc($matchtok(%string,$chr(43),0,58) + $matchtok(%string,$chr(45),0,58) + $matchtok(%string,$chr(42),0,58) + $matchtok(%string,$chr(47),0,58) )
  18.   var %instancefetch $numtok(%string,38)
  19.   ;Monster argument for rolls with math
  20.   if ($matchtok(%string,$chr(35),0,58) == 0)  && (%ismath > 0) {
  21.     if (%stringfetch > 10) {
  22.       msg $chan 6 $+ $read(tsunmisc.txt,3) 
  23.       halt
  24.     }
  25.     if (%instancefetch <= 0) { var %instancefetch 1 }
  26.     while (%stringfetch > 0) {
  27.       var %diceresult
  28.       var %diceset $matchtok(%string,d,%stringfetch,58)
  29.       var %diceroll $gettok(%diceset,1,100)
  30.       if (%diceroll > 50) {
  31.         msg $chan 6 $+ $read(tsunmisc.txt,4) 
  32.         halt
  33.       }
  34.       if ($gettok(%diceset,2,100) > 100) {
  35.         msg $chan 6 $+ $read(tsunmisc.txt,5) 
  36.         halt
  37.       }
  38.       while (%diceroll > 0) {
  39.         var %diceresult $instok(%diceresult,$rand(1,$gettok(%diceset,2,100)),0,43)
  40.         dec %diceroll 1
  41.       }
  42.       var %dicemath $instok(%dicemath,$calc( %diceresult ),-500,58)
  43.       dec %stringfetch 1
  44.     }
  45.     var %rebuild1 $reptok(%string,$matchtok(%string,d,1,58),$gettok(%dicemath,1,58),1,58)
  46.     var %rebuild2 $reptok(%rebuild1,$matchtok(%rebuild1,d,1,58),$gettok(%dicemath,2,58),1,58)
  47.     var %rebuild3 $reptok(%rebuild2,$matchtok(%rebuild2,d,1,58),$gettok(%dicemath,3,58),1,58)
  48.     var %rebuild4 $reptok(%rebuild3,$matchtok(%rebuild3,d,1,58),$gettok(%dicemath,4,58),1,58)
  49.     var %rebuild5 $reptok(%rebuild4,$matchtok(%rebuild4,d,1,58),$gettok(%dicemath,5,58),1,58)
  50.     var %rebuild6 $reptok(%rebuild5,$matchtok(%rebuild5,d,1,58),$gettok(%dicemath,6,58),1,58)
  51.     var %rebuild7 $reptok(%rebuild6,$matchtok(%rebuild6,d,1,58),$gettok(%dicemath,7,58),1,58)
  52.     var %rebuild8 $reptok(%rebuild7,$matchtok(%rebuild7,d,1,58),$gettok(%dicemath,8,58),1,58)
  53.     var %rebuild9 $reptok(%rebuild8,$matchtok(%rebuild8,d,1,58),$gettok(%dicemath,9,58),1,58)
  54.     var %rebuild10 $reptok(%rebuild9,$matchtok(%rebuild9,d,1,58),$gettok(%dicemath,10,58),1,58)
  55.     if (%stringfetch2 == 1) var %rebuild %rebuild1
  56.     if (%stringfetch2 == 2) var %rebuild %rebuild2
  57.     if (%stringfetch2 == 3) var %rebuild %rebuild3
  58.     if (%stringfetch2 == 4) var %rebuild %rebuild4
  59.     if (%stringfetch2 == 5) var %rebuild %rebuild5
  60.     if (%stringfetch2 == 6) var %rebuild %rebuild6
  61.     if (%stringfetch2 == 7) var %rebuild %rebuild7
  62.     if (%stringfetch2 == 8) var %rebuild %rebuild8
  63.     if (%stringfetch2 == 9) var %rebuild %rebuild9
  64.     if (%stringfetch2 == 10) var %rebuild %rebuild10
  65.     while (%instancefetch > 0) {
  66.       var %preresult $instok(%preresult,$floor($calc($replacex($gettok(%rebuild,%instancefetch,38),:,))),-500,150)
  67.       dec %instancefetch 1
  68.     }
  69.     var %result $replacex(%preresult,$chr(150),$chr(32) $+ and $+ $chr(32))
  70.     msg $chan $nick rolled %result $chr(91) $+ $replacex(%rebuild,:,) $+ $chr(93) -6 $read(tsundice.txt) 
  71.   }
  72.  
  73.  
  74. Then the for exalted rolls: multiple instance rolls:
  75.  
  76.  if ($matchtok(%string,$chr(35),0,58) > 0) {
  77.     if (%instancefetch > 1) {
  78.       msg $chan 6 $+ $read(tsunmisc.txt,6) 
  79.       halt
  80.     }
  81.     if (%stringfetch > 1) {
  82.       msg $chan 6 $+ $read(tsunmisc.txt,7) 
  83.       halt
  84.     }
  85.     var %instances $replacex($gettok(%string,1,58),$chr(35),)
  86.     if (%instances > 50) {
  87.       msg $chan 6 $+ $read(tsunmisc.txt,8) 
  88.       halt
  89.     }
  90.     var %newstring $deltok(%string,1,58)
  91.     while (%instances > 0) {
  92.       var %diceresult
  93.       var %diceset $matchtok(%newstring,d,1,58)
  94.       var %diceroll $gettok(%diceset,1,100)
  95.       if (%diceroll > 50) {
  96.         msg $chan 6 $+ $read(tsunmisc.txt,4) 
  97.         halt
  98.       }
  99.       if ($gettok(%diceset,2,100) > 100) {
  100.         msg $chan 6 $+ $read(tsunmisc.txt,5) 
  101.         halt
  102.       }
  103.       while (%diceroll > 0) {
  104.         var %diceresult $instok(%diceresult,$rand(1,$gettok(%diceset,2,100)),1,43)
  105.         dec %diceroll 1
  106.       }
  107.       if ($left($4,1) != $chr(47)) && ($floor($calc($replacex($reptok(%newstring,$matchtok(%string,d,1,58),$calc( %diceresult ),1,58),:,))) >= $4) { inc %success 1 }
  108.       if ($left($4,1) == $chr(47)) { inc %success $floor($calc($floor($calc($replacex($reptok(%newstring,$matchtok(%string,d,1,58),$calc( %diceresult ),1,58),:,))) $4)) }
  109.       if ($5 = double) && ($floor($calc($replacex($reptok(%newstring,$matchtok(%string,d,1,58),$calc( %diceresult ),1,58),:,))) == $6) { inc %success 1 }
  110.       var %result $instok(%result,$floor($calc($replacex($reptok(%newstring,$matchtok(%string,d,1,58),$calc( %diceresult ),1,58),:,))),0,44)
  111.       dec %instances 1
  112.     }
  113.     if ($3 == target) || ($3 == TN) { msg $chan $nick rolled %result with %success successes. -6 $read(tsundice.txt)  }
  114.     else { msg $chan $nick rolled %result -6 $read(tsundice.txt)  }
  115.   }
  116. }