mIRC !Slap Game

Moderator: GeekShed.Net Staff

mIRC !Slap Game

Postby MLT » Wed Jul 06, 2011 3:40 am

Code: Select all
;theSLAP 2.0
on *:join:#:{
  if ($nick != $me) {
    var %u users_ $+ $nick
    if (!$readini(slapthegame.ini,%u,hp)) {
      writeini slapthegame.ini %u hp 100
      writeini slapthegame.ini %u money 15
    }
  }
  ;notice $nick Wellcome. This Channel has SLAPtheGame installed. go on and !slap :)
}
on *:text:!thegame:#:{
  notice $chan Noob in town :) !slap $nick everyone :D
  msg $chan !slap, !heal, !money, !gamble, !stats, !ladder, !alive, !beer, !punch (2.0)
}
on *:text:!money:#:{
  var %u users_ $+ $nick
  if ($readini(slapthegame.ini,%u,money) < 15) {
    writeini slapthegame.ini %u money 15
    notice $nick Your wallet has been refiled with 15coins
  }
  else {
    notice $nick Oi! this isn't a bank, Sir.
  }
}

on *:text:!slap*:#:{
  if (!$2) {
    notice $nick usage: !slap NICK
    notice $nick !slap command will trigger the end of the world. Go on, !slap someone :)
    halt
  }
  var %s1H $readini(slapthegame.ini,$+(users,_,$nick),hp)
  var %s2H $readini(slapthegame.ini,$+(users,_,$2),hp)
  if (%s2H < 1) && ($2 != me) {
    msg $chan player $2 is dead. You can !heal $2 for the price of 15coins and slap him to death again :)
    halt
  }
  if (%s1H > 0) {
    var %slapper $nick
    var %slapped $2

    if (%slapped !ison $chan) && (%slapped != me) {
      msg $chan That payer isn't online, not fair.
      halt
    }
    if (%slapped == me) { msg $chan Ye, I'm gona slap you real nice :D whatta tool! :) | var %slapper $me | var %slapped $nick }
    ;if (%slapped == $me) && ($nick != MoshMage) { msg $chan You wish? | halt }

    var %slap $rand(0,100)
    ;msg $chan Slap power %slap
    if (%slap >= 70) {
      var %slap_sneak 1
      slap2 $chan %slapper %slapped %slap %slap_sneak
    }
    if (%slap > 50) && (%slap <= 69) {
      ;notice %slapped OI! !dodge NOW or you'll be slapped!! $chan
      inc %slaps
      ;.$+(timer,Slap,%slaps) 1 5 slap2 $chan %slapper %slapped %slap %slap_sneak
      slap2 $chan %slapper %slapped %slap %slap_sneak
    }
    if (%slap == 50) {
      slap2 $chan %slapper %slapped %slap
      msg $chan %slapped was watching sharply and grabbed %slapper $+ 's hand, no harm done.
    }
    if (%slap < 50) {
      slap2 $chan %slapper %slapped %slap
    }
  }
  else {
    msg $chan Look! A ghost trying to Slap. How funny :)
    notice $nick you are DEAD. !heal to buy 100hp.
  }
}
alias slap2 {
  var %dmg $4
  var %slapped $+(users,_,$3)
  var %slapper $+(users,_,$2)
  var %s1H $readini(slapthegame.ini,%slapper,hp)
  var %s2H $readini(slapthegame.ini,%slapped,hp)
  if (%dmg < 50) {
    var %life $calc(%s1H - %dmg)
    if (%life < 0) { var %life 0 }
    writeini slapthegame.ini %slapper hp %life
    msg $1 $3 saw right trhough $2 $+ 's movement and counterslaps. $iif(%life < 1,AAAnd $2 is knockedout!! Cheers $+ $chr(44) $3 $+ !)
    notice $2 $3 counterslaped you, $iif(%life > 0, you have %life $+ hp,you're dead. !heal)
    if (%life < 0) {
      var %deaths $readini(slapthegame.ini,%slapper,deaths)
      var %deaths $calc(%deaths +1)
      var %kills $readini(slapthegame.ini,%slapped,kills)
      var %kills $calc(%kills +1)
      writeini slapthegame.ini %slapped kills %kills
      writeini slapthegame.ini %slapper deaths %deaths
    }
  }
  if (%dmg == 50) {
    msg $1 $3 was watching sharply and grabbed $2 $+ 's hand, no harm done. Also.. fucking amazing.
  }
  if (%dmg > 50) {
    var %life $calc(%s2H - %dmg)
    echo -a %life - %dmg - %s2H
    if (%life < 1) {
      var %deaths $readini(slapthegame.ini,%slapped,deaths)
      var %kills $readini(slapthegame.ini,%slapper,kills)
      var %deaths $calc(%deaths +1)
      var %kills $calc(%kills +1)
      writeini slapthegame.ini %slapper kills %kills
      writeini slapthegame.ini %slapped deaths %deaths
    }
    if (%life < 0) { var %life 0 }
    writeini slapthegame.ini %slapped hp %life
    if ($5 > 0) {
      var %money $rand(1,50)
      var %s1M $readini(slapthegame.ini,%slapper,money)
      var %s2M $readini(slapthegame.ini,%slapped,money)

      var %coins $calc(%money + %s1M)
      var %slapmsg $2 sneaks in on $3 and smacks his[er] face upright.
      notice $2 Whoa! whattasmack! You popped %money $+ coins from $3 $+ 's pocket :) (Wallet: %coins $+ )
      writeini slapthegame.ini %slapper money %coins
      ;steal ability?
      ;notice %slapped That Sir, was a Gloved Slap in teh Face. Also, you lost some coins.
      ;writeini slapthegame.ini %slapper money $calc(%s2M - %money)
    }
    if (!%slapmsg) { var %slapmsg $2 boldly slaps $3 $+ . }
    msg $1 %slapmsg
    notice $3 $2 slaped you, $iif(%life > 0, you have %life $+ hp,you're dead. !heal)
  }
  dec %slaps
  ;echo -a SLAPED $3 - $2 : %dmg
}
on *:text:!heal*:#:{
  var %u users_ $+ $iif($2,$2,$nick)
  if ($readini(slapthegame.ini,%u,money)) {
    var %slapper users_ $+ $nick
    var %s1M $readini(slapthegame.ini,%slapper,money)
    if (%s1M >= 15) {
      var %money $calc(%s1M - 15)
      writeini slapthegame.ini %slapper money %money
      writeini slapthegame.ini %u hp 100
      notice $remove(%slapper,users_) Medic Kit used :) Wallet: %money
      if (%u != $remove(%slapper,users_)) { msg $chan $nick healed $2 }
    }
    else {
      msg $chan Not enough cash! (15coins. You have %s1M $+ )
    }
  }
  else {
    msg $chan Not enough cash! (15coins. You have %s1M $+ )
  }
}

on *:text:!gamble*:#:{
  if ($2 == tehBunny) {
    var %s2M $readini(slapthegame.ini,gamble,money)
    msg $chan tehBuny holds %s2M coins for the lucky winner :)
    halt
  }
  if (!$3) || ($2 !isnum) || ($3 !isnum) { describe $chan Gamble How to: !gamble <cash> <1, 2 or 3> }
  else {
    var %bet $2
    var %bet_nick users_ $+ $nick
    var %s1M $readini(slapthegame.ini,%bet_nick,money)
    if (%bet > %s1M) {
      msg $chan Mate, you're short on Cash.
      halt
    }
    var %s2M $readini(slapthegame.ini,gamble,money)

    ;var %lie $rand(0,1)
    var %box $rand(1,102)
    if (%box < 95) { var %bunny 0 }
    if (%box >= 95) { var %bunny 1 }

    if (%box <= 34) { var %box 1 }
    if (%box > 34) && (%box <= 68) { var %box 2 }
    if (%box > 68) { var %box 3 }
    var %prize $rand(1,500)
    if (%prize > 350) { var %prize item }
    else { var %prize $calc(%bet * 2) }
    var %prize $calc(%bet * 2)
    ;echo %box
    if ($3 == %box) {
      msg $chan $iif(!%bunny,Well done. Won %prize,WOW!WOW!WOW! $nick won 3te5hB6u7n11n15y!! Grand Prize is $calc(%s2M + %prize))
      if (%bunny < 1) { var %money $calc(%s1M + %prize) }
      if (%bunny == 1) { var %money $calc(%s1M + %prize + %s2M) }
      if (%prize) && ($nick !isin %beer) {
        msg $chan WOW! You have access to BOOZE! and !beer has its downs and lows but you can always get drunk on it :) (one hour 'till the bar closes)
        set %beer $addtok(%beer,$nick,32)
        .timerbeer_ $+ $nick 1 3600 set %beer $remtok(%beer,$nick,1,32)
      }
      writeini slapthegame.ini %bet_nick money %money
      notice $nick Your wallet has %money $+ . You won $iif(!%bunny,%prize,$calc(%s2M + %prize))
    }
    else {
      var %lost $calc(%s1M - %bet)
      msg $chan Better luck next time.. tehBunny $calc(%s2M + %prize)
      writeini slapthegame.ini gamble money $calc(%s2M + %prize)
      writeini slapthegame.ini %bet_nick money %lost
    }
  }
}
on *:text:!stats*:#:{
  var %u users_ $+ $iif($2,$2,$nick)
  if ($ini(slapthegame.ini,%u,0)) {
    unset %stats
    var %inis $ini(slapthegame.ini,%u,0)
    var %x 1
    ;echo %inis $ini(slapthegame.ini,%u,0)
    while (%x <= %inis) {
      set %stats %stats $+(,$ini(slapthegame.ini,%u,%x),:,$readini(slapthegame.ini,%u,$ini(slapthegame.ini,%u,%x)))
      ;echo  $ini(slapthegame.ini,%u,%x) $readini(slapthegame.ini,%u,$ini(slapthegame.ini,%u,%x))
      inc %x
    }
    if (%stats) {
      var %k $readini(slapthegame.ini,%u,kills)
      var %d $readini(slapthegame.ini,%u,deaths)
      var %m $readini(slapthegame.ini,%u,money)
      if (%k < %d) {
        var %score $calc( ( %k - ( 0.5 * %d ) ) * %m / 100)   
      }
      else {
        var %score $calc( ( %k - %d ) * %m / 100)
      }
      msg $chan $remove(%u,users_) stats are %stats score %score
    }
  }
}
on *:text:!ladder:#:{
  unset %nicks
  unset %l*
  var %x 0
  while (%x <= $ini(slapthegame.ini,0)) {
    var %u $ini(slapthegame.ini,%x)
    if ($me !isin %u) {
      var %k $readini(slapthegame.ini,%u,kills)
      var %d $readini(slapthegame.ini,%u,deaths)
      var %m $readini(slapthegame.ini,%u,money)
      if (%m <= 0) { var %m 1 }
      if (%k < %d) {
        var %score $calc( ( %k - ( 0.5 * %d ) ) * %m / 100)   
      }
      else {
        var %score $calc( ( %k - %d ) * %m / 100)
      }
      if (%score > 0) {
        set %lscore $addtok(%lscore,%score,32)
        var %f $remove(%u,users_)
        set %lnscore $addtok(%lnscore,$+(%f,$chr(40),%score,$chr(41)),32)
      }
    }
    inc %x
  }
  if (%lscore) {
    var %sscore $sorttok(%lscore,32,nr)
    var %w $numtok(%lscore,32)
    var %l 0
    while (%l <= %w) {
      var %snick $gettok(%sscore,%l,32)
      var %n $matchtok(%lnscore,%snick,1,32)
      set %nicks $addtok(%nicks,%n,32)
      inc %l
    }
  }
  msg $chan slapLadder %nicks
}
on *:text:!alive*:#:{
  var %u users_ $+ $iif($2,$2,0)
  if (%u == users_0) {
    var %x 1
    var %z 0
    while (%x <= $nick($chan,0)) {
      if ($nick($chan,%x) != $me) {
        var %n $+(users_,$nick($chan,%x))
        var %hp $readini(slapthegame.ini,%n,hp)
        if (%hp > 0) {
          var %n $remove(%n,users_)
          var %s $+(,%n,,$chr(40),%hp,$chr(41),hp)
          var %alives $addtok(%alives,%s,32)
          inc %z
        }
      }
      inc %x
    }
    if (%z) {
      msg $chan Found $numtok(%alives,32) White-Gloved Gent. %alives
    }
    if (!%z) {
      msg $chan OMG! OMG! EVERYONE IS DEAAAATH! This, sir, is a Ghost Town. !heal someone.
    }
  }
  else {
    var %life $readini(slapthegame.ini,%u,hp)
    var %c users_ $+ $nick
    var %c $readini(slapthegame.ini,%c,money)
    msg $chan Player $remove(%u,users_) is $iif(%life > 0,Alive : $+ $chr(41),Death and you have $+(%c,coins))
  }
}
on *:text:!punch*:#:{
  ;ONLY DRUNK MAN AND SMALL MINDED PEOPLE PUNCH!
  if (!$2) { msg $chan look at the drunktard, doesn't even know who to punch. }
  else {
    var %puncher users_ $+ $nick
    var %punched users_ $+ $2
    var %hp $readini(slapthegame.ini,%puncher,hp)
    var %hp2 $readini(slapthegame.ini,%punched,hp)
    if (%hp > 0) {
      var %w $+(*,$2,*)
      if (%hp2 <= 0) {
        msg $chan $nick stumbles his feet on $2 $+ 's grave. Only drunk man punch.
        var %lost $rand(1,20)
        var %hp $calc(%hp - %lost)
        writeini slapthegame.ini %puncher hp %hp
        notice $nick You lost %lost $+ hp, you have %hp health points.
        unset %hp2
      }
      elseif (!$read(slapthegame.ini,w,%w)) || ($nick !isin %beer) {
        msg $chan $nick Punches the air and stumbles on his feet. Only drunk man punch.
        var %lost $rand(1,20)
        var %hp $calc(%hp - %lost)
        writeini slapthegame.ini %puncher hp %hp
        notice $nick You lost %lost $+ hp, you have %hp health points.
        ;halt
      }
      else {
        var %p $rand(1,25)
        if ($nick isin %beer) {
          var %beers $readini(slapthegame.ini,%puncher,beers)
          var %tb $calc(%beers *0.5)
          var %p $calc(%p * %tb)
        }
        if (%p >= 25) {
          var %hp $readini(slapthegame.ini,%punched,hp)
          var %f $calc(%hp - 50)
          if (%f > 0) {
            msg $chan It's amazing HOW $nick landed that punch. $remove(%punched,users_) $+ 's face will swell. %beers beer mugs were consumed for our amuse :)
            notice $remove(%punched,users_) You suffered a punch to teh face. $nick $+ 's little punk. you have %f $+ hp.
          }
          else {
            msg $chan the Drunktard punch: It can, and did, Kill. $remove(%punched,users_) Died. (note that, to land this punch $nick drunk %beers beer mugs)
            notice $remove(%punched,users_) That flippin honourless drunkar, $nick $+ , punched you. You were knocked out, !heal
          }
          notice $nick After such an amazing performance, the effect of the booze went away. such a shame.
          writeini slapthegame.ini %punched hp %f
          writeini slapthegame.ini %puncher beers 0
          set %beer $remtok(%beer,$nick,1,32)
        }
        else {
          msg $chan $nick Stumbles down for our amuse. Good one, Jester! :)
          var %hp $readini(slapthegame.ini,%puncher,hp)
          var %f $calc(%hp - 50)
          if (%f > 0) {
            notice $nick You bashed your head while on that poor performance. %f $+ hp.
          }
          else {
            notice $nick That blow to the head was really something. You knocked yourself out. !heal
          }
          writeini slapthegame.ini %puncher hp %f
        }
      }
    }
    else {
      msg $chan You are death, nick. !heal before punching. (Only drunk man punch.)
    }
  }
}

;items.name_price[-quantity]
;
;beer.30-1

on *:text:!beer*:#:{
  if ($nick !isin %beer) {
    msg $chan Bar's VIP only. earn vip status by !gambleing your money away :)
  }
  else {
    if ($2) {
      msg $chan Oh yeah, i know you wantz teh $iif($2 isnum,$2 beer mugs,beer mug) fast.
    }
    var %u users_ $+ $nick
    var %m $readini(slapthegame.ini,%u,money)
    var %b $readini(slapthegame.ini,%u,beers)
    if ($2 isnum) { var %hm $2 }
    if (%hm > 1) {
      var %m $calc(%m - (%hm * 30))
      var %b $calc(%b + %hm)
    }
    elseif (!%hm) || (%hm == 1) {
      var %m $calc(%m -30)
      var %b $calc(%b +1)   
    }
    if (%m > 0) {
      msg $chan $nick BOUGHT A BEER MUG! KEEP BEING AWESOME!
      writeini slapthegame.ini %u beers %b
      writeini slapthegame.ini %u money %m
    }
    if (%m < 0) {
      msg $chan $nick You poor twat. You already spent your money?! $duration($timer(beer_ $+ $nick).secs,2) till you loose Bar access
    }
  }
}


Rather a long code, but a fun game.
NOTE: This is my version of the script, many versions are out there.
-MLT
MLT
 
Posts: 1
Joined: Wed Jul 06, 2011 3:32 am

Return to Script help

Who is online

Users browsing this forum: No registered users and 5 guests

cron