!bomb

By Seven_Dayss on Jul 10, 2008

Made for bot only, although it can be used by user too, lol

enjoy..

on *:TEXT:!bomb *:#: {
  if ($2 == $me) { kick # $nick You wanna bomb me?!! | halt }
  elseif ($2 == $nick) {
    set -u10 %bomb 1
    if ($2 ison $chan) && ($me isop $chan) || ($me ishop $chan) {
      set %bomber $nick   
      set %kicknick $2
      set %sec $rand(10,30)
      set %color $rand(1,3)
      set %time $calc( %sec / 1/2 )
      msg $chan Whoa, u wanna suicide, $nick $+ ? Okay, the bomb will explode in %sec seconds!
      msg $chan  $+ $2 $+ , type 4!red, 12!blue or 3!green to cut the wire and deactive the bomb!
      if (%color == 1) { set %color !red }
      if (%color == 2) { set %color !blue }
      if (%color == 3) { set %color !green }
      .timer 1 %time msg #  $+ %time seconds remaining!!
      .timer 1 %sec kick # %kicknick 4(((~~~~~KABOOOOOMMM!!!!~~~~~))) Time's up, dude!
    }
  }
  elseif (%bomb == $null) {
    set -u10 %bomb 1
    if ($2 ison $chan) && ($me isop $chan) || ($me ishop $chan) {
      set %bomber $nick   
      set %kicknick $2
      set %sec $rand(10,30)
      set %color $rand(1,3)
      set %time $calc( %sec / 1/2 )
      msg $chan  $+ $nick planning a bomb on $2 $+ 's butt and will explode in %sec seconds!
      msg $chan  $+ $2 $+ , type 4!red, 12!blue or 3!green to cut the wire and deactive the bomb!
      if (%color == 1) { set %color !red }
      if (%color == 2) { set %color !blue }
      if (%color == 3) { set %color !green }
      .timer 1 %time msg #  $+ %time seconds remaining!!
      .timer 1 %sec kick # %kicknick 4(((~~~~~KABOOOOOMMM!!!!~~~~~))) Congratulation, You were bombed by $nick $+ !
    }
  }
}

on *:TEXT:*:#: {
  if ($nick == %kicknick) {
    if ($1 == %color) {
      msg $chan Great, the bomb is off!
      .timers off
      unset %kicknick
      unset %bomber
    }
    if ($1 == !red) {
      kick $chan %kicknick 4(((~~~~~KABOOOOOMMM!!!!~~~~~))) You just pick up the wrong wire!
      .timers off
      unset %kicknick
      unset %bomber
    }
    if ($1 == !yellow) {
      kick $chan %kicknick 4(((~~~~~KABOOOOOMMM!!!!~~~~~))) You just pick up the wrong wire!
      .timers off
      unset %kicknick
      unset %bomber
    }
    if ($1 == !green) {
      kick $chan %kicknick 4(((~~~~~KABOOOOOMMM!!!!~~~~~))) You just pick up the wrong wire!
      .timers off
      unset %kicknick
      unset %bomber
    }
  }
}

Comments

Sign in to comment.
Grzechooo   -  Aug 23, 2009

You can always set var %wire like

$gettok(!red|!blue|!green,$r(1,3),124)
and then

on :TEXT::#: {
if ($nick == %kicknick) {
if ($1 == %wire) {
msg $chan Great, the bomb is off!

 Respond  
Ghost-writer   -  Jul 29, 2009

yellow-blue just saying :D

 Respond  
Ghost-writer   -  Jul 27, 2009

i had to fix like 20 bugs for it to work with out me being an operator and i added a new color but if i say so myself its pretty good :P added a bit more color :D

 Respond  
Grant-   -  Jul 25, 2009

Typo you could learn something just as well.

msg $chan I am currently $iif($away == $true,Away,Here)
could be

msg $chan I am currently $iif($away,Away,Here)
 Respond  
termz   -  Jul 25, 2009

it always picks blue

 Respond  
dashh   -  Feb 22, 2009
      if (%color == 1) { set %color !red }
      if (%color == 2) { set %color !blue }
      if (%color == 3) { set %color !green }

use $replace(%color,1,!red,2,!blue,3,!green)

=)

if ($1 == !red) {
      kick $chan %kicknick 4(((~~~~~KABOOOOOMMM!!!!~~~~~))) You just pick up the wrong wire!
      .timers off
      unset %kicknick
      unset %bomber
    }
    if ($1 == !yellow) {
      kick $chan %kicknick 4(((~~~~~KABOOOOOMMM!!!!~~~~~))) You just pick up the wrong wire!
      .timers off
      unset %kicknick
      unset %bomber
    }
    if ($1 == !green) {
      kick $chan %kicknick 4(((~~~~~KABOOOOOMMM!!!!~~~~~))) You just pick up the wrong wire!
      .timers off
      unset %kicknick
      unset %bomber
    }

U dont need repeat the same code.
U can use -> ( test isin test hola hello )

($1 isin !red !blue !green !something)

or 

$istok(!red !blue !green,$1,32)

or

$pos(!red!blue!green,green) <-
 Respond  
Typo   -  Jul 10, 2008

Hi Seven_Dayys. I\'m trying to get to bed so excuse any errors and I will answer any questions when I get up tomorrow or if you have any I\'m sure another user can help before I get back on here anyhow.

Try this out. I did not take the time to look into detail at all the code. I simply took and shortened everything into one nice little on text event.

on *:TEXT:*:#: {
  if ($1 == !bomb) {
    if ($2 == $me) { kick # $nick You wanna bomb me?!! | halt }
    elseif ($2 == $nick) || (%bomb == $null) {
      set -u10 %bomb 1
      if ($2 ison $chan) && ($me isop $chan) || ($me ishop $chan) {
        set %bomber $nick   
        set %kicknick $2
        set %sec $rand(10,30)
        set %color $rand(1,3)
        set %time $calc( %sec / 1/2 )
        if ($2 != $nick) { msg $chan  $+ $nick planning a bomb on $2 $+ \'s butt and will explode in %sec seconds! }
        else { msg $chan Whoa, u wanna suicide, $nick $+ ? Okay, the bomb will explode in %sec seconds! }
        msg $chan  $+ $2 $+ , type 4!red, 12!blue or 3!green to cut the wire and deactive the bomb!
        if (%color == 1) { set %color !red }
        if (%color == 2) { set %color !blue }
        if (%color == 3) { set %color !green }
        .timer 1 %time msg #  $+ %time seconds remaining!!
        .timer 1 %sec kick # %kicknick 4(((~~~~~KABOOOOOMMM!!!!~~~~~))) $iif($2 == $nick,Time\'s up, dude!,Congratulation, You were bombed by $nick $+ !)
      }
    }
  }
  if ($nick == %kicknick) && ($1 == %color) { msg $chan Great, the bomb is off! | unsetem }
  elseif ($nick == %kicknick) && ($1 == !red) || ($1 == !green) || ($1 == !yellow) { kick $chan %kicknick 4(((~~~~~KABOOOOOMMM!!!!~~~~~))) You just pick up the wrong wire! | unsetem }
}
alias unsetem {
  .timers off
  unset %kicknick
  unset %bomber
}

The four major things to learn from this is, one, combine all on text events into one whenever possible by using:

on *:TEXT:*:#: { 
  if ($1 == !a) { !a\'s commands }
  if ($1 == !b) { !b\'s commands }
} 

Two, use || for OR and && for AND when building an IF line such as:

If (1 == 1) && (2 == 2) || (3 == 3) { commands }

Three use $iif to throw an if statement into a line to combine lines uch as:

msg $chan I am currently $iif($away == $true,Away,Here)

Instead of using two lines like IF ($away == $true) {msg bla away } and else { msg bla here }
For help on the $iif type /help $iif in mirc for more info. Even expert scripters use the help file all the time, it is very very handy.
And lastly, when you have repetetive code, put it into its own alias to call it like a command or a $command such as:

alias dosomethings {
  unset %settings
  .timers off
  .msg people
  .etc
  .etc
  .etc
}

Which you could then access throughout your script like any normal alias. Its even a good system to use if you have the same message sent a ton of times. Like:

alias mymessage {
.msg $1 My message is in this line and it would be very long no doubt and its a msg I will need to use again and again in this script. 
}

Then you could call it any time by:

On *:text:*:#:{
  if ($chan != $null) { $mymessage($chan }
  elseif ($nick != $null) { $mymessage($nick) }
}
On *:join:#:{ $mymessage($nick) }

The above code is silly but it was just to show a point.

Anyhow, Good Luck and I hope this is a decent help to you.

Btw, that was taken from 75 lines down to 37 :)

 Respond  
Typo   -  Jul 10, 2008

Sorry about the two posts, was an accident.

 Respond  
Seven_Dayss   -  Jul 10, 2008

well, i\'m thinking this script is too long and i know if it can be more simple, but as far as i made, this one is the simplest one,,,,,

if anyone can make it more simple, plz help me!

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.