Andrio_Celos

Battle Arena notification scripts for KVIrc

May 4th, 2013
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 3.45 KB | None | 0 0
  1. All of these scripts should be entered into the OnChannelMessage event. It doesn't matter in what order.
  2. The general idea is to have a notification when a battle starts in Battle Arena.
  3. However, the script will also keep count of how many battles you don't enter. If you skip three in a row, the notifications will stop happening.
  4.  
  5. Note where the following command occurs in the script:
  6.   snd.play $option(stringOnHighlightedMessageSound);
  7. This will use the same sound as for a highlight. If you, like me, want a different sound, change the text after snd.play to the path to a sound file you want to use. Note that you need to use escape backslash characters, like this: C:\\Sounds\\Beep.wav
  8.  
  9. Handler BattleClosed
  10. if ($3=="$k(4)There were no players to meet the monsters on the battlefield! $b()The battle is over$b()."||$3=="$k(4)The battle is over!") {
  11.   for (%i=0;%i<=$length(%BattleChannels);%i++) {
  12.     if (%i == $length(%BattleChannels)) {%BattleChannels[%i][0] = $context.serverIpAddress; %BattleChannels[%i][1] = $chan.name;}
  13.     else {if (%BattleChannels[%i][0] != $context.serverIpAddress || %BattleChannels[%i][1] != $chan.name) {continue;}}
  14.     if (!%BattlesSkipped[%i]) %BattlesSkipped[%i] = 0;
  15.     if (%BattlesSkipped[%i] < 3) {
  16.       if (!$away) snd.play $option(stringOnHighlightedMessageSound);
  17.     }
  18.     %BattleJoined[%i] = 0;
  19.     %BattlesSkipped[%i] += 1;
  20.     return;
  21.   }
  22. }
  23.  
  24. Handler BattleEntered
  25.   if ($3=="$k(4)$b()$me $b()has entered the battle!") {
  26.     for (%i=0;%i<=$length(%BattleChannels);%i++) {
  27.       if (%i == $length(%BattleChannels)) {%BattleChannels[%i][0] = $context.serverIpAddress; %BattleChannels[%i][1] = $chan.name;}
  28.       else {if (%BattleChannels[%i][0] != $context.serverIpAddress || %BattleChannels[%i][1] != $chan.name) {continue;}}
  29.       %BattleJoined[%i]=1;
  30.       %BattlesSkipped[%i]=0;
  31.       return;
  32.     }
  33.   }
  34.  
  35. Handler BattleOpen
  36. if ($str.match("A dimensional portal has been detected. The enemy force will arrive in *. type !enter if you wish to join the battle!", $str.stripcolors($3)) == 1) {
  37.   for (%i=0;%i<=$length(%BattleChannels);%i++) {
  38.     if (%i == $length(%BattleChannels)) {%BattleChannels[%i][0] = $context.serverIpAddress; %BattleChannels[%i][1] = $chan.name;}
  39.     else {if (%BattleChannels[%i][0] != $context.serverIpAddress || %BattleChannels[%i][1] != $chan.name) {continue;}}
  40.     %BattleJoined[%i]=0
  41.     if (!%BattlesSkipped[%i]) %BattlesSkipped[%i] = 0
  42.     if (%BattlesSkipped[%i] < 3) {
  43.       if (!$away) snd.play $option(stringOnHighlightedMessageSound);
  44.       notifier.message -w=$window "A battle is starting."
  45.     }
  46.     return;
  47.   }
  48. }
  49.  
  50. Handler BattleStarted
  51. if ($str.match("The weather changes. It is now *", $str.stripcolors($3)) == 1) {
  52.   for (%i=0;%i<=$length(%BattleChannels);%i++) {
  53.     if (%i == $length(%BattleChannels)) {%BattleChannels[%i][0] = $context.serverIpAddress; %BattleChannels[%i][1] = $chan.name;}
  54.     else {if (%BattleChannels[%i][0] != $context.serverIpAddress || %BattleChannels[%i][1] != $chan.name) {continue;}}
  55.     if (!%BattleJoined[%i]) %BattleJoined[%i]=0
  56.     if (%BattleJoined[%i]==1) {
  57.       if (!$away) snd.play $option(stringOnHighlightedMessageSound);
  58.       notifier.message -w=$window "The battle has started."
  59.     } else {
  60.       if (!%BattlesSkipped[%i]) %BattlesSkipped[%i] = 0
  61.       if (%BattlesSkipped[%i] < 3) {
  62.         if (!$away) snd.play $option(stringOnHighlightedMessageSound);
  63.       }
  64.       %BattlesSkipped[%i] += 1
  65.     }
  66.     return;
  67.   }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment