I've been trying to make a battle simulation bot where you are a "toon" with 15-137 health and you battle a "cog" that has a set health based on a 1-12 level. I've set up a big part of it but for some reason my brackets looks messed up in my !use and i can't seem to figure out the problem. here is my script:
Code:
on *:text:!play*:?:{
  if ($2 = $null) msg $nick please input a cog level
  if ($3 = $null) msg $nick please input your laff 
  if ($2 !isnum 1-12) msg $nick Please select a proper level cog (1-12)
  if ($3 !isnum 15-137) msg $nick please select a proper laff (15-137)
  if ($3 isnum 15-137) && ($2 isnum 1-12) { 
    writeini sim_info.ini $nick cog.level $2
    writeini sim_info.ini $nick laff.level $3
    if ($2 isnum 1) writeini sim_info.ini $nick cog.health 6
    if ($2 isnum 2) writeini sim_info.ini $nick cog.health 12
    if ($2 isnum 3) writeini sim_info.ini $nick cog.health 20
    if ($2 isnum 4) writeini sim_info.ini $nick cog.health 30
    if ($2 isnum 5) writeini sim_info.ini $nick cog.health 42
    if ($2 isnum 6) writeini sim_info.ini $nick cog.health 56
    if ($2 isnum 7) writeini sim_info.ini $nick cog.health 72
    if ($2 isnum 8) writeini sim_info.ini $nick cog.health 90
    if ($2 isnum 9) writeini sim_info.ini $nick cog.health 110
    if ($2 isnum 10) writeini sim_info.ini $nick cog.health 132
    if ($2 isnum 11) writeini sim_info.ini $nick cog.health 156
    if ($2 isnum 12) writeini sim_info.ini $nick cog.health 200

    msg $nick Starting...
    if ($2 isnum 1) writeini sim_info.ini $nick gag1 cupcake | writeini sim_info.ini $nick gag2 squirt.flower | msg $nick A level 1 $read(level1.txt) has appeared! It has $readini(sim_info.ini,n,$nick,cog.health)) health! you have been given some cupcakes and squirting flowers. say !use 1 for cupcake, and !use 2 for the flower.
  }
}
on *:text:!use*:?:{
  if ($2 isnum 1) { 
    if ($readini(sim_info.ini,n,$nick,gag1) == cupcake) {
      set -e %rng $rand(1,100)
      if (%rng isnum 1-70) {
        msg $nick Bam! hit! 
        writeini sim_info.ini $nick cog.health 2
        msg $nick Cog is now at $readini(sim_info.ini,n,$nick,cog.health)) health!
      }
      elseif (%rng isnum 71-100) {
        oof! it missed! try again | return
      }
    }
    if ($2 isnum 2) {
      if ($readini(sim_info.ini,b,$nick,gag2) == squirt.flower) 
    }
  }
}
on *:join:#TTRBattles:{ 
  if ($nick == judge2020) mode # +o judge2020 
  msg $nick welcome to #TTRBattles! I will be the bot simulating your battles. Please say "!play [cog level] [laff]" (!play 1 15) in this window. NOTE: this is still unfinished, currently you can only get to using a gag. This should be a finished project soon! 
}

also would like to ask for the code to subtract a number from the cog.health number, since i seem to have forgot it...


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball