Advertisement
Azure

_shitcode.rb

Nov 17th, 2011
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.02 KB | None | 0 0
  1.         # Spin the bottle
  2.         when /^(\.spin)/i
  3.             list = XChatRuby::XChatRubyList.new( "users" );
  4.             users = [];
  5.             while list.next
  6.                 nick = list.str("nick");
  7.                 users.push(nick);
  8.             end
  9.             command( format( "say ![bc03]#{triggerUser}![bc] spins the bottle..." ) );
  10.             timerAddition = 0;
  11.             userDuplicated = true;
  12.             # we assume that the user IS duplicated in order to initialize
  13.             # the loop.
  14.             while userDuplicated == true do
  15.                 srand();
  16.                 user = users[rand(users.size)]
  17.                 userDuplicated = triggerUser.eql?(user) ? true : false;
  18.                 if userDuplicated == true
  19.                     command( format( "timer #{timerAddition+2+rand(4)+1} say The bottle stopped at ![bc03]#{triggerUser}![bc]! Respinning~..." ) );
  20.                     timerAddition = timerAddition.next + 1; # adding an extra second onto the addition
  21.                 else
  22.                     timerAddition = timerAddition.next #adding an extra second
  23.                     command( format( "timer #{timerAddition+2+rand(4)+1} say The bottle stopped at ![bc03]#{user}![bc]! Now kiss up~" ) );
  24.                 end
  25.             end
  26.             # note: 2+rand(3)+1 == minimum of 2 seconds + a random number between 0 and 2 + 1 to make the random number between 1 and 3.
  27.                
  28.                
  29.                
  30.         # Dr Pepper Dispenser
  31.         when /^\.drpepper/i
  32.                 wordarr = words[1].split(" ")
  33.                 wordarr.slice!(0)
  34.                 myphrase = wordarr.join(" ")
  35.                 if myphrase.length < 1 then myphrase = triggerUser end
  36.                
  37.                 command( "me dispenses a Dr Pepper for #{myphrase}." )
  38.  
  39.  
  40.                
  41.                
  42.             when /^\.accident/i
  43.                 wordarr = words[1].split(" ")
  44.                 wordarr.slice!(0)
  45.                 myphrase = wordarr.join(" ")
  46.                 if myphrase.length < 1 then myphrase = triggerUser end
  47.                 command( "say I accidentally all over #{myphrase}" )
  48.  
  49.                
  50.             when /^\.dickpunch/i
  51.  
  52.                 wordarr = words[1].split(" ")
  53.                 wordarr.slice!(0)
  54.                 myphrase = wordarr.join(" ")
  55.                 if words[1] =~ /(#{myNick})$/i
  56.                     myphrase = triggerUser
  57.                 end
  58.                 if myphrase.length < 1 then myphrase = triggerUser end
  59.                 command( "me punches #{myphrase} in the dick" )
  60.             when /^\.despair/i
  61.                 wordarr = words[1].split(" ")
  62.                 wordarr.slice!(0)
  63.                 myphrase = wordarr.join(" ")
  64.                 myphrase.slice!(100..-1)
  65.                 if myphrase.length < 1 then myphrase = triggerUser end
  66.                 command( "say I AM IN DESPAIR! #{myphrase.upcase} HAS LEFT ME IN DESPAIR!!" )
  67.             when /^\.superarts/i
  68.                 if words[1] =~ /(#{myNick})$/i
  69.                     command("say NOOOOOOOOOOOOOO");
  70.                     return XCHAT_EAT_NONE
  71.                 end
  72.                
  73.                 if words[2] !~ /(~|&|@)/ then return XCHAT_EAT_NONE end
  74.                
  75.                 wordarr = words[1].split(" ")
  76.                 wordarr.slice!(0)
  77.                 myphrase = wordarr.join(" ")
  78.                 if myphrase.length < 1 then myphrase = triggerUser end
  79.                 command( "cs op #{currentChannel}" )
  80.                 command( "timer 2 nick WesleyWillis")
  81.                 if currentChannel =~ /^(\#shakesoda)$/i
  82.                     command( "timer 3 say .timeban #{myphrase} 4s SUCK A CHEETA'S DICK" )
  83.                 else
  84.                     command( "timer 3 kick #{myphrase} SUCK A CHEETA'S DICK" )
  85.                 end
  86.                 command( "timer 5 nick #{myNick}")
  87.             when /^\.monsterkill/i
  88.                 if words[2] !~ /(~|&|@)/ then return XCHAT_EAT_NONE end
  89.                 wordarr = words[1].split(" ")
  90.                 wordarr.slice!(0)
  91.                 myphrase = wordarr.join(" ")
  92.                 if myphrase.length < 1 then myphrase = triggerUser end
  93.                 command( "cs op #{currentChannel}" )
  94.                 command( "timer 2 kick #{myphrase} HEADSHOT" )
  95.                
  96.                
  97.                
  98.                
  99.             # Random number generator X x Y
  100.             when /^\.rand/i
  101.                 wordarr = words[1].split(" ")
  102.                 wordarr.slice!(0)
  103.                 myphrase = wordarr.join(" ")
  104.                
  105.                 if myphrase.match(/^([^ ]+?)$/i) != nil
  106.                     command( "say Nothing here." )
  107.                 end
  108.                
  109.                 if myphrase.match(/^(-?\d+?) (-?\d+?)$/i) != nil
  110.                     x = Integer(myphrase.match(/^(-?\d+?) (-?\d+?)$/i)[1])
  111.                     y = Integer(CGI::escape(myphrase.match(/^(-?\d+?) (-?\d+?)$/i)[2]))
  112.                     puts "X=#{x} Y=#{y}"
  113.                     if y > x
  114.                         srand();
  115.                         command("say #{triggerUser}, your number is... #{x + rand(y-x)}.")
  116.                     elsif y == x+1
  117.                         command("say Your second number must be greater than your first number + 1.")
  118.                     else
  119.                         command("say Your second number must be larger than your first.")
  120.                     end
  121.                 end
  122.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement