All pastes #492080 Raw Edit

Bomb Script

public text v1 · immutable
·published 2007-05-17 00:16 UTC
rendered paste body
ON *:LOAD:{
  set %BombOn 1
  set %BombTimerMin 20
  set %BombTimerMax 40
  set %BombColorSelect Normal
  set %BombScriptStatus Enabled
  set %BombColorListOpp Extended
}

ON *:TEXT:!Bomb*:#:{
  if ($2 == stop) && ($nick isop $chan) && (%BG1BombPlanted == 1) && ($chan == %BG1BombedChan) {
    if (%BG1Planter !isop $chan) {
      if (!$3) {
        msg $chan 4The bomb dissolves into dust.
        set %BombedNick2 %BG1BombedNick
        CleanBombVars
        halt
      }
      elseif ($3 == kick) {
        kick %BG1BombedChan %BG1Planter $4- ( $+ $nick $+ )
        msg %BG1BombedChan 4The bomb dissolves into dust.
        set %BombedNick2 %BG1BombedNick
        CleanBombVars
        halt
      } 
      elseif ($3 == ban) {
        ban -ku $+ $4 %BG1BombedChan %BG1Planter $5- (Kick/Banned for $duration($4) ( $+ $nick $+ ))
        msg %BG1BombedChan 4The bomb dissolves into dust.
        set %BombedNick2 %BG1BombedNick
        CleanBombVars
        halt
      } 
      else {
        msg %BG1BombedChan 4The bomb dissolves into dust.
        set %BombedNick2 %BG1BombedNick
        CleanBombVars
        halt
      } 
    } 
    else {
      msg %BG1BombedChan 4The bomb dissolves into dust.
      set %BombedNick2 %BG1BombedNick
      CleanBombVars
      halt
    }
  }
  elseif ($2 == blow) && ($nick isop $chan) && (%BG1BombPlanted == 1) && (%BG1Planter != $me) && (%BG1BombedNick != $me) && ($chan == %BG1BombedChan) {
    TimeUp
    halt
  }
  elseif ($2 == showvars) && ($nick isop $chan) {
    notice $nick 5 $+ $chr(37) $+ BombTimerMin=4 $+ %BombTimerMin $+ 5, $chr(37) $+ BombTimerMax=4 $+ %BombTimerMax $+ 5, $chr(37) $+ BombColorSelect=4 $+ %BombColorSelect $+ 5, $&
      $chr(37) $+ BombedNick=4 $+ $iif(!%BG1BombedNick,$chr(36) $+ null,%BG1BombedNick) $+ 5, $chr(37) $+ BombedNick2=4 $+ $iif(!%BombedNick2,$chr(36) $+ null,%BombedNick2) $+ 5, $&
      $chr(37) $+ BombedChan=4 $+ $iif(!%BG1BombedChan,$chr(36) $+ null,%BG1BombedChan) $+ 5, $chr(37) $+ BombColors=4 $+ $iif(!%BG1BombColors,$chr(36) $+ null,%BG1BombColors)
    halt
  }
  elseif ($2 == set) && ($nick isop $chan) {
    if (!$3) {
      notice $nick 5Commands: 4!Bomb set [ON/OFF], !Bomb set colors [NORMAL/EXTENDED], !Bomb set timer [MIN] [MAX]
      halt
    }
    elseif ($3 == on) {
      if (%Bombon == 1) {
        notice $nick 5The script is already enabled!
        halt
      }
      else {
        set %Bombon 1
        msg $chan 5!Bomb script enabled!
        set %BombScriptStatus Disable
        CleanBombVars
        halt
      } 
    }
    elseif ($3 == off) {
      if (%Bombon == 0) {
        notice $nick 5The script is already disabled!
        halt
      }
      else {
        set %Bombon 0
        msg $chan 5!Bomb script disabled!
        set %BombScriptStatus Enable
        CleanBombVars
        halt
      } 
    }
    elseif ($3 == colors) {
      if ($4 == normal) {
        set %BombColorSelect Normal
        set %BombColorListOpp Extended
        msg $chan 4Normal 5bomb colors are now in use!
        halt
      }
      elseif ($4 == extended) {
        set %BombColorSelect Extended
        set %BombColorListOpp Normal
        msg $chan 4Extended 5bomb colors are now in use!
        halt
      }
      else {
        notice $nick 5Use 4!bomb set colors [NORMAL/EXTENDED] 5to choose the color list to use.
        halt
      }
    }
    elseif ($3 == timer) {
      if ($4) && ($5) {
        set %BombTimerMin $4
        set %BombTimerMax $5
        msg $chan 5The bomb timer is now between4 %BombTimerMin 5and4 %BombTimerMax 5(default 20 and 40)
        halt
      }
      else {
        notice $nick 5Use 4!bomb timer [MIN] [MAX] 5(default is 20 and 40)
      }
    }
    else {
      halt
    }
  }
  elseif (%Bombon == 1) && (%BG1BombPlanted != 1) {
    if ($2 == $null) { 
      notice $nick 5Use4 !Bomb [NICK] (optional)[REASON] 5to make that person have to defuse the bomb. 
      halt
    }
    elseif ($2 !ison $chan) { 
      msg $chan 5That user does not exist. 
      halt
    }
    elseif ($nick($chan,$2).idle >= 300) {
      msg $chan 5Sorry, that user is idle
      halt
    } 
    else {
      BombSetColorVars
      :FixColors2
      if (%BombColorSelect == Extended) {
        set %BG1BombColor1 $gettok( %BombColorList1,$r(1,$numtok( %BombColorList1,32)),32)
        set %BG1BombColor2 $gettok( %BombColorList2,$r(1,$numtok( %BombColorList2,32)),32)
        set %BG1BombColor3 $gettok( %BombColorList3,$r(1,$numtok( %BombColorList3,32)),32)
      } 
      else {
        set %BG1BombColor1 $gettok(%BombColorListNorm,$rand(1,$numtok(%BombColorListNorm,32)),32)
        set %BG1BombColor2 $gettok(%BombColorListNorm,$rand(1,$numtok(%BombColorListNorm,32)),32)
        set %BG1BombColor3 $gettok(%BombColorListNorm,$rand(1,$numtok(%BombColorListNorm,32)),32)
      }
      goto FixColors
      halt
      :FixColors
      if (%BG1BombColor1 == %BG1BombColor2) || (%BG1BombColor2 == %BG1BombColor3) || (%BG1BombColor1 == %BG1BombColor3) {
        goto FixColors2
        halt
      } 
      else {
        $SetBombVars($nick,$2,$chan,$3-)
        if ($2 == $me) {
          msg %BG1BombedChan 4I will not allow that!
          set %BG1BombTimer %BG1BombTimer - 10
          set %BG1BombedNick $nick
          set BombKickMsg 4Think twice before trying to bomb the bot!
        }
        set %BG1BombTimer2 $floor( $calc( %BG1BombTimer / 3 * 2 ) )
        describe %BG1BombedChan 5straps a bomb onto4 %BG1BombedNick $+ 's 5chest.4 %BG1BombedNick 5has4 %BG1BombTimer 5seconds to defuse the bomb. The wire colors $&
          are4 $replace( $lower(%BG1BombColor1),_,$chr(32)) $+ 5,4 $replace( $lower(%BG1BombColor2),_,$chr(32)) $+ 5, and4 $replace( $lower(%BG1BombColor3),_,$chr(32)) $+ 5. Type 4!cutwire COLOR 5to cut a wire!
        timerBombBeep 1 %BG1BombTimer2 msg %BG1BombedChan 4beep... beep... beep...
        timerBombBlow 1 %BG1BombTimer TimeUp
        halt
      } 
    } 
  }
  elseif (%BG1BombPlanted == 1) {
    notice $nick 5There's already a bomb set!
    halt
  }
  else {
    notice $nick 5Sorry, the script is currently disabled
    halt
  }
}

ON *:TEXT:!cutwire*:%BG1BombedChan:{
  var %CWZ $lower($replace($gettok(%BG1BombColors,$rand(1,3),32),_,$chr(32)))
  var %CWA $replace(%CWZ,a,$null,e,$null,i,$null,o,$null,u,$null,$chr(32),_)
  var %CWB $replace($2-,a,$null,e,$null,i,$null,o,$null,u,$null,$chr(32),_)
  var %CWC $replace(%BG1BombColors,a,$null,e,$null,i,$null,o,$null,u,$null)
  if (%BG1BombPlanted == 1) && ($nick == %BG1BombedNick) && ($2) {
    if ($gettok(%CWC,1,32) != %CWB) && ($gettok(%CWC,2,32) != %CWB) && ($gettok(%CWC,3,32) != %CWB) { msg $chan 5There's no wire of that color! | halt }
    elseif (%CWA != %CWB) {
      if (%BG1BombedNick isop %BG1BombedChan) {
        msg %BG1BombedChan 5You cut the wrong wire! You should've cut the4 %CWZ 5wire!
        msg %BG1BombedChan %Kaboom
        set %BombedNick2 %BG1BombedNick
        CleanBombVars
        halt
      } 
      else {
        msg %BG1BombedChan 5You cut the wrong wire! You should've cut the4 %CWZ 5wire!
        $iif(%BG1BombKickMsg != $null,ban -ku2 %BG1BombedChan %BG1BombedNick %Kaboom ( $+ %BG1BombKickMsg $+ ),ban -ku2 %BG1BombedChan %BG1BombedNick %Kaboom)
        set %BombedNick2 %BG1BombedNick
        CleanBombVars
        halt
      } 
    } 
    elseif (%BG1BombPlanted == 1) && ($nick == %BG1BombedNick) && (%CWA == %CWB) {
      msg %BG1BombedChan 4Bomb has been defused! You win!
      set %BombedNick2 %BG1BombedNick
      CleanBombVars
      halt
    } 
  } 
  else {
    halt 
  } 
}

ON *:TEXT:!counter-attack:#:{
  if (%BG1Planter != $me) {
    if (%BG1BombPlanted == 1) && ($nick == %BG1BombedNick) && ($nick == %BombedNick2) && ($chan == %BG1BombedChan) {
      if (%BG1Planter !isop %BG1BombedChan) {
        kick %BG1BombedChan %BG1Planter %Zing (Owned by $nick $+ ) 
        CleanBombVars
        halt
      }
      else {
        msg $chan 4God comes down from above, and He says, 'I shall not smite thine enemy.'
        msg $chan 4The bomb dissolves into dust.
        CleanBombVars
        halt
      }
    }
  }
  else {
    msg $chan 4I will do no such thing!
    halt
  }
}

ON *:NICK:{
  if ($nick == %BombedNick2) {
    set %BombedNick2 $newnick
    halt
  }
  elseif (%BG1BombPlanted == 1) {
    if (%BG1BombedNick != $null) {
      if ($nick == %BG1BombedNick) {
        set %BG1BombedNick $newnick
        halt
      } 
      elseif ($nick == %BG1Planter) {
        set %BG1Planter $newnick
        halt
      }
    }
  }
}

ON *:QUIT:{
  if (%BG1BombPlanted == 1) && ($nick == %BG1BombedNick) {
    msg %BG1BombedChan 4Chicken...
    CleanBombVars
  }
}

ALIAS -l TimeUp {
  if (%BG1BombedNick isop %BG1BombedChan) {
    msg %BG1BombedChan %Kaboom
    CleanBombVars
    halt
  } 
  else {
    $iif(%BG1BombKickMsg != $null,ban -ku2 %BG1BombedChan %BG1BombedNick %Kaboom ( $+ %BG1BombKickMsg $+ ),ban -ku2 %BG1BombedChan %BG1BombedNick %Kaboom)
    CleanBombVars
    halt
  }
}

ALIAS -l SetBombVars {
  set %BG1BombColors %BG1BombColor1 %BG1BombColor2 %BG1BombColor3
  set %BG1Planter $1
  set %BG1BombedNick $2 
  set %BG1BombedChan $3
  set %BG1BombTimer $rand(%BombTimerMin,%BombTimerMax)
  set %BG1BombPlanted 1
  set %BG1BombKickMsg $4-
  set %Kaboom 8,1*K7AB4OO7M!8*
  set %Zing 8,1*Z7IN4G!7*
}

ALIAS -l CleanBombVars {
  unset %BG1*
  timerBombBeep off
  timerBombBlow off
}

ALIAS -l BombSetColorVars {
  set %BombColorListNorm red orange yellow green blue indigo violet

  set %BombColorList1 Alizarin Burgundy Cardinal Carmine Cerise Chestnut Crimson Falu_red Fire_engine_red Girlsnberry Maroon Mauve Red Red-violet Rust Puce Sangria Scarlet Terracotta $&
    Vermilion Amaranth Rose Hollywood Cerise Shocking_Pink Coral Red Pomegranate Persian_red Pink Dark_Pink Venetian_red Fuchsia Magenta Orange Amber Coral Dark_salmon $&
    Gamboge Mahogany Peach Peach-orange Peach-yellow Pink-orange Pomegranate Pumpkin Rust Safety_orange Salmon Tangerine Tawny Amber Vermilion Burnt_Orange $&
    Apricot Carrot_Orange Orange_Peel Brown-Amber Beige Buff Corn Cream Dark_Goldenrod Ecru Flax Gamboge Golden Goldenrod Khaki Lemon Lemon_Cream Lime Mustard Navajo_white

  set %BombColorList2 Old_Gold Olive Papaya_whip Peach-yellow Pear Saffron School_bus_yellow Tangerine_yellow Yellow Apricot Metallic_Gold Chartreuse_yellow Golden_yellow $&
    Golden_poppy Green-yellow Asparagus Bright_green Camouflage_green Celadon Chartreuse Emerald Fern_green Gray-asparagus Green Green-yellow $&
    Jade Lime Moss_green Myrtle Olive Olive_drab Pear Pine_green Sea_green Spring_green Swamp_green Tea_green Forest_green Chartreuse_yellow Harlequin Office_green $&
    Lime_pulp Hunter_green Kelly_green Shamrock_green Islamic_green Lime_green Persian_green Alice_blue Aqua Aquamarine Baby_blue Bondi_blue Cerulean Cyan Pine_green

  set %BombColorList3 Robin_egg_blue Teal Turquoise Viridian Alice_blue Azure Blue Cerulean Cerulean_blue Cobalt_blue Cornflower_blue Dark blue Denim Dodger_blue Indigo Klein_Blue Lavender $&
    Midnight_Blue Navy_blue Periwinkle Persian_blue Powder_blue Prussian_blue Royal_blue Sapphire Steel_blue Ultramarine Light_blue Baby_blue Amethyst $&
    Cerise Eggplant Fuchsia Heliotrope Indigo Lavender Lavender_blush Lavender_gray Lavender_rose Lilac Magenta Mauve Mountbatten_pink Orchid Palatinate Purple $&
    Persian_indigo Purple Red-violet Rose Sangria Thistle Violet Violet-eggplant Wisteria_Pink Carnation Fuchsia Magenta Salmon_Pink Deep_Pink Hollywood_Cerise Hot_Pink
}

menu menubar {
  !Bomb Script
  .%BombScriptStatus:{ 
    echo -m 4!Bomb script $lower(%BombScriptStatus) $+ d!
    $iif(%BombScriptStatus == Enable,set %BombOn 1, set %BombOn 0)
    $iif(%BombScriptStatus == Enable,set %BombScriptStatus Disable, set %BombScriptStatus Enable)
  }
  .Set
  ..Timer...:{
    :SetTimer
    var %BG1BombTimerMinTemp = $$?="Enter the minimum timer limit:", %BG1BombTimerMaxTemp = $$?="Enter the maximum timer limit:"
    if (%BG1BombTimerMinTemp isnum) && (%BG1BombTimerMaxTemp isnum) {
      set %BG1BombTimerMin %BG1BombTimerMinTemp
      set %BG1BombTimerMax %BG1BombTimerMaxTemp
      echo -m 4The bomb timer is now between %BG1BombTimerMinTemp and %BG1BombTimerMaxTemp $+ !
      halt
    }
    else {
      var %BG1BombTimerFailTemp = $$?!="Error: Both values must be numerals. $crlf $+ $crlf $+ Try again?"
      $iif(%BG1BombTimerFailTemp == $true,goto SetTimer,halt)
    }
  }
  ..Use %BombColorListOpp Color List:{
    echo -m 4 $+ %BombColorListOpp now in use!
    $iif(%BombColorListOpp == Normal,set %BombColorSelect normal, set %BombColorSelect extended)
    $iif(%BombColorListOpp == Normal,set %BombColorListOpp Extended, set %BombColorListOpp Normal)
  }
  .Stop
  ..Stop Current Bomb:{
    if (%BG1BombPlanted == 1) {
      msg %BG1BombedChan 4The bomb dissolves into dust.
      CleanBombVars
      halt
    }
    else {
      halt
    }
  }
  ..Stop and Kick...:{
    if (%BG1BombPlanted == 1) {
      kick %BG1BombedChan %BG1Planter $$?="Reason:"
      msg %BG1BombedChan 4The bomb dissolves into dust.
      CleanBombVars
      halt
    }
    else {
      halt
    }
  }
  ..Stop and Ban...:{
    if (%BG1BombPlanted == 1) {
      var %BBTT = $$?="How long? (in seconds)"
      ban -ku $+ %BBTT %BG1BombedChan %BG1Planter $?="Reason:" (Kick/Banned for $duration(%BBTT))
      msg %BG1BombedChan 4The bomb dissolves into dust.
      CleanBombVars
      halt
    }
    else {
      halt
    }
  }
  .By Teh Maestro:{
    run http://www.fpsbanana.com/
  }
}