Skip to content
TG007 community snippet #140

Fight Game by newklear

Simple Fight game Syntax: !fight nickname or !fight stats nickname Note: Variables are saved once an hour after use, just reload the Fight.ini if need be . Feel free too edit the randomisers for different outcomes.

By Snippets Added Dec 6, 2023
General IRC All snippets
mIRC script 41 lines
About this snippet

Overview

Simple Fight game

Syntax: !fight nickname or !fight stats nickname

Note: Variables are saved once an hour after use, just reload the Fight.ini if need be .
Feel free too edit the randomisers for different outcomes.
Source code

mIRC script

41 lines · 2,275 characters
on *:TEXT:!fight*:#:{
  if (%flfight. [ $+ [ $address($nick,2) ] ] >= 5) { halt }
  if (%flfight. [ $+ [ $address($nick,2) ] ] == 3) { .notice $nick You have one more !fight use within a 1 minute period. }
  inc -u60 %flfight. [ $+ [ $address($nick,2) ] ] 1
  if ($2 == $nick) { .notice $nick You cannot attack yourself silly! | halt }
  if ($2 == $me) { .notice $nick You cannot attack the Bot :p | halt }
  if ($2 == help) { .notice $nick Fight Help Commands are: !fight, !fight Stats, !fight help | halt }
  if ($2 == stats) {
    if ($3) {
      if (!%SA. [ $+ [ $address($3,2) ] ]) { .notice $nick There is no Attack Record for $3 $+ . | halt }
      .notice $nick $3 $+ 's Strike Attack == %SA. [ $+ [ $address($3,2) ] ]
    }
    else { .notice $nick Syntax: !fight stats nickname }
    halt
  }
  if ($2) {
    .timersavefight 1 3600 save -rv Fight.ini  
    if ($2 ison $chan) {
      var %sa $calc(%SA. [ $+ [ $address($nick,2) ] ] + $r(1,10) / 10)
      var %da $calc(%SA. [ $+ [ $address($2,2) ] ] + $r(1,10) / 10)
      if (%sa == %da) { 
        .msg $chan the Fight is a 13draw! Your SA: %sa vs $2 $+ 's DA: %da 
        set %SA. [ $+ [ $address($nick,2) ] ] $calc(%SA. [ $+ [ $address($nick,2) ] ] + $r(1,30) / 10)
        set %SA. [ $+ [ $address($2,2) ] ] $calc(%SA. [ $+ [ $address($2,2) ] ] + $r(1,30) / 10)
        ;**************************************Fight - by newklear 2018***************************************
      }
      if (%sa > %da) { 
        .msg $chan You have 9beaten $2 $+ ! Your SA: %sa vs $2 $+ 's DA: %da  
        set %SA. [ $+ [ $address($nick,2) ] ] $calc(%SA. [ $+ [ $address($nick,2) ] ] + $r(1,30) / 10)
        set %SA. [ $+ [ $address($2,2) ] ] $calc(%SA. [ $+ [ $address($2,2) ] ] + $r(1,70) / 10)
      }
      if (%sa < %da) { 
        .msg $chan You 4lost to $2 $+ ! Your SA: %sa vs $2 $+ 's DA: %da  
        set %SA. [ $+ [ $address($nick,2) ] ] $calc(%SA. [ $+ [ $address($nick,2) ] ] + $r(1,60) / 10)
        set %SA. [ $+ [ $address($2,2) ] ] $calc(%SA. [ $+ [ $address($2,2) ] ] + $r(1,40) / 10)
      }
    }
    else { .notice $nick You can only fight someone in the channel. }
  }
  else { .notice $nick Syntax: !fight nickname or !fight stats nickname }
}
Community

Comments

Want to join the discussion? Sign in to TG007.
No comments yet. Start the discussion.