BlueHell mIRC Script — File Browser

BlueHellmIRCScriptv1.0 / BlueHellmIRCScriptv1.0 / BlueHellScript / System / slap.mrc

slap.mrc — 9.2 KB — Download this file

alias -l s.ini { return $+(",$scriptdirslap.ini,") }

ON *:LOAD:{
  writeini -n $s.ini Settings slapversion Slap Script v3.1.1 - 2005/08/26
  //echo 10 -at $chan * $readini($s.ini, n, Settings, slapversion) successfully loaded.
  //echo 10 -at $chan * Type /slapsettings to view/change settings.
  writeini -n $s.ini Settings autoslap on
  writeini -n $s.ini Settings autopoke on
}
ON *:UNLOAD:{ //echo 10 -at $chan * $readini($s.ini, n, Settings, slapversion) successfully unloaded. }

alias slap {
  set -nu0 %chan $chan(#)
  set -nu0 %temp $?1="Please enter the nick to slap."
  if (!%temp) {
    goto cancel
  }
  set -nu0 %weapon $?2="Please enter the weapon to slap with."
  set -nu0 %restweap $3-
  if (%restweap) {
    set -nu0 %weapon %weapon %restweap
  }
  :selectnick
  if (!%temp) {
    goto cancel
  }
  var %checknick = 0
  var %i = $nick(#,0)
  while (%i > 0) { 
    if (%temp iswm $nick(#,%i)) {
      set -nu0 %name $nick(#,%i)
      goto slap
    }
    elseif (%temp isin $nick(#,%i)) {
      inc %checknick
      set -nu0 %name $nick(#,%i)
    }
    dec %i
  }
  if (%checknick < 1) {
    set -nu0 %temp $?="Please enter a nick. No nicks matched your initial selection."
    goto selectnick
  }
  elseif (%checknick > 1) {
    set -nu0 %temp $?="Please enter a more specific nick. %checknick nicks matched your initial selection."
    goto selectnick
  }
  else {
    :slap
    set -nu0 %slaps $readini($s.ini, Totals, slaps)
    set -nu0 %slaptemp $readini($s.ini, n, Users, $address(%name,1))
    inc %slaps 1
    inc %slaptemp 1
    writeini -n $s.ini Totals slaps %slaps
    writeini -n $s.ini Users $address(%name,1) %slaptemp
    if (!%weapon) {
      describe %chan slaps $ial($address(%name,1)).nick $+ ! $+( ,[) $+ %slaptemp $+ / $+ %slaps $+ ]
      set %autoslaptimer $readini($s.ini, Settings, autoslaptimer)
      dec -z %autoslaptimer 1
      goto end
    }
    else {
      describe %chan slaps $ial($address(%name,1)).nick with %weapon $+ ! $+( ,[) $+ %slaptemp $+ / $+ %slaps $+ ]
      set %autoslaptimer $readini($s.ini, Settings, autoslaptimer)
      dec -z %autoslaptimer 1
      goto end
    }
  }
  :cancel
  //echo 10 -t $chan * Slap cancelled.
  :end
}

alias action {
  set -nu0 %chan $chan(#)
  set -nu0 %action $?1="Please enter action in third person form. Procced without entering anything to cancel."
  if (!%action) {
    goto cancel
  }
  set -nu0 %temp $?2="Please enter the nick to slap."
  if (!%temp) {
    goto cancel
  }
  set -nu0 %weapon with $+( ) $+ $?3="Please enter the weapon to attack with. Proceed without entering anything if you want no weapon."
  set -nu0 %restweap $4-
  if (%restweap) {
    set -nu0 %weapon %weapon %restweap
  }
  :selectnick
  if (!%temp) {
    goto cancel
  }
  var %checknick = 0
  var %i = $nick(#,0)
  while (%i > 0) { 
    if (%temp iswm $nick(#,%i)) {
      set -nu0 %name $nick(#,%i)
      goto action
    }
    elseif (%temp isin $nick(#,%i)) {
      inc %checknick
      set -nu0 %name $nick(#,%i)
    }
    elseif (!%temp) {
      goto action
    }
    dec %i
  }
  if (%checknick < 1) {
    set -nu0 %temp $?="Please enter a nick. No nicks matched your initial selection."
    goto selectnick
  }
  elseif (%checknick > 1) {
    set -nu0 %temp $?="Please enter a more specific nick. %checknick nicks matched your initial selection."
    goto selectnick
  }
  else {
    :action
    set -nu0 %slaps $readini($s.ini, Totals, %action)
    set -nu0 %slaptemp $readini($s.ini, n, Users, $address(%name,1))
    inc %slaps 1
    inc %slaptemp 1
    writeini -n $s.ini Totals %action %slaps
    writeini -n $s.ini Users $address(%name,1) %slaptemp
    if (%weapon == with ) {
      describe %chan %action $ial($address(%name,1)).nick $+ ! $+( ,[) $+ %slaptemp $+ / $+ %slaps $+ ]
      set %autoslaptimer $readini($s.ini, Settings, autoslaptimer)
      dec -z %autoslaptimer 1
      goto end
    }
    else {
      describe %chan %action $ial($address(%name,1)).nick %weapon $+ ! $+( ,[) $+ %slaptemp $+ / $+ %slaps $+ ]
      set %autoslaptimer $readini($s.ini, Settings, autoslaptimer)
      dec -z %autoslaptimer 1
      goto end
    }
  }
  :cancel
  //echo 10 -t $chan * Action cancelled.
  :end
}

alias slapback {
  set -nu0 %autoslap $readini($s.ini, n, Settings, autoslap)
  if (%autoslap == off) {
    //echo 10 -t $chan * Autoslap: off.
    goto end
  }
  set -nu0 %chan $chan(#)
  set -nu0 %name $nick
  if (%autoslaptimer > 0) {
    //echo 10 -t $chan * No autoslap rewarded. %autoslaptimer seconds left until autoslap will be re-activated.
  }
  else {
    set -nu0 %slaps $readini($s.ini, Totals, slaps)
    set -nu0 %slaptemp $readini($s.ini, n, Users, $address(%name,1))
    inc %slaps 1
    inc %slaptemp 1
    writeini -n $s.ini Totals slaps %slaps
    writeini -n $s.ini Users $address(%name,1) %slaptemp
    describe %chan dodges $nick $+ 's attack and slaps back! $+( ,[) $+ %slaptemp $+ / $+ %slaps $+ ]
    set %autoslaptimer $readini($s.ini, Settings, autoslaptimer)
    dec -z %autoslaptimer 1
  } 
  :end
}

alias pokeback {
  set -nu0 %autopoke $readini($s.ini, n, Settings, autopoke)
  if (%autopoke == off) {
    //echo 10 -t $chan * Autopoke: off.
    goto end
  }
  if (%autopoketimer > 0) {
    //echo 10 -t $chan * No autopoke rewarded. %autopoketimer seconds left until autopoke will be re-activated.
  }
  else {
    describe $chan pokes $$1 in the eye.
    set %autopoketimer $readini($s.ini, Settings, autopoketimer)
    dec -z %autopoketimer 1
  }
  :end
}

alias autoslap {
  if (on isin $1) {
    writeini $s.ini Settings autoslap on
    //echo 10 -t $chan * Autoslap: on.
  }
  elseif (off isin $1) {
    writeini $s.ini Settings autoslap off
    //echo 10 -t $chan * Autoslap: off.
  }
  else {
    //echo 10 -t $chan * Autoslap: $readini($s.ini, n, Settings, autoslap) $+ . Set autoslap feature on/off by using /autoslap <on|off>.
  }
}

alias autopoke {
  if (on isin $1) {
    writeini $s.ini Settings autopoke on
    //echo 10 -t $chan * Autopoke: on.
  }
  elseif (off isin $1) {
    writeini $s.ini Settings autopoke off
    //echo 10 -t $chan * Autopoke: off.
  }
  else {
    //echo 10 -t $chan * Autopoke: $readini($s.ini, n, Settings, autopoke) $+ . Set autopoke feature on/off by using /autopoke <on|off>.
  }
}

alias view {
  set -nu0 %action $1
  set -nu0 %total $readini($s.ini, Totals, %action)
  if (%total > 0) {
    //echo 10 -t $chan * Total %action $+ : $readini($s.ini, Totals, %action) $+ .
  }
  else {
    //echo 10 -t $chan * No %action accumulated yet.
  }
}

alias slapsettings {
  //echo 10 -t $chan * --- $readini($s.ini, n, Settings, slapversion) ---
  //echo 10 -t $chan *
  //echo 10 -t $chan * /autoslap (currently $readini($s.ini, n, Settings, autoslap) $+ ) : Enables automatic payback slapping when anyone slaps, smacks, kills, attacks, spanks, or hits you.
  //echo 10 -t $chan * :: Type /autoslap <on|off> to enable/disable this feature. Enabled by default.
  //echo 10 -t $chan * /autopoke (currently $readini($s.ini, n, Settings, autopoke) $+ ) : Enables automatic back poking when anyone pokes you.
  //echo 10 -t $chan * :: Type /autopoke <on|off> to enable/disable this feature. Enabled by default.
  //echo 10 -t $chan * /autoslaptimer (currently $readini($s.ini, n, Settings, autoslaptimer) $+ ) : Sets the delay between automatic backslaps; this feature is to protect you from spamming channels.
  //echo 10 -t $chan * :: Type /autoslaptimer <seconds> to set the amount of delay.
  //echo 10 -t $chan * /autopoketimer (currently $readini($s.ini, n, Settings, autopoketimer) $+ ) : Sets the delay between automatic pokes; this feature is to protect you from spamming channels.
  //echo 10 -t $chan * :: Type /autopoketimer <seconds> to set the amount of delay.
  //echo 10 -t $chan * /view : View your current total amount of slaps, hits, kills, etc.
  //echo 10 -t $chan * :: Type /view <action> to view current total of any action.
  //echo 10 -t $chan * /slapversion : Display current version of Slap Script.
  //echo 10 -t $chan * :: Type /slapversion to display current version.
}

alias slapversion {
  //echo 10 -t $chan * Current version of Slap Script: $readini($s.ini, Settings, slapversion) $+ .
}

alias autoslaptimer {
  if ($1 isnum) {
    writeini $s.ini Settings autoslaptimer $1
    //echo 10 -t $chan * Autoslap timer: $readini($s.ini, Settings, autoslaptimer) seconds.
  }
  else {
    //echo 10 -t $chan * Autoslap timer: $readini($s.ini, Settings, autoslaptimer) seconds. Set autoslap timer feature by using /autoslaptimer <seconds>.
  }
}

alias autopoketimer {
  if ($1 isnum) {
    writeini $s.ini Settings autopoketimer $1
    //echo 10 -t $chan * Autopoke timer: $readini($s.ini, Settings, autopoketimer) seconds.
  }
  else {
    //echo 10 -t $chan * Autopoke timer: $readini($s.ini, Settings, autopoketimer) seconds. Set autopoke timer feature by using /autopoketimer <seconds>.
  }
}

ON *:ACTION:*:#:{
  if (((slap isin $1) || (smack isin $1) || (kill isin $1) || (attack isin $1) || (spank isin $1) || (hit isin $1)) && ($me isin $2)) {
    /slapback $nick
  }
  elseif ((poke isin $1) && ($me isin $2)) {
    /pokeback $nick
  }
}