Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- All of these scripts should be entered into the OnChannelMessage event. It doesn't matter in what order.
- The general idea is to have a notification when a battle starts in Battle Arena.
- 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.
- Note where the following command occurs in the script:
- snd.play $option(stringOnHighlightedMessageSound);
- 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
- Handler BattleClosed
- 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!") {
- for (%i=0;%i<=$length(%BattleChannels);%i++) {
- if (%i == $length(%BattleChannels)) {%BattleChannels[%i][0] = $context.serverIpAddress; %BattleChannels[%i][1] = $chan.name;}
- else {if (%BattleChannels[%i][0] != $context.serverIpAddress || %BattleChannels[%i][1] != $chan.name) {continue;}}
- if (!%BattlesSkipped[%i]) %BattlesSkipped[%i] = 0;
- if (%BattlesSkipped[%i] < 3) {
- if (!$away) snd.play $option(stringOnHighlightedMessageSound);
- }
- %BattleJoined[%i] = 0;
- %BattlesSkipped[%i] += 1;
- return;
- }
- }
- Handler BattleEntered
- if ($3=="$k(4)$b()$me $b()has entered the battle!") {
- for (%i=0;%i<=$length(%BattleChannels);%i++) {
- if (%i == $length(%BattleChannels)) {%BattleChannels[%i][0] = $context.serverIpAddress; %BattleChannels[%i][1] = $chan.name;}
- else {if (%BattleChannels[%i][0] != $context.serverIpAddress || %BattleChannels[%i][1] != $chan.name) {continue;}}
- %BattleJoined[%i]=1;
- %BattlesSkipped[%i]=0;
- return;
- }
- }
- Handler BattleOpen
- 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) {
- for (%i=0;%i<=$length(%BattleChannels);%i++) {
- if (%i == $length(%BattleChannels)) {%BattleChannels[%i][0] = $context.serverIpAddress; %BattleChannels[%i][1] = $chan.name;}
- else {if (%BattleChannels[%i][0] != $context.serverIpAddress || %BattleChannels[%i][1] != $chan.name) {continue;}}
- %BattleJoined[%i]=0
- if (!%BattlesSkipped[%i]) %BattlesSkipped[%i] = 0
- if (%BattlesSkipped[%i] < 3) {
- if (!$away) snd.play $option(stringOnHighlightedMessageSound);
- notifier.message -w=$window "A battle is starting."
- }
- return;
- }
- }
- Handler BattleStarted
- if ($str.match("The weather changes. It is now *", $str.stripcolors($3)) == 1) {
- for (%i=0;%i<=$length(%BattleChannels);%i++) {
- if (%i == $length(%BattleChannels)) {%BattleChannels[%i][0] = $context.serverIpAddress; %BattleChannels[%i][1] = $chan.name;}
- else {if (%BattleChannels[%i][0] != $context.serverIpAddress || %BattleChannels[%i][1] != $chan.name) {continue;}}
- if (!%BattleJoined[%i]) %BattleJoined[%i]=0
- if (%BattleJoined[%i]==1) {
- if (!$away) snd.play $option(stringOnHighlightedMessageSound);
- notifier.message -w=$window "The battle has started."
- } else {
- if (!%BattlesSkipped[%i]) %BattlesSkipped[%i] = 0
- if (%BattlesSkipped[%i] < 3) {
- if (!$away) snd.play $option(stringOnHighlightedMessageSound);
- }
- %BattlesSkipped[%i] += 1
- }
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment