Advertisement
NatedogServer

SPELL SCRIBER

Jul 17th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.92 KB | None | 0 0
  1. sub EVENT_SAY {
  2.  
  3.  
  4.  
  5. if($text =~/hail/i)
  6. {
  7.     ##Message blah blah tell player to input 2 numbers
  8. }
  9. elsif($text =~/  /i)
  10. {
  11.     #Tell player they added too many spaces
  12. }
  13. elsif($text =~/^[0-9 ]+$/ && $text =~/ /i)   #Text requires numbers and 1 SPACE
  14. {
  15. my $strlength = length($text);
  16.     if ($strlength == 5)
  17.     {
  18.         $min = substr($text, 0, 2);
  19.         $max = substr($text, 3, 2);
  20.     }
  21.     elsif($strlength == 4)
  22.     {
  23.         $min = substr($text, 0, 2);
  24.         $max = substr($text, 2, 2);
  25.     }
  26.     elsif($strlength == 3)
  27.     {
  28.         $min = substr($text, 0, 1);
  29.         $max = substr($text, 2, 1);
  30.     }
  31.     else
  32.     {
  33.       #YOU ENTERED TOO Many fucking numbers ADD TEXT HERE
  34.     }
  35.    
  36.     if($max >= $min)
  37.     {
  38.         if($max <= 80)
  39.         {
  40.             #Scribespells HERE ADD TEXT or something
  41.             print "max is $max  -- min is $min \n";
  42.         }
  43.     }
  44.     elsif($min > $max)
  45.     {
  46.         #First number must be lower than 2nd number dipshit!
  47.         #Add text here telling them they are dumbasses
  48.     }
  49.    
  50. }
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement