View difference between Paste ID: 829Gt9nK and FBPHNfCr
SHOW: | | - or go back to the newest paste.
1
on *:TEXT:&guess *:#ninja_matt:{
2
  if (($$2 isnum) && ($$3 inum)) {
3
    if (($$2 == 1) && ($$3 == 1)) msg $chan You thought you could get away with that?
4
    elseif (($$2 != $int($$2)) || ($$3 != $int($$3))) msg $chan Please enter only whole numbers.
5
    elseif (($$2 < 1) || ($$3 < 1)) msg $chan You can't input numbers less than 1.
6
    elseif ($$2 < $$3) msg $chan The number you are guessing cannot be higher than maximum value specified.
7
    else {
8
      var %num = $rand(1,$$2)
9
      if (%num == $$3) {
10-
        inc %guess $+ $nick $$2
10+
        inc %guess [ $+ [ $nick ] ] $$2
11
        msg $chan You guessed correct! You just gained  $+ $$2 points.
12
      }
13
      else {
14
        dec %guess [ $+ [ $nick ] ]
15-
        dec %guess $+ $nick
15+
16
      }
17
      msg $chan You now have %guess [ $+ [ $nick ] ] points.
18
    }
19
  }
20
  else msg $chan Please enter only numbers.
21
}
22
on *:TEXT:&guessscore *:#ninja_matt:{
23
  if (!%guess [ $+ [ $$2 ] ] ) msg $chan There is no score recorded for $$2.
24
  else msg $chan $$2 has %guess [ $+ [ $$2 ] ] points.