My game is in serious trouble.

I do not know what I did wrong, but my script keeps posting "Failed to load script" for my buy command... a command I spent about 3 weeks designing and developing.

I was adding some new spells to it, via the UI and not code view; everything seemed to be going fine. I managed to add new spells to my 1st to 6th tier, without a problem. When I went to implement my 7th tier, things were going good. When I was halfway done with my 7th tier, I saved it and everything was good. When I finished off my 7th tier, I got this error. I went into code view didn't see anything wrong, but have been getting the occasional weird error with quest and exiting the program and launching it again would usually fix the issue. It didn't with this.

I tried copying the code (by looking at in in code view) to text file, and then deleting the entire buy command, and recreated the command and copied the code over. Didn't fix it.

I tried deleting the three spells I added before the command borked. Didn't fix it.

I tried deleting the entire 7th tier; didn't fix it.

I've been able to produce updates for my game every 3-5 days and my players are quite happy. However, if I have to rebuild my entire buy command from scratch... its either going to delay me 2-4 weeks to build a new one, or I dunno. This kind of error really kills my drive to keep working on the game. I've checked over the code myself and cannot find an issue with it. I'll post the code below, for anyone who wishes to see if they can figure out the issue. The majority of the code complies fine, but there must be something I did wrong in my spell purchasing code. It may be that I simply reached an operational limit in the Quest engine for the number of nested ifs, switches, and get inputs.

Here is the code: (it lacks the 7th tier)

        if (GetBoolean(player, "RoomEmpty")) {
          switch (text) {
            case ("consumables") {
              msg ("Would you like to purchase (<b>healing</b>) potions, (<b>mana</b>) potions, enchanting (<b>orbs</b>), or 

enhancement (<b>kits</b>).")
              get input {
                switch (result) {
                  case ("healing") {
                    msg ("How many healing potions would you like to purchase; please enter a number. <b>Price per is 50.</b>")
                    get input {
                      Satchel.TempValue = toint(result)
                      if ((player.SoulShards) > (Satchel.TempValue * 50 - 1)) {
                        Satchel.HealingPotions = Satchel.HealingPotions + Satchel.TempValue
                        player.SoulShards = player.SoulShards - (Satchel.TempValue * 50)
                        msg ("</br>You buy " + Satchel.TempValue + " healing potion[s].")
                      }
                      else {
                        msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " 

+ (Satchel.TempValue * 50) + " soul shards!")
                      }
                    }
                  }
                  case ("mana") {
                    msg ("How many mana potions would you like to purchase; please enter a number. <b>Price per is 50.</b>")
                    get input {
                      Satchel.TempValue = toint(result)
                      if ((player.SoulShards) > (Satchel.TempValue * 50 - 1)) {
                        Satchel.ManaPotions = Satchel.ManaPotions + Satchel.TempValue
                        player.SoulShards = player.SoulShards - (Satchel.TempValue * 50)
                        msg ("</br>You buy " + Satchel.TempValue + " mana potion[s].")
                      }
                      else {
                        msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " 

+ (Satchel.TempValue * 50) + " soul shards!")
                      }
                    }
                  }
                  case ("orbs") {
                    msg ("How many enchanting orbs would you like to purchase; please enter a number. <b>Price per is 500.</b>")
                    get input {
                      Satchel.TempValue = toint(result)
                      if ((player.SoulShards) > (Satchel.TempValue * 500 - 1)) {
                        Satchel.EnchantingOrbs = Satchel.EnchantingOrbs + Satchel.TempValue
                        player.SoulShards = player.SoulShards - (Satchel.TempValue * 500)
                        msg ("</br>You buy " + Satchel.TempValue + " enchanting orb[s].")
                      }
                      else {
                        msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " 

+ (Satchel.TempValue * 500) + " soul shards!")
                      }
                    }
                  }
                  case ("kits") {
                    msg ("How many enhancement kits would you like to purchase; please enter a number. <b>Price per is 

250.</b>")
                    get input {
                      Satchel.TempValue = toint(result)
                      if ((player.SoulShards) > (Satchel.TempValue * 250 - 1)) {
                        Satchel.EnhancementKits = Satchel.EnhancementKits + Satchel.TempValue
                        player.SoulShards = player.SoulShards - (Satchel.TempValue * 250)
                        msg ("</br>You buy " + Satchel.TempValue + " enhancement kit[s].")
                      }
                      else {
                        msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " 

+ (Satchel.TempValue * 250) + " soul shards!")
                      }
                    }
                  }
                }
              }
            }
            case ("training") {
              msg ("Your current XP values are:<br/>")
              msg ("Strength = " + player.StrengthTraining + "; Agility = " + player.AgilityTraining + "; Vitality = " + 

player.VitalityTraining + ".")
              msg ("Intellect = " + player.IntellectTraining + ", Willpower = " + player.WillpowerTraining + ", Perception = " + 

player.PerceptionTraining + ", and Luck = " + player.LuckTraining + ".")
              msg ("<br/>A <u>bout</u> of training provides 100 XP for 100 soul shards.<br/>How many <u>bouts</u> of training do 

you want to have; please enter a number?<br/>")
              get input {
                Satchel.TempValue = toint(result)
                if (Satchel.TempValue > 0) {
                  if (player.SoulShards > ((Satchel.TempValue * 100) - 1)) {
                    msg ("Which attribute will you apply this training to?<br/>(<b>strength</b>), (<b>agility</b>), 

(<b>vitality</b>), (<b>intellect</b>), (<b>willpower</b>), (<b>perception</b>), or (<b>luck</b>)")
                    get input {
                      switch (result) {
                        case ("strength") {
                          msg ("<br/>You acquire " + Satchel.TempValue + " bouts of strength training.")
                          player.StrengthTraining = player.StrengthTraining + (Satchel.TempValue * 100)
                          player.SoulShards = player.SoulShards - (Satchel.TempValue * 100)
                        }
                        case ("agility") {
                          msg ("<br/>You acquire " + Satchel.TempValue + " bouts of agility training.")
                          player.AgilityTraining = player.AgilityTraining + (Satchel.TempValue * 100)
                          player.SoulShards = player.SoulShards - (Satchel.TempValue * 100)
                        }
                        case ("vitality") {
                          msg ("<br/>You acquire " + Satchel.TempValue + " bouts of vitality training.")
                          player.VitalityTraining = player.VitalityTraining + (Satchel.TempValue * 100)
                          player.SoulShards = player.SoulShards - (Satchel.TempValue * 100)
                        }
                        case ("intellect") {
                          msg ("<br/>You acquire " + Satchel.TempValue + " bouts of intellect training.")
                          player.IntellectTraining = player.IntellectTraining + (Satchel.TempValue * 100)
                          player.SoulShards = player.SoulShards - (Satchel.TempValue * 100)
                        }
                        case ("willpower") {
                          msg ("<br/>You acquire " + Satchel.TempValue + " bouts of willpower training.")
                          player.WillpowerTraining = player.WillpowerTraining + (Satchel.TempValue * 100)
                          player.SoulShards = player.SoulShards - (Satchel.TempValue * 100)
                        }
                        case ("perception") {
                          msg ("<br/>You acquire " + Satchel.TempValue + " bouts of perception training.")
                          player.PerceptionTraining = player.PerceptionTraining + (Satchel.TempValue * 100)
                          player.SoulShards = player.SoulShards - (Satchel.TempValue * 100)
                        }
                        case ("luck") {
                          msg ("<br/>You acquire " + Satchel.TempValue + " bouts of luck training.")
                          player.LuckTraining = player.LuckTraining + (Satchel.TempValue * 100)
                          player.SoulShards = player.SoulShards - (Satchel.TempValue * 100)
                        }
                      }
                    }
                  }
                  else {
                    msg ("\"You don't have enough soul shards. You only have \" + player.SoulShards + \" soul shards. You need 

\" + (Satchel.TempValue * 100) + \" soul shards!\"")
                  }
                }
                else {
                  msg ("You decide to not do any training.")
                }
              }
              msg ("")
              // First check if player has sufficient SS.
              // Then ask which attribute to apply training to, if you have the SS.
              // Satchel.TempValue used so that I don't need to have another temporary value.
            }
            case ("weapons") {
              msg ("Which weapon would you like to purchase; the price is in the [ ]? <br/><br/>(<b>dagger</b>) [1 SS]<br/>

(<b>shortsword</b>) [100 SS]<br/>(<b>longsword</b>) [200 SS]<br/>(<b>staff</b>) [200 SS]<br/>(<b>greatsword</b>) [400 SS]")
              get input {
                switch (result) {
                  case ("dagger") {
                    if (ListContains(ScopeVisible(), WeaponDagger)) {
                      msg ("You already own a dagger.")
                    }
                    else {
                      if (player.SoulShards > 0) {
                        msg ("<br/>You purchase a dagger.")
                        player.SoulShards = player.SoulShards - 1
                        AddToInventory (WeaponDagger)
                      }
                      else {
                        msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " 

+ (1) + " soul shards!")
                      }
                    }
                  }
                  case ("shortsword") {
                    if (ListContains(ScopeVisible(), WeaponShortsword)) {
                      msg ("You already own a shortsword.")
                    }
                    else {
                      if (player.SoulShards > 99) {
                        msg ("<br/>You purchase a shortsword.")
                        player.SoulShards = player.SoulShards - 100
                        AddToInventory (WeaponShortsword)
                      }
                      else {
                        msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " 

+ (100) + " soul shards!")
                      }
                    }
                  }
                  case ("longsword") {
                    if (ListContains(ScopeVisible(), WeaponLongsword)) {
                      msg ("You already own a longsword.")
                    }
                    else {
                      if (player.SoulShards > 199) {
                        msg ("<br/>You purchase a longsword.")
                        player.SoulShards = player.SoulShards - 200
                        AddToInventory (WeaponLongsword)
                      }
                      else {
                        msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " 

+ (200) + " soul shards!")
                      }
                    }
                  }
                  case ("greatsword") {
                    if (ListContains(ScopeVisible(), WeaponGreatsword)) {
                      msg ("You already own a greatsword.")
                    }
                    else {
                      if (player.SoulShards > 399) {
                        msg ("<br/>You purchase a greatsword.")
                        player.SoulShards = player.SoulShards - 400
                        AddToInventory (WeaponGreatsword)
                      }
                      else {
                        msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " 

+ (400) + " soul shards!")
                      }
                    }
                  }
                  case ("staff") {
                    if (ListContains(ScopeVisible(), WeaponStaff)) {
                      msg ("You already own a staff.")
                    }
                    else {
                      if (player.SoulShards > 199) {
                        msg ("<br/>You purchase a staff.")
                        player.SoulShards = player.SoulShards - 200
                        AddToInventory (WeaponStaff)
                      }
                      else {
                        msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " 

+ (200) + " soul shards!")
                      }
                    }
                  }
                  default {
                    msg ("You decide to not purchase any weapons today.")
                  }
                }
              }
            }
            case ("armors") {
              msg ("Which armor would you like to purchase; the price is in the [ ]? <br/>(<b>robes</b>) [1 SS]<br/>

(<b>leather</b>) [100 SS]<br/>(<b>chainmail</b>) [200 SS]<br/>(<b>platemail</b>) [400 SS]<br/>(<b>leather spikes</b>) [1000 

SS]<br/>(<b>chainmail spikes</b>) [1000 SS]<br/>(<b>platemail spikes</b>) [1000 SS]")
              get input {
                switch (result) {
                  case ("robes") {
                    if (ListContains(ScopeVisible(), ArmorRobes)) {
                      msg ("You already own robes.")
                    }
                    else {
                      if (player.SoulShards > 0) {
                        msg ("<br/>You purchase robes.")
                        player.SoulShards = player.SoulShards - 1
                        AddToInventory (ArmorRobes)
                      }
                      else {
                        msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " 

+ (1) + " soul shards!")
                      }
                    }
                  }
                  case ("leather") {
                    if (ListContains(ScopeVisible(), ArmorLeather)) {
                      msg ("You already own leather armor.")
                    }
                    else {
                      if (player.SoulShards > 99) {
                        msg ("<br/>You purchase leather armor.")
                        player.SoulShards = player.SoulShards - 100
                        AddToInventory (ArmorLeather)
                      }
                      else {
                        msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " 

+ (100) + " soul shards!")
                      }
                    }
                  }
                  case ("chainmail") {
                    if (ListContains(ScopeVisible(), ArmorChainmail)) {
                      msg ("You already own chainmail armor.")
                    }
                    else {
                      if (player.SoulShards > 199) {
                        msg ("<br/>You purchase chainmail armor.")
                        player.SoulShards = player.SoulShards - 200
                        AddToInventory (ArmorChainmail)
                      }
                      else {
                        msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " 

+ (200) + " soul shards!")
                      }
                    }
                  }
                  case ("platemail") {
                    if (ListContains(ScopeVisible(), ArmorPlatemail)) {
                      msg ("You already own platemail armor.")
                    }
                    else {
                      if (player.SoulShards > 399) {
                        msg ("<br/>You purchase platemail armor.")
                        player.SoulShards = player.SoulShards - 400
                        AddToInventory (ArmorPlatemail)
                      }
                      else {
                        msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " 

+ (400) + " soul shards!")
                      }
                    }
                  }
                  case ("leather spikes") {
                    if (ListContains(ScopeVisible(), ArmorLeather)) {
                      if (ArmorLeather.SpikesApplied = true) {
                        msg ("Your leather armor already has armor spikes!")
                      }
                      else {
                        if (player.SoulShards > 999) {
                          msg ("<br/>You purchase armor spikes for your leather armor.")
                          player.SoulShards = player.SoulShards - 1000
                          ArmorLeather.SpikesApplied = true
                        }
                        else {
                          msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need 

" + (1000) + " soul shards!")
                        }
                      }
                    }
                    else {
                      msg ("You aren't carrying leather armor.")
                    }
                  }
                  case ("chainmail spikes") {
                    if (ListContains(ScopeVisible(), ArmorChainmail)) {
                      if (ArmorChainmail.SpikesApplied = true) {
                        msg ("Your chainmail armor already has armor spikes!")
                      }
                      else {
                        if (player.SoulShards > 999) {
                          msg ("<br/>You purchase armor spikes for your chainmail armor.")
                          player.SoulShards = player.SoulShards - 1000
                          ArmorChainmail.SpikesApplied = true
                        }
                        else {
                          msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need 

" + (1000) + " soul shards!")
                        }
                      }
                    }
                    else {
                      msg ("You aren't carrying chainmail armor.")
                    }
                  }
                  case ("platemail spikes") {
                    if (ListContains(ScopeVisible(), ArmorPlatemail)) {
                      if (ArmorPlatemail.SpikesApplied = true) {
                        msg ("Your platemail armor already has armor spikes!")
                      }
                      else {
                        if (player.SoulShards > 999) {
                          msg ("<br/>You purchase armor spikes for your platemail armor.")
                          player.SoulShards = player.SoulShards - 1000
                          ArmorPlatemail.SpikesApplied = true
                        }
                        else {
                          msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need 

" + (1000) + " soul shards!")
                        }
                      }
                    }
                    else {
                      msg ("You aren't carrying platemail armor.")
                    }
                  }
                  default {
                    msg ("You decide to not purchase any armors today.")
                  }
                }
              }
            }
            case ("spells") {
              msg ("Which level of spells would you like to purchase from? (<b>1st</b>), (<b>2nd</b>), (<b>3rd</b>), 

(<b>4th</b>), (<b>5th</b>), (<b>6th</b>), (<b>7th</b>)")
              get input {
                switch (result) {
                  case ("1st") {
                    msg ("First level spells cost <b>100</b> soul shards each. The first level spells available to purchase 

are:<br/>")
                    if (Spellbook.KnowMinorHealing = false) {
                      msg ("Available: (<b>minor healing</b>)")
                    }
                    if (Spellbook.KnowMinorAid = false) {
                      msg ("Available: (<b>minor aid</b>)")
                    }
                    if (Spellbook.KnowAnalysis = false) {
                      msg ("Available: (<b>analysis</b>)")
                    }
                    if (Spellbook.KnowMinorRejuvenation = false) {
                      msg ("Available: (<b>minor rejuvenation</b>)")
                    }
                    if (Spellbook.KnowArcaneZap = false) {
                      msg ("Available: (<b>arcane zap</b>)")
                    }
                    if (Spellbook.KnowFirebolt = false) {
                      msg ("Available: (<b>firebolt</b>)")
                    }
                    msg ("Which spell would you like to purchase?")
                    get input {
                      switch (result) {
                        case ("arcane zap") {
                          if (Spellbook.KnowArcaneZap = false) {
                            if (player.SoulShards > 99) {
                              msg ("<br/>You learn the spell Arcane Zap.")
                              Spellbook.KnowArcaneZap = true
                              player.SoulShards = player.SoulShards - 100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("minor healing") {
                          if (Spellbook.KnowMinorHealing = false) {
                            if (player.SoulShards > 99) {
                              msg ("<br/>You learn the spell Minor Healing.")
                              Spellbook.KnowMinorHealing = true
                              player.SoulShards = player.SoulShards - 100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("firebolt") {
                          if (Spellbook.KnowFirebolt = false) {
                            if (player.SoulShards > 99) {
                              msg ("<br/>You learn the spell Firebolt.")
                              Spellbook.KnowFirebolt = true
                              player.SoulShards = player.SoulShards - 100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("minor aid") {
                          if (Spellbook.KnowMinorAid = false) {
                            if (player.SoulShards > 99) {
                              msg ("<br/>You learn the spell Minor Aid.")
                              Spellbook.KnowMinorAid = true
                              player.SoulShards = player.SoulShards - 100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("analysis") {
                          if (Spellbook.KnowAnalysis = false) {
                            if (player.SoulShards > 99) {
                              msg ("<br/>You learn the spell Analysis.")
                              Spellbook.KnowAnalysis = true
                              player.SoulShards = player.SoulShards - 100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("minor rejuvenation") {
                          if (Spellbook.KnowMinorRejuvenation = false) {
                            if (player.SoulShards > 99) {
                              msg ("<br/>You learn the spell Minor Rejuvenation.")
                              Spellbook.KnowMinorRejuvenation = true
                              player.SoulShards = player.SoulShards - 100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        default {
                          msg ("You decide to not buy a spell today.")
                        }
                      }
                    }
                  }
                  case ("2nd") {
                    msg ("Second level spells cost <b>300</b> soul shards each. The second level spells available to purchase 

are:<br/>")
                    if (Spellbook.KnowMinorBlessing = false) {
                      msg ("Available: (<b>minor blessing</b>)")
                    }
                    if (Spellbook.KnowMinorRegeneration = false) {
                      msg ("Available: (<b>minor regeneration</b>)")
                    }
                    if (Spellbook.KnowMinorHaste = false) {
                      msg ("Available: (<b>minor haste</b>)")
                    }
                    if (Spellbook.KnowRelocate = false) {
                      msg ("Available: (<b>relocate</b>)")
                    }
                    if (Spellbook.KnowPiercingZap = false) {
                      msg ("Available: (<b>piercing zap</b>)")
                    }
                    if (Spellbook.KnowIcyLance = false) {
                      msg ("Available: (<b>icy lance</b>)")
                    }
                    if (Spellbook.KnowAcidSpray = false) {
                      msg ("Available: (<b>acid spray</b>)")
                    }
                    msg ("Which spell would you like to purchase?")
                    get input {
                      switch (result) {
                        case ("icy lance") {
                          if (Spellbook.KnowIcyLance = false) {
                            if (player.SoulShards > 299) {
                              msg ("<br/>You learn the spell Icy Lance.")
                              Spellbook.KnowIcyLance = true
                              player.SoulShards = player.SoulShards - 300
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("minor blessing") {
                          if (Spellbook.KnowMinorBlessing = false) {
                            if (player.SoulShards > 299) {
                              msg ("<br/>You learn the spell Minor Blessing.")
                              Spellbook.KnowMinorBlessing = true
                              player.SoulShards = player.SoulShards - 300
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("acid spray") {
                          if (Spellbook.KnowAcidSpray = false) {
                            if (player.SoulShards > 299) {
                              msg ("<br/>You learn the spell Acid Spray.")
                              Spellbook.KnowAcidSpray = true
                              player.SoulShards = player.SoulShards - 300
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("piercing zap") {
                          if (Spellbook.KnowPiercingZap = false) {
                            if (player.SoulShards > 299) {
                              msg ("<br/>You learn the spell Piercing Zap.")
                              Spellbook.KnowPiercingZap = true
                              player.SoulShards = player.SoulShards - 300
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("minor regeneration") {
                          if (Spellbook.KnowMinorRegeneration = false) {
                            if (player.SoulShards > 299) {
                              msg ("<br/>You learn the spell Minor Regeneration.")
                              Spellbook.KnowMinorRegeneration = true
                              player.SoulShards = player.SoulShards - 300
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("relocate") {
                          if (Spellbook.KnowRelocate = false) {
                            if (player.SoulShards > 299) {
                              msg ("<br/>You learn the spell Relocate.")
                              Spellbook.KnowRelocate = true
                              player.SoulShards = player.SoulShards - 300
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("minor haste") {
                          if (Spellbook.KnowMinorHaste = false) {
                            if (player.SoulShards > 299) {
                              msg ("<br/>You learn the spell Minor Haste.")
                              Spellbook.KnowMinorHaste = true
                              player.SoulShards = player.SoulShards - 300
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        default {
                          msg ("You decide to not buy a spell today.")
                        }
                      }
                    }
                  }
                  case ("3rd") {
                    msg ("Third level spells cost <b>500</b> soul shards each. The third level spells available to purchase 

are:<br/>")
                    if (Spellbook.KnowHealing = false) {
                      msg ("Available: (<b>healing</b>)")
                    }
                    if (Spellbook.KnowSpellPotencyI = false) {
                      msg ("Available: (<b>spell potency i</b>)")
                    }
                    if (Spellbook.KnowAid = false) {
                      msg ("Available: (<b>aid</b>)")
                    }
                    if (Spellbook.KnowTerrify = false) {
                      msg ("Available: (<b>terrify</b>)")
                    }
                    if (Spellbook.KnowPiercingLance = false) {
                      msg ("Available: (<b>piercing lance</b>)")
                    }
                    if (Spellbook.KnowMagicZot = false) {
                      msg ("Available: (<b>magic zot</b>)")
                    }
                    if (Spellbook.KnowShockBolt = false) {
                      msg ("Available: (<b>shock bolt</b>)")
                    }
                    msg ("Which spell would you like to purchase?")
                    get input {
                      switch (result) {
                        case ("magic zot") {
                          if (Spellbook.KnowMagicZot = false) {
                            if (player.SoulShards > 499) {
                              msg ("<br/>You learn the spell Magic Zot.")
                              Spellbook.KnowMagicZot = true
                              player.SoulShards = player.SoulShards - 500
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("healing") {
                          if (Spellbook.KnowHealing = false) {
                            if (player.SoulShards > 499) {
                              msg ("<br/>You learn the spell Healing.")
                              Spellbook.KnowHealing = true
                              player.SoulShards = player.SoulShards - 500
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("shock bolt") {
                          if (Spellbook.KnowShockBolt = false) {
                            if (player.SoulShards > 499) {
                              msg ("<br/>You learn the spell Shock Bolt.")
                              Spellbook.KnowShockBolt = true
                              player.SoulShards = player.SoulShards - 500
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("piercing lance") {
                          if (Spellbook.KnowPiercingLance = false) {
                            if (player.SoulShards > 499) {
                              msg ("<br/>You learn the spell Piercing Lance.")
                              Spellbook.KnowPiercingLance = true
                              player.SoulShards = player.SoulShards - 500
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("aid") {
                          if (Spellbook.KnowAid = false) {
                            if (player.SoulShards > 499) {
                              msg ("<br/>You learn the spell Aid.")
                              Spellbook.KnowAid = true
                              player.SoulShards = player.SoulShards - 500
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("terrify") {
                          if (Spellbook.KnowTerrify = false) {
                            if (player.SoulShards > 499) {
                              msg ("<br/>You learn the spell Terrify.")
                              Spellbook.KnowTerrify = true
                              player.SoulShards = player.SoulShards - 500
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("spell potency i") {
                          if (Spellbook.KnowSpellPotencyI = false) {
                            if (player.SoulShards > 499) {
                              msg ("<br/>You learn the spell Spell Potency I.")
                              Spellbook.KnowSpellPotencyI = true
                              player.SoulShards = player.SoulShards - 500
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        default {
                          msg ("You decide to not buy a spell today.")
                        }
                      }
                    }
                  }
                  case ("4th") {
                    msg ("Fourth level spells cost <b>700</b> soul shards each. The fourth level spells available to purchase 

are:<br/>")
                    if (Spellbook.KnowBlessing = false) {
                      msg ("Available: (<b>blessing</b>)")
                    }
                    if (Spellbook.KnowRegeneration = false) {
                      msg ("Available: (<b>regeneration</b>)")
                    }
                    if (Spellbook.KnowHaste = false) {
                      msg ("Available: (<b>haste</b>)")
                    }
                    if (Spellbook.KnowRejuvenation = false) {
                      msg ("Available: (<b>rejuvenation</b>)")
                    }
                    if (Spellbook.KnowInvisibility = false) {
                      msg ("Available: (<b>invisibilty</b>)")
                    }
                    if (Spellbook.KnowPiercingZot = false) {
                      msg ("Available: (<b>piercing zot</b>)")
                    }
                    if (Spellbook.KnowFireball = false) {
                      msg ("Available: (<b>fireball</b>)")
                    }
                    if (Spellbook.KnowAgony = false) {
                      msg ("Available: (<b>agony</b>)")
                    }
                    msg ("Which spell would you like to purchase?")
                    get input {
                      switch (result) {
                        case ("piercing zot") {
                          if (Spellbook.KnowPiercingZot = false) {
                            if (player.SoulShards > 699) {
                              msg ("<br/>You learn the spell Piercing Zot.")
                              Spellbook.KnowPiercingZot = true
                              player.SoulShards = player.SoulShards - 700
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("blessing") {
                          if (Spellbook.KnowBlessing = false) {
                            if (player.SoulShards > 699) {
                              msg ("<br/>You learn the spell Blessing.")
                              Spellbook.KnowBlessing = true
                              player.SoulShards = player.SoulShards - 700
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("agony") {
                          if (Spellbook.KnowAgony = false) {
                            if (player.SoulShards > 699) {
                              msg ("<br/>You learn the spell Agony.")
                              Spellbook.KnowAgony = true
                              player.SoulShards = player.SoulShards - 700
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("fireball") {
                          if (Spellbook.KnowFireball = false) {
                            if (player.SoulShards > 699) {
                              msg ("<br/>You learn the spell Fireballl.")
                              Spellbook.KnowFireball = true
                              player.SoulShards = player.SoulShards - 700
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("regeneration") {
                          if (Spellbook.KnowRegeneration = false) {
                            if (player.SoulShards > 699) {
                              msg ("<br/>You learn the spell Regeneration.")
                              Spellbook.KnowRegeneration = true
                              player.SoulShards = player.SoulShards - 700
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("invisibility") {
                          if (Spellbook.KnowInvisibility = false) {
                            if (player.SoulShards > 699) {
                              msg ("<br/>You learn the spell Invisibility.")
                              Spellbook.KnowInvisibility = true
                              player.SoulShards = player.SoulShards - 700
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("haste") {
                          if (Spellbook.KnowHaste = false) {
                            if (player.SoulShards > 699) {
                              msg ("<br/>You learn the spell Haste.")
                              Spellbook.KnowHaste = true
                              player.SoulShards = player.SoulShards - 700
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("rejuvenation") {
                          if (Spellbook.KnowRejuvenation = false) {
                            if (player.SoulShards > 699) {
                              msg ("<br/>You learn the spell Rejuvenation.")
                              Spellbook.KnowRejuvenation = true
                              player.SoulShards = player.SoulShards - 700
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        default {
                          msg ("You decide to not buy a spell today.")
                        }
                      }
                    }
                  }
                  case ("5th") {
                    msg ("Fifth level spells cost <b>900</b> soul shards each. The fifth level spells available to purchase 

are:<br/>")
                    if (Spellbook.KnowMajorHealing = false) {
                      msg ("Available: (<b>major healing</b>)")
                    }
                    if (Spellbook.KnowMajorAid = false) {
                      msg ("Available: (<b>major aid</b>)")
                    }
                    if (Spellbook.KnowPowerWeaponI = false) {
                      msg ("Available: (<b>power weapon i</b>)")
                    }
                    if (Spellbook.KnowForceShieldI = false) {
                      msg ("Available: (<b>force shield i</b>)")
                    }
                    if (Spellbook.KnowPiercingFireball = false) {
                      msg ("Available: (<b>piercing fireball</b>)")
                    }
                    if (Spellbook.KnowConeOfCold = false) {
                      msg ("Available: (<b>cone of cold</b>)")
                    }
                    if (Spellbook.KnowExplosion = false) {
                      msg ("Available: (<b>explosion</b>)")
                    }
                    msg ("Which spell would you like to purchase?")
                    get input {
                      switch (result) {
                        case ("piercing fireball") {
                          if (Spellbook.KnowPiercingFireball = false) {
                            if (player.SoulShards > 899) {
                              msg ("<br/>You learn the spell Piercing Fireball.")
                              Spellbook.KnowPiercingFireball = true
                              player.SoulShards = player.SoulShards - 900
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("major healing") {
                          if (Spellbook.KnowMajorHealing = false) {
                            if (player.SoulShards > 899) {
                              msg ("<br/>You learn the spell Major Healing.")
                              Spellbook.KnowMajorHealing = true
                              player.SoulShards = player.SoulShards - 900
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("major aid") {
                          if (Spellbook.KnowMajorAid = false) {
                            if (player.SoulShards > 899) {
                              msg ("<br/>You learn the spell Major Aid.")
                              Spellbook.KnowMajorAid = true
                              player.SoulShards = player.SoulShards - 900
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("explosion") {
                          if (Spellbook.KnowExplosion = false) {
                            if (player.SoulShards > 899) {
                              msg ("<br/>You learn the spell Explosion.")
                              Spellbook.KnowExplosion = true
                              player.SoulShards = player.SoulShards - 900
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("cone of cold") {
                          if (Spellbook.KnowConeOfCold = false) {
                            if (player.SoulShards > 899) {
                              msg ("<br/>You learn the spell Cone of Cold.")
                              Spellbook.KnowConeOfCold = true
                              player.SoulShards = player.SoulShards - 900
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("power weapon i") {
                          if (Spellbook.KnowPowerWeaponI = false) {
                            if (player.SoulShards > 899) {
                              msg ("<br/>You learn the spell Power Weapon I.")
                              Spellbook.KnowPowerWeaponI = true
                              player.SoulShards = player.SoulShards - 900
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("force shield i") {
                          if (Spellbook.KnowForceShieldI = false) {
                            if (player.SoulShards > 899) {
                              msg ("<br/>You learn the spell Force Shield I.")
                              Spellbook.KnowForceShieldI = true
                              player.SoulShards = player.SoulShards - 900
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        default {
                          msg ("You decide to not buy a spell today.")
                        }
                      }
                    }
                  }
                  case ("6th") {
                    msg ("Sixth level spells cost <b>1100</b> soul shards each. The sixth level spells available to purchase 

are:<br/>")
                    if (Spellbook.KnowMajorBlessing = false) {
                      msg ("Available: (<b>major blessing</b>)")
                    }
                    if (Spellbook.KnowMajorRegeneration = false) {
                      msg ("Available: (<b>major regeneration</b>)")
                    }
                    if (Spellbook.KnowMajorHaste = false) {
                      msg ("Available: (<b>major haste</b>)")
                    }
                    if (Spellbook.KnowSpellPotencyII = false) {
                      msg ("Available: (<b>spell potency ii</b>)")
                    }
                    if (Spellbook.KnowPiercingCold = false) {
                      msg ("Available: (<b>piercing cold</b>)")
                    }
                    if (Spellbook.KnowInferno = false) {
                      msg ("Available: (<b>inferno</b>)")
                    }
                    if (Spellbook.KnowBlizzard = false) {
                      msg ("Available: (<b>blizzard</b>)")
                    }
                    msg ("Which spell would you like to purchase?")
                    get input {
                      switch (result) {
                        case ("piercing cold") {
                          if (Spellbook.KnowPiercingCold = false) {
                            if (player.SoulShards > 1099) {
                              msg ("<br/>You learn the spell Piercing Cold.")
                              Spellbook.KnowPiercingCold = true
                              player.SoulShards = player.SoulShards - 1100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("major blessing") {
                          if (Spellbook.KnowMajorBlessing = false) {
                            if (player.SoulShards > 1099) {
                              msg ("<br/>You learn the spell Major Blessing.")
                              Spellbook.KnowMajorBlessing = true
                              player.SoulShards = player.SoulShards - 1100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("major regeneration") {
                          if (Spellbook.KnowMajorRegeneration = false) {
                            if (player.SoulShards > 1099) {
                              msg ("<br/>You learn the spell Major Regeneration.")
                              Spellbook.KnowMajorRegeneration = true
                              player.SoulShards = player.SoulShards - 1100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("blizzard") {
                          if (Spellbook.KnowBlizzard = false) {
                            if (player.SoulShards > 1099) {
                              msg ("<br/>You learn the spell Blizzard.")
                              Spellbook.KnowBlizzard = true
                              player.SoulShards = player.SoulShards - 1100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("inferno") {
                          if (Spellbook.KnowInferno = false) {
                            if (player.SoulShards > 1099) {
                              msg ("<br/>You learn the spell Inferno.")
                              Spellbook.KnowInferno = true
                              player.SoulShards = player.SoulShards - 1100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("major haste") {
                          if (Spellbook.KnowMajorHaste = false) {
                            if (player.SoulShards > 1099) {
                              msg ("<br/>You learn the spell Major Haste.")
                              Spellbook.KnowMajorHaste = true
                              player.SoulShards = player.SoulShards - 1100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("spell potency ii") {
                          if (Spellbook.KnowSpellPotencyII = false) {
                            if (player.SoulShards > 1099) {
                              msg ("<br/>You learn the spell Spell Potency II.")
                              Spellbook.KnowSpellPotencyII = true
                              player.SoulShards = player.SoulShards - 1100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        default {
                          msg ("You decide to not buy a spell today.")
                        }
                      }
                    }
                  }
            case ("shields") {
              msg ("Which shield would you like to purchase; the price is in the [ ]? <br/>(<b>buckler</b>) [1 SS]<br/>

(<b>round</b>) [100 SS]<br/>(<b>kite</b>) [200 SS]<br/>(<b>tower</b>) [400 SS]<br/>(<b>round spikes</b>) [1000 SS]<br/>(<b>kite 

spikes</b>) [1000 SS]<br/>(<b>tower spikes</b>) [1000 SS]")
              get input {
                switch (result) {
                  case ("buckler") {
                    if (ListContains(ScopeVisible(), ShieldBuckler)) {
                      msg ("You already own a buckler.")
                    }
                    else {
                      if (player.SoulShards > 0) {
                        msg ("<br/>You purchase a buckler.")
                        player.SoulShards = player.SoulShards - 1
                        AddToInventory (ShieldBuckler)
                      }
                      else {
                        msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " 

+ (1) + " soul shards!")
                      }
                    }
                  }
                  case ("round") {
                    if (ListContains(ScopeVisible(), ShieldRound)) {
                      msg ("You already own a round shield.")
                    }
                    else {
                      if (player.SoulShards > 99) {
                        msg ("<br/>You purchase a round shield.")
                        player.SoulShards = player.SoulShards - 100
                        AddToInventory (ShieldRound)
                      }
                      else {
                        msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " 

+ (100) + " soul shards!")
                      }
                    }
                  }
                  case ("kite") {
                    if (ListContains(ScopeVisible(), ShieldKite)) {
                      msg ("You already own a kite shield.")
                    }
                    else {
                      if (player.SoulShards > 199) {
                        msg ("<br/>You purchase a kite shield.")
                        player.SoulShards = player.SoulShards - 200
                        AddToInventory (ShieldKite)
                      }
                      else {
                        msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " 

+ (200) + " soul shards!")
                      }
                    }
                  }
                  case ("tower") {
                    if (ListContains(ScopeVisible(), ShieldTower)) {
                      msg ("You already own a tower shield.")
                    }
                    else {
                      if (player.SoulShards > 399) {
                        msg ("<br/>You purchase a tower shield.")
                        player.SoulShards = player.SoulShards - 400
                        AddToInventory (ShieldTower)
                      }
                      else {
                        msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " 

+ (400) + " soul shards!")
                      }
                    }
                  }
                  case ("round spikes") {
                    if (ListContains(ScopeVisible(), ShieldRound)) {
                      if (ShieldRound.SpikesApplied = true) {
                        msg ("Your round shield already has shield spikes.")
                      }
                      else {
                        if (player.SoulShards > 999) {
                          msg ("<br/>You purchase shield spikes for your round shield.")
                          player.SoulShards = player.SoulShards - 1000
                          ShieldRound.SpikesApplied = true
                        }
                        else {
                          msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need 

" + (1000) + " soul shards!")
                        }
                      }
                    }
                    else {
                      msg ("You aren't carrying a Round Shield.")
                    }
                  }
                  case ("kite spikes") {
                    if (ListContains(ScopeVisible(), ShieldKite)) {
                      if (ShieldKite.SpikesApplied = true) {
                        msg ("Your round shield already has shield spikes.")
                      }
                      else {
                        if (player.SoulShards > 999) {
                          msg ("<br/>You purchase shield spikes for your kite shield.")
                          player.SoulShards = player.SoulShards - 1000
                          ShieldKite.SpikesApplied = true
                        }
                        else {
                          msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need 

" + (1000) + " soul shards!")
                        }
                      }
                    }
                    else {
                      msg ("You aren't carrying a Kite Shield.")
                    }
                  }
                  case ("tower spikes") {
                    if (ListContains(ScopeVisible(), ShieldTower)) {
                      if (ShieldTower.SpikesApplied = true) {
                        msg ("Your tower shield already has armor spikes!")
                      }
                      else {
                        if (player.SoulShards > 999) {
                          msg ("<br/>You purchase shield spikes for your tower shield.")
                          player.SoulShards = player.SoulShards - 1000
                          ShieldTower.SpikesApplied = true
                        }
                        else {
                          msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need 

" + (1000) + " soul shards!")
                        }
                      }
                    }
                    else {
                      msg ("You aren't carrying a Tower Shield.")
                    }
                  }
                  default {
                    msg ("You decide to not purchase any shields today.")
                  }
                }
              }
            }
            case ("healing potion") {
              msg ("How many healing potions would you like to purchase; please enter a number. <b>Price per is 50.</b>")
              get input {
                Satchel.TempValue = toint(result)
                if ((player.SoulShards) > (Satchel.TempValue * 50 - 1)) {
                  Satchel.HealingPotions = Satchel.HealingPotions + Satchel.TempValue
                  player.SoulShards = player.SoulShards - (Satchel.TempValue * 50)
                  msg ("</br>You buy " + Satchel.TempValue + " healing potion[s].")
                }
                else {
                  msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " + 

(Satchel.TempValue * 50) + " soul shards!")
                }
              }
            }
            case ("mana potion") {
              msg ("How many mana potions would you like to purchase; please enter a number. <b>Price per is 50.</b>")
              get input {
                Satchel.TempValue = toint(result)
                if ((player.SoulShards) > (Satchel.TempValue * 50 - 1)) {
                  Satchel.ManaPotions = Satchel.ManaPotions + Satchel.TempValue
                  player.SoulShards = player.SoulShards - (Satchel.TempValue * 50)
                  msg ("</br>You buy " + Satchel.TempValue + " mana potion[s].")
                }
                else {
                  msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " + 

(Satchel.TempValue * 50) + " soul shards!")
                }
              }
            }
            case ("enchanting orb") {
              msg ("How many enchanting orbs would you like to purchase; please enter a number. <b>Price per is 500.</b>")
              get input {
                Satchel.TempValue = toint(result)
                if ((player.SoulShards) > (Satchel.TempValue * 500 - 1)) {
                  Satchel.EnchantingOrbs = Satchel.EnchantingOrbs + Satchel.TempValue
                  player.SoulShards = player.SoulShards - (Satchel.TempValue * 500)
                  msg ("</br>You buy " + Satchel.TempValue + " enchanting orb[s].")
                }
                else {
                  msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " + 

(Satchel.TempValue * 500) + " soul shards!")
                }
              }
            }
            case ("enhancement kit") {
              msg ("How many enhancement kits would you like to purchase; please enter a number. <b>Price per is 250.</b>")
              get input {
                Satchel.TempValue = toint(result)
                if ((player.SoulShards) > (Satchel.TempValue * 250 - 1)) {
                  Satchel.EnhancementKits = Satchel.EnhancementKits + Satchel.TempValue
                  player.SoulShards = player.SoulShards - (Satchel.TempValue * 250)
                  msg ("</br>You buy " + Satchel.TempValue + " enhancement kit[s].")
                }
                else {
                  msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " + 

(Satchel.TempValue * 250) + " soul shards!")
                }
              }
            }
            case ("elixir of battle") {
              msg ("How many elixirs of battle would you like to purchase; please enter a number. <b>Price per is 1000.</b>")
              get input {
                Satchel.TempValue = toint(result)
                if ((player.SoulShards) > (Satchel.TempValue * 1000 - 1)) {
                  Satchel.ElixirBattle = Satchel.ElixirBattle+ Satchel.TempValue
                  player.SoulShards = player.SoulShards - (Satchel.TempValue * 1000)
                  msg ("</br>You buy " + Satchel.TempValue + " elixir[s] of battle.")
                }
                else {
                  msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " + 

(Satchel.TempValue * 1000) + " soul shards!")
                }
              }
            }
            case ("elixir of ambrosia") {
              msg ("How many elixirs of ambrosia would you like to purchase; please enter a number. <b>Price per is 1000.</b>")
              get input {
                Satchel.TempValue = toint(result)
                if ((player.SoulShards) > (Satchel.TempValue * 1000 - 1)) {
                  Satchel.ElixirAmbrosia = Satchel.ElixirAmbrosia+ Satchel.TempValue
                  player.SoulShards = player.SoulShards - (Satchel.TempValue * 1000)
                  msg ("</br>You buy " + Satchel.TempValue + " elixir[s] of ambrosia.")
                }
                else {
                  msg ("You don't have enough soul shards. You only have " + player.SoulShards + " soul shards. You need " + 

(Satchel.TempValue * 1000) + " soul shards!")
                }
              }
            }
            default {
              msg ("You decide to not buy anything today.")
            }
          }
        }
        else {
          msg ("You cannot do that while under attack.")
        }
      }
      else {
        msg ("The Celestial is not present here. Thus you cannot make purchases.")
      }

one thing you can do, until someone here finds the issue for you:

remove chunks of code (make sure you create a backup copy of your game file before you start doing this, and you also might want to store your chunks of removed code as a separate file/backup-file, too, just to be safe, on top of also having a backup of your entire game file) until you find the offending part of code, and also, you might want to look at your entire game code, as you may not be correct to where the error actually is located. Assumptions are very bad, I know as I do it all the time myself, and am wrong all the time, hence why assumptions are bad, as they're usually always wrong.


  1. Holy crap, that's a huge, Bazooka, Bagoonga, code! Is that your whole game!?
  2. Half the time, the game shows that message because you typed something in wrong. Or the program itself failed.
    It may be such an in significant thing, that you will have to upload the entire code... Which you did....

Well, I found a problem. Not sure if it's THE problem!

Normal code looks like this:

<!--Saved by Quest 5.7.6404.15496-->
<asl version="550">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="TestRoomStatus">
    <gameid>0bae2a50-2560-4e7c-8016-02867de11bb8</gameid>
    <version>1.0</version>
    <firstpublished>2017</firstpublished>
    <feature_advancedscripts />
    <customstatuspane />
    <roomenter type="script"><![CDATA[
      oRoomObj = player.parent
      if (oRoomObj.name <> "Start") {
        if (HasAttribute (oRoomObj, "SpecialRoom")) {
          s = "<table width=\"100%\"><tr>"
          s = s + "   <td style=\"text-align:center;\" width=\"100%\"><span id=\"roomalias-span\">---</span></td>"
          s = s + " </tr>"
          s = s + "</table>"
          JS.setCustomStatus (s)
          if (HasScript(oRoomObj, "changedalias")) {
            do (oRoomObj, "changedalias")
          }
        }
      }
      if (HasScript(player, "changedalias")) {
        do (player, "changedalias")
      }
    ]]></roomenter>
    <start type="script"><![CDATA[
      foreach (room, AllObjects()) {
        if (room.name <> "Start") {
          if (HasAttribute (room, "SpecialRoom")) {
            room.changedalias => {
              // When a room's alias is changed, we change the status pane only if the player is in that room
              // Whether the if() line is necessary will depend on your gameplay, but it does no harm to include it
              if (Contains (this, player)) {
                JS.eval ("$('#roomalias-span').html('" + this.alias + "');")
              }
            }
          }
        }
        room.alias = "A Room"
      }
    ]]></start>
  </game>
  <object name="Building1">
    <inherit name="editor_object" />
    <object name="Room1">
      <inherit name="TheRoom" />
      <enter type="script">
        Room1.alias = "Room 1"
      </enter>
      <exit alias="east" to="Room2">
        <inherit name="eastdirection" />
      </exit>
      <object name="player">
        <inherit name="editor_object" />
        <inherit name="editor_player" />
        <alias>Player 1</alias>
      </object>
      <exit alias="northeast" to="Room3">
        <inherit name="northeastdirection" />
      </exit>
    </object>
  </object>
  <object name="Building2">
    <inherit name="editor_object" />
    <object name="Room2">
      <inherit name="TheRoom" />
      <enter type="script">
        Room2.alias = "Room 2"
      </enter>
      <exit alias="north" to="Room3">
        <inherit name="northdirection" />
      </exit>
      <exit alias="west" to="Room1">
        <inherit name="westdirection" />
      </exit>
    </object>
  </object>
  <object name="Building3">
    <inherit name="editor_object" />
    <object name="Room3">
      <inherit name="TheRoom" />
      <enter type="script">
        Room3.alias = "Room\' 3"
      </enter>
      <exit alias="south" to="Room2">
        <inherit name="southdirection" />
      </exit>
      <exit alias="southwest" to="Room1">
        <inherit name="southwestdirection" />
      </exit>
    </object>
  </object>
  
  <type name="TheRoom">
    <inherit name="editor_room" />
	<SpecialRoom type="boolean">true</SpecialRoom>
  </type>  
  
</asl>

Your code has too many spaces. Indents. Whatever you call it.


Well, the code is within huge nested conditionals.

Here is the general flow of it:

type "buy" (executes the command)

1st switch = Choose what you want to buy; say spells.
2nd switch = Choose what tier of spells; say 3rd tier.
3rd switch = Choose which spell you want to buy; say Terrify.
then
more conditionals to determine if you have the money, and to ensure that you don't already have the spell to prevent buying something you don't need. If those are acceptable, then you buy the spell and lose the money.

That's the general flow of the command. You can buy consumables, spells, weapons, shields, armor, and training.

I'm sure there is better ways of doing this stuff, but up to now its worked flawlessly.

=======

When I copied the code, from code view, it had all those spaces already present. So I dunno what to say on the too many indents/spaces. Generally spaces/indents before a < or { or [ has no effect on the compilation process for most other languages, dunno why it would be an issue here. I can understand if you added a space before or after a variable name (ie Spellbook. ArcaneZap), as that would imply a syntax error.

========

Its a small portion of my game, actually. If you think this is complex, you should see my spellcasting code or my PlayerUpdates turnscript.

========

I agree that assuming one place has the problem code in it is not always the correct place, which is why I tried several different troubleshooting steps, as the program was quite fine to run the script before I added the 7th tier of spells. Somewhere between making and completing it something went wrong. So, I removed the 7th tier, and it still didn't work, so the problem isn't in the 7th tier.


@ jmnevil54:

quest (and many languages too) is (are) programmed to handle indenting, white/blank lines (new lines: "carriage returns": terminology still used with computers from the printing press days: the first "keyboards" and "keyboard" handling, lol), and spaces/white-spaces. Which is wonderful as it makes code easier for humans to understand: read, write, edit, and/or trouble-shoot.

his code is only a segment/chunk of code, it's not the entire game code, as he's missing a lot of required code stuff for a full game code (the 'asl' GAME OBJECT and the 'game' Game Settings Object, and etc).

if you look at the leftmost column (0:null to 31:unit separator), you can see some of these things that came from the first keyboards: printing presses:

http://www.asciitable.com


Well. I just removed the entire system of purchasing spells from the code, placed the spell code elsewhere (in a different file) and copied the code without the spell buying code back into my game.

The game now loads the script.

So...

Here is the spell purchasing code; as I've narrowed down that the issue is somewhere in this code section, it might help you guys figure out what I did wrong. Code:

              msg ("Which level of spells would you like to purchase from? (<b>1st</b>), (<b>2nd</b>), (<b>3rd</b>), (<b>4th</b>), (<b>5th</b>), (<b>6th</b>), (<b>7th</b>)")
              get input {
                switch (result) {
                  case ("1st") {
                    msg ("First level spells cost <b>100</b> soul shards each. The first level spells available to purchase are:<br/>")
                    if (Spellbook.KnowMinorHealing = false) {
                      msg ("Available: (<b>minor healing</b>)")
                    }
                    if (Spellbook.KnowMinorAid = false) {
                      msg ("Available: (<b>minor aid</b>)")
                    }
                    if (Spellbook.KnowAnalysis = false) {
                      msg ("Available: (<b>analysis</b>)")
                    }
                    if (Spellbook.KnowMinorRejuvenation = false) {
                      msg ("Available: (<b>minor rejuvenation</b>)")
                    }
                    if (Spellbook.KnowArcaneZap = false) {
                      msg ("Available: (<b>arcane zap</b>)")
                    }
                    if (Spellbook.KnowFirebolt = false) {
                      msg ("Available: (<b>firebolt</b>)")
                    }
                    msg ("Which spell would you like to purchase?")
                    get input {
                      switch (result) {
                        case ("arcane zap") {
                          if (Spellbook.KnowArcaneZap = false) {
                            if (player.SoulShards > 99) {
                              msg ("<br/>You learn the spell Arcane Zap.")
                              Spellbook.KnowArcaneZap = true
                              player.SoulShards = player.SoulShards - 100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("minor healing") {
                          if (Spellbook.KnowMinorHealing = false) {
                            if (player.SoulShards > 99) {
                              msg ("<br/>You learn the spell Minor Healing.")
                              Spellbook.KnowMinorHealing = true
                              player.SoulShards = player.SoulShards - 100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("firebolt") {
                          if (Spellbook.KnowFirebolt = false) {
                            if (player.SoulShards > 99) {
                              msg ("<br/>You learn the spell Firebolt.")
                              Spellbook.KnowFirebolt = true
                              player.SoulShards = player.SoulShards - 100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("minor aid") {
                          if (Spellbook.KnowMinorAid = false) {
                            if (player.SoulShards > 99) {
                              msg ("<br/>You learn the spell Minor Aid.")
                              Spellbook.KnowMinorAid = true
                              player.SoulShards = player.SoulShards - 100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("analysis") {
                          if (Spellbook.KnowAnalysis = false) {
                            if (player.SoulShards > 99) {
                              msg ("<br/>You learn the spell Analysis.")
                              Spellbook.KnowAnalysis = true
                              player.SoulShards = player.SoulShards - 100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("minor rejuvenation") {
                          if (Spellbook.KnowMinorRejuvenation = false) {
                            if (player.SoulShards > 99) {
                              msg ("<br/>You learn the spell Minor Rejuvenation.")
                              Spellbook.KnowMinorRejuvenation = true
                              player.SoulShards = player.SoulShards - 100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        default {
                          msg ("You decide to not buy a spell today.")
                        }
                      }
                    }
                  }
                  case ("2nd") {
                    msg ("Second level spells cost <b>300</b> soul shards each. The second level spells available to purchase are:<br/>")
                    if (Spellbook.KnowMinorBlessing = false) {
                      msg ("Available: (<b>minor blessing</b>)")
                    }
                    if (Spellbook.KnowMinorRegeneration = false) {
                      msg ("Available: (<b>minor regeneration</b>)")
                    }
                    if (Spellbook.KnowMinorHaste = false) {
                      msg ("Available: (<b>minor haste</b>)")
                    }
                    if (Spellbook.KnowRelocate = false) {
                      msg ("Available: (<b>relocate</b>)")
                    }
                    if (Spellbook.KnowPiercingZap = false) {
                      msg ("Available: (<b>piercing zap</b>)")
                    }
                    if (Spellbook.KnowIcyLance = false) {
                      msg ("Available: (<b>icy lance</b>)")
                    }
                    if (Spellbook.KnowAcidSpray = false) {
                      msg ("Available: (<b>acid spray</b>)")
                    }
                    msg ("Which spell would you like to purchase?")
                    get input {
                      switch (result) {
                        case ("icy lance") {
                          if (Spellbook.KnowIcyLance = false) {
                            if (player.SoulShards > 299) {
                              msg ("<br/>You learn the spell Icy Lance.")
                              Spellbook.KnowIcyLance = true
                              player.SoulShards = player.SoulShards - 300
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("minor blessing") {
                          if (Spellbook.KnowMinorBlessing = false) {
                            if (player.SoulShards > 299) {
                              msg ("<br/>You learn the spell Minor Blessing.")
                              Spellbook.KnowMinorBlessing = true
                              player.SoulShards = player.SoulShards - 300
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("acid spray") {
                          if (Spellbook.KnowAcidSpray = false) {
                            if (player.SoulShards > 299) {
                              msg ("<br/>You learn the spell Acid Spray.")
                              Spellbook.KnowAcidSpray = true
                              player.SoulShards = player.SoulShards - 300
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("piercing zap") {
                          if (Spellbook.KnowPiercingZap = false) {
                            if (player.SoulShards > 299) {
                              msg ("<br/>You learn the spell Piercing Zap.")
                              Spellbook.KnowPiercingZap = true
                              player.SoulShards = player.SoulShards - 300
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("minor regeneration") {
                          if (Spellbook.KnowMinorRegeneration = false) {
                            if (player.SoulShards > 299) {
                              msg ("<br/>You learn the spell Minor Regeneration.")
                              Spellbook.KnowMinorRegeneration = true
                              player.SoulShards = player.SoulShards - 300
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("relocate") {
                          if (Spellbook.KnowRelocate = false) {
                            if (player.SoulShards > 299) {
                              msg ("<br/>You learn the spell Relocate.")
                              Spellbook.KnowRelocate = true
                              player.SoulShards = player.SoulShards - 300
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("minor haste") {
                          if (Spellbook.KnowMinorHaste = false) {
                            if (player.SoulShards > 299) {
                              msg ("<br/>You learn the spell Minor Haste.")
                              Spellbook.KnowMinorHaste = true
                              player.SoulShards = player.SoulShards - 300
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        default {
                          msg ("You decide to not buy a spell today.")
                        }
                      }
                    }
                  }
                  case ("3rd") {
                    msg ("Third level spells cost <b>500</b> soul shards each. The third level spells available to purchase are:<br/>")
                    if (Spellbook.KnowHealing = false) {
                      msg ("Available: (<b>healing</b>)")
                    }
                    if (Spellbook.KnowSpellPotencyI = false) {
                      msg ("Available: (<b>spell potency i</b>)")
                    }
                    if (Spellbook.KnowAid = false) {
                      msg ("Available: (<b>aid</b>)")
                    }
                    if (Spellbook.KnowTerrify = false) {
                      msg ("Available: (<b>terrify</b>)")
                    }
                    if (Spellbook.KnowPiercingLance = false) {
                      msg ("Available: (<b>piercing lance</b>)")
                    }
                    if (Spellbook.KnowMagicZot = false) {
                      msg ("Available: (<b>magic zot</b>)")
                    }
                    if (Spellbook.KnowShockBolt = false) {
                      msg ("Available: (<b>shock bolt</b>)")
                    }
                    msg ("Which spell would you like to purchase?")
                    get input {
                      switch (result) {
                        case ("magic zot") {
                          if (Spellbook.KnowMagicZot = false) {
                            if (player.SoulShards > 499) {
                              msg ("<br/>You learn the spell Magic Zot.")
                              Spellbook.KnowMagicZot = true
                              player.SoulShards = player.SoulShards - 500
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("healing") {
                          if (Spellbook.KnowHealing = false) {
                            if (player.SoulShards > 499) {
                              msg ("<br/>You learn the spell Healing.")
                              Spellbook.KnowHealing = true
                              player.SoulShards = player.SoulShards - 500
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("shock bolt") {
                          if (Spellbook.KnowShockBolt = false) {
                            if (player.SoulShards > 499) {
                              msg ("<br/>You learn the spell Shock Bolt.")
                              Spellbook.KnowShockBolt = true
                              player.SoulShards = player.SoulShards - 500
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("piercing lance") {
                          if (Spellbook.KnowPiercingLance = false) {
                            if (player.SoulShards > 499) {
                              msg ("<br/>You learn the spell Piercing Lance.")
                              Spellbook.KnowPiercingLance = true
                              player.SoulShards = player.SoulShards - 500
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("aid") {
                          if (Spellbook.KnowAid = false) {
                            if (player.SoulShards > 499) {
                              msg ("<br/>You learn the spell Aid.")
                              Spellbook.KnowAid = true
                              player.SoulShards = player.SoulShards - 500
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("terrify") {
                          if (Spellbook.KnowTerrify = false) {
                            if (player.SoulShards > 499) {
                              msg ("<br/>You learn the spell Terrify.")
                              Spellbook.KnowTerrify = true
                              player.SoulShards = player.SoulShards - 500
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("spell potency i") {
                          if (Spellbook.KnowSpellPotencyI = false) {
                            if (player.SoulShards > 499) {
                              msg ("<br/>You learn the spell Spell Potency I.")
                              Spellbook.KnowSpellPotencyI = true
                              player.SoulShards = player.SoulShards - 500
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        default {
                          msg ("You decide to not buy a spell today.")
                        }
                      }
                    }
                  }
                  case ("4th") {
                    msg ("Fourth level spells cost <b>700</b> soul shards each. The fourth level spells available to purchase are:<br/>")
                    if (Spellbook.KnowBlessing = false) {
                      msg ("Available: (<b>blessing</b>)")
                    }
                    if (Spellbook.KnowRegeneration = false) {
                      msg ("Available: (<b>regeneration</b>)")
                    }
                    if (Spellbook.KnowHaste = false) {
                      msg ("Available: (<b>haste</b>)")
                    }
                    if (Spellbook.KnowRejuvenation = false) {
                      msg ("Available: (<b>rejuvenation</b>)")
                    }
                    if (Spellbook.KnowInvisibility = false) {
                      msg ("Available: (<b>invisibilty</b>)")
                    }
                    if (Spellbook.KnowPiercingZot = false) {
                      msg ("Available: (<b>piercing zot</b>)")
                    }
                    if (Spellbook.KnowFireball = false) {
                      msg ("Available: (<b>fireball</b>)")
                    }
                    if (Spellbook.KnowAgony = false) {
                      msg ("Available: (<b>agony</b>)")
                    }
                    msg ("Which spell would you like to purchase?")
                    get input {
                      switch (result) {
                        case ("piercing zot") {
                          if (Spellbook.KnowPiercingZot = false) {
                            if (player.SoulShards > 699) {
                              msg ("<br/>You learn the spell Piercing Zot.")
                              Spellbook.KnowPiercingZot = true
                              player.SoulShards = player.SoulShards - 700
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("blessing") {
                          if (Spellbook.KnowBlessing = false) {
                            if (player.SoulShards > 699) {
                              msg ("<br/>You learn the spell Blessing.")
                              Spellbook.KnowBlessing = true
                              player.SoulShards = player.SoulShards - 700
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("agony") {
                          if (Spellbook.KnowAgony = false) {
                            if (player.SoulShards > 699) {
                              msg ("<br/>You learn the spell Agony.")
                              Spellbook.KnowAgony = true
                              player.SoulShards = player.SoulShards - 700
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("fireball") {
                          if (Spellbook.KnowFireball = false) {
                            if (player.SoulShards > 699) {
                              msg ("<br/>You learn the spell Fireballl.")
                              Spellbook.KnowFireball = true
                              player.SoulShards = player.SoulShards - 700
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("regeneration") {
                          if (Spellbook.KnowRegeneration = false) {
                            if (player.SoulShards > 699) {
                              msg ("<br/>You learn the spell Regeneration.")
                              Spellbook.KnowRegeneration = true
                              player.SoulShards = player.SoulShards - 700
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("invisibility") {
                          if (Spellbook.KnowInvisibility = false) {
                            if (player.SoulShards > 699) {
                              msg ("<br/>You learn the spell Invisibility.")
                              Spellbook.KnowInvisibility = true
                              player.SoulShards = player.SoulShards - 700
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("haste") {
                          if (Spellbook.KnowHaste = false) {
                            if (player.SoulShards > 699) {
                              msg ("<br/>You learn the spell Haste.")
                              Spellbook.KnowHaste = true
                              player.SoulShards = player.SoulShards - 700
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("rejuvenation") {
                          if (Spellbook.KnowRejuvenation = false) {
                            if (player.SoulShards > 699) {
                              msg ("<br/>You learn the spell Rejuvenation.")
                              Spellbook.KnowRejuvenation = true
                              player.SoulShards = player.SoulShards - 700
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        default {
                          msg ("You decide to not buy a spell today.")
                        }
                      }
                    }
                  }
                  case ("5th") {
                    msg ("Fifth level spells cost <b>900</b> soul shards each. The fifth level spells available to purchase are:<br/>")
                    if (Spellbook.KnowMajorHealing = false) {
                      msg ("Available: (<b>major healing</b>)")
                    }
                    if (Spellbook.KnowMajorAid = false) {
                      msg ("Available: (<b>major aid</b>)")
                    }
                    if (Spellbook.KnowPowerWeaponI = false) {
                      msg ("Available: (<b>power weapon i</b>)")
                    }
                    if (Spellbook.KnowForceShieldI = false) {
                      msg ("Available: (<b>force shield i</b>)")
                    }
                    if (Spellbook.KnowPiercingFireball = false) {
                      msg ("Available: (<b>piercing fireball</b>)")
                    }
                    if (Spellbook.KnowConeOfCold = false) {
                      msg ("Available: (<b>cone of cold</b>)")
                    }
                    if (Spellbook.KnowExplosion = false) {
                      msg ("Available: (<b>explosion</b>)")
                    }
                    msg ("Which spell would you like to purchase?")
                    get input {
                      switch (result) {
                        case ("piercing fireball") {
                          if (Spellbook.KnowPiercingFireball = false) {
                            if (player.SoulShards > 899) {
                              msg ("<br/>You learn the spell Piercing Fireball.")
                              Spellbook.KnowPiercingFireball = true
                              player.SoulShards = player.SoulShards - 900
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("major healing") {
                          if (Spellbook.KnowMajorHealing = false) {
                            if (player.SoulShards > 899) {
                              msg ("<br/>You learn the spell Major Healing.")
                              Spellbook.KnowMajorHealing = true
                              player.SoulShards = player.SoulShards - 900
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("major aid") {
                          if (Spellbook.KnowMajorAid = false) {
                            if (player.SoulShards > 899) {
                              msg ("<br/>You learn the spell Major Aid.")
                              Spellbook.KnowMajorAid = true
                              player.SoulShards = player.SoulShards - 900
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("explosion") {
                          if (Spellbook.KnowExplosion = false) {
                            if (player.SoulShards > 899) {
                              msg ("<br/>You learn the spell Explosion.")
                              Spellbook.KnowExplosion = true
                              player.SoulShards = player.SoulShards - 900
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("cone of cold") {
                          if (Spellbook.KnowConeOfCold = false) {
                            if (player.SoulShards > 899) {
                              msg ("<br/>You learn the spell Cone of Cold.")
                              Spellbook.KnowConeOfCold = true
                              player.SoulShards = player.SoulShards - 900
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("power weapon i") {
                          if (Spellbook.KnowPowerWeaponI = false) {
                            if (player.SoulShards > 899) {
                              msg ("<br/>You learn the spell Power Weapon I.")
                              Spellbook.KnowPowerWeaponI = true
                              player.SoulShards = player.SoulShards - 900
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("force shield i") {
                          if (Spellbook.KnowForceShieldI = false) {
                            if (player.SoulShards > 899) {
                              msg ("<br/>You learn the spell Force Shield I.")
                              Spellbook.KnowForceShieldI = true
                              player.SoulShards = player.SoulShards - 900
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        default {
                          msg ("You decide to not buy a spell today.")
                        }
                      }
                    }
                  }
                  case ("6th") {
                    msg ("Sixth level spells cost <b>1100</b> soul shards each. The sixth level spells available to purchase are:<br/>")
                    if (Spellbook.KnowMajorBlessing = false) {
                      msg ("Available: (<b>major blessing</b>)")
                    }
                    if (Spellbook.KnowMajorRegeneration = false) {
                      msg ("Available: (<b>major regeneration</b>)")
                    }
                    if (Spellbook.KnowMajorHaste = false) {
                      msg ("Available: (<b>major haste</b>)")
                    }
                    if (Spellbook.KnowSpellPotencyII = false) {
                      msg ("Available: (<b>spell potency ii</b>)")
                    }
                    if (Spellbook.KnowPiercingCold = false) {
                      msg ("Available: (<b>piercing cold</b>)")
                    }
                    if (Spellbook.KnowInferno = false) {
                      msg ("Available: (<b>inferno</b>)")
                    }
                    if (Spellbook.KnowBlizzard = false) {
                      msg ("Available: (<b>blizzard</b>)")
                    }
                    msg ("Which spell would you like to purchase?")
                    get input {
                      switch (result) {
                        case ("piercing cold") {
                          if (Spellbook.KnowPiercingCold = false) {
                            if (player.SoulShards > 1099) {
                              msg ("<br/>You learn the spell Piercing Cold.")
                              Spellbook.KnowPiercingCold = true
                              player.SoulShards = player.SoulShards - 1100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("major blessing") {
                          if (Spellbook.KnowMajorBlessing = false) {
                            if (player.SoulShards > 1099) {
                              msg ("<br/>You learn the spell Major Blessing.")
                              Spellbook.KnowMajorBlessing = true
                              player.SoulShards = player.SoulShards - 1100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("major regeneration") {
                          if (Spellbook.KnowMajorRegeneration = false) {
                            if (player.SoulShards > 1099) {
                              msg ("<br/>You learn the spell Major Regeneration.")
                              Spellbook.KnowMajorRegeneration = true
                              player.SoulShards = player.SoulShards - 1100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("blizzard") {
                          if (Spellbook.KnowBlizzard = false) {
                            if (player.SoulShards > 1099) {
                              msg ("<br/>You learn the spell Blizzard.")
                              Spellbook.KnowBlizzard = true
                              player.SoulShards = player.SoulShards - 1100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("inferno") {
                          if (Spellbook.KnowInferno = false) {
                            if (player.SoulShards > 1099) {
                              msg ("<br/>You learn the spell Inferno.")
                              Spellbook.KnowInferno = true
                              player.SoulShards = player.SoulShards - 1100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("major haste") {
                          if (Spellbook.KnowMajorHaste = false) {
                            if (player.SoulShards > 1099) {
                              msg ("<br/>You learn the spell Major Haste.")
                              Spellbook.KnowMajorHaste = true
                              player.SoulShards = player.SoulShards - 1100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        case ("spell potency ii") {
                          if (Spellbook.KnowSpellPotencyII = false) {
                            if (player.SoulShards > 1099) {
                              msg ("<br/>You learn the spell Spell Potency II.")
                              Spellbook.KnowSpellPotencyII = true
                              player.SoulShards = player.SoulShards - 1100
                            }
                            else {
                              msg ("You lack the soul shards.")
                            }
                          }
                          else {
                            msg ("You know that spell already.")
                          }
                        }
                        default {
                          msg ("You decide to not buy a spell today.")
                        }
                      }
                    }
                  }

@ lord palandus:

an obvious possibility (and bad assumption, lol. I told you I love assumptions too, even though usually am wrong):

check your scripting 'order of operations', if you're nesting/indenting and/or location of scripts is off, it'll cause issues.

ALSO: if you do any looping and/or having multiple blocks of code running at the same time, when using any of the code that gets user input ('get input', 'show menu / ShowMenu', 'ask / Ask', Commands, etc), you'll have errors too. You got to be really careful with scripting's 'order of operations' with getting user input, as with quest, it doesn't have anything (without getting into the technicality that some other thread explained about --- I should favorite/bookmark that thread, lol) that halts/stops scripts from running, unfortunately.


also, keep cutting out chunks of that code and again and again... until you whittle it down to the very small segment of code that is the actual problem (hopefully, you don't have multiple errors spread out... that's more difficult to trouble-shoot, obviously).


it'll likely be some typo or missing character/symbol... but with how much code you got right now... it'll be hard to find...

hence why you got to narrow down your offending code... to what is the actual chunk of offending code. That's too much code to find some small typo / missing character/symbol... as these errors are very hard things to find/notice... unfortunately.


  1. I've been doing all of this nesting and order of operations within the UI, and not the code view. I can understand me making a mistake in the order of operations if I was doing it in code view, but the issue occurred while doing it in the UI view.

  2. Order of operations was working flawlessly until I added the new spells today. I didn't touch the order of operations at all when I added the new spells, so order of operations shouldn't be the issue.

  3. Most of the time though, it will spew an error about such a situation of having two things asking for input at the same time, or would hang, if I created an infinite loop. This is the first time it has refused to load the script after doing work in the UI only.

  4. The only things I did was add new spells to the command. And fix one spell that was using the old system that I had missed when I refactored the spell buy code in V3 (which is operational and has no issues) Its possible that that spell was borked and by messing with it borked the rest of the command. That spell was LV6, Inferno, for reference.

  5. I'll try cutting Inferno spell, and see if it accepts that.

  6. I dunno, but if it was a missing character or variable it would scream at me about incorrect syntax. This situation is entirely different.


I think it needs two more lines at the end with just a } on each.


Added two more end squiggly brackets ( } ) and still fails to load. Even tried just one and it still fails to load.

Also tried removing the offending spell Inferno and that didn't do it.

So, its looking like I'll just have to rebuild the spell purchasing code; better than having to rebuild everything, but I can't figure out the issue with the code. But, now that I HAVE to rebuild it, I might as well figure out a better way of doing it, right! So, I might be able to implement a better system with a List or possibly a Dictionary. Can lists or dictionaries be created beforehand (before the game starts) or are they only available at runtime?


The lack of literal dictionaries and lists was one of the hardest things for me to get used to in Quest. Most of the time, for a string list you can get away with doing something like directions = Split("north;south;east;west", ";") for a List.

Or you can use objects; create an object for each spell, with attributes to determine its cost.
If I was doing something like this I'd probably use objects, and use Quest's parser to match the player's input against the names. That's a stylistic choice, though; if you want the player to have to type the exact spell name, or allow abbreviations.


Well, the way I handle spells is by flags, variables, and Booleans attached to a single object, the Spellbook. Likely, I'd have to use a string list, otherwise I'd be looking at a complete redesign of the entire game, if I were to go the object route. Plus, wouldn't you have to have the objects on hand/visible/in inventory, if you went the object route, for doing spells?


Added two more end squiggly brackets ( } ) and still fails to load. Even tried just one and it still fails to load.

I added an object "Spellbook" to a game, then added a command "test", pasted in your code, added two } at the end, and the game will play (the command gives an error because Spellbook is missing some attributes though).


Well then there must be something wrong with my project, in general then.

Because I pasted the entire buy command, plus two extra } at the end in a separate command with the spell buy code and it won't accept it. And I tried pasting the entire spell buy code all buy itself in a separate command, with two extra } at the end, and it didn't work either.

I also tried pasting the code in a completely different project with two extra } at the end of the spell buy code and it still fails to load.

Dunno why it is working for you though.

Mind pasting the code that you fixed and I'll see if it works on my end too?


Here is a whole game:

<!--Saved by Quest 5.7.6404.15496-->
<asl version="550">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="push dir">
    <gameid>6d8e63c1-d3fd-41e5-8499-2d717e5399a3</gameid>
    <version>1.0</version>
    <firstpublished>2017</firstpublished>
    <start type="script">
    </start>
    <object name="Spellbook">
      <inherit name="editor_object" />
    </object>
  </game>
  <object name="room">
    <inherit name="editor_room" />
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
  </object>
  <command>
    <pattern>test</pattern>
    <script><![CDATA[
      msg ("Which level of spells would you like to purchase from? (<b>1st</b>), (<b>2nd</b>), (<b>3rd</b>), (<b>4th</b>), (<b>5th</b>), (<b>6th</b>), (<b>7th</b>)")
      get input {
        switch (result) {
          case ("1st") {
            msg ("First level spells cost <b>100</b> soul shards each. The first level spells available to purchase are:<br/>")
            if (Spellbook.KnowMinorHealing = false) {
              msg ("Available: (<b>minor healing</b>)")
            }
            if (Spellbook.KnowMinorAid = false) {
              msg ("Available: (<b>minor aid</b>)")
            }
            if (Spellbook.KnowAnalysis = false) {
              msg ("Available: (<b>analysis</b>)")
            }
            if (Spellbook.KnowMinorRejuvenation = false) {
              msg ("Available: (<b>minor rejuvenation</b>)")
            }
            if (Spellbook.KnowArcaneZap = false) {
              msg ("Available: (<b>arcane zap</b>)")
            }
            if (Spellbook.KnowFirebolt = false) {
              msg ("Available: (<b>firebolt</b>)")
            }
            msg ("Which spell would you like to purchase?")
            get input {
              switch (result) {
                case ("arcane zap") {
                  if (Spellbook.KnowArcaneZap = false) {
                    if (player.SoulShards > 99) {
                      msg ("<br/>You learn the spell Arcane Zap.")
                      Spellbook.KnowArcaneZap = true
                      player.SoulShards = player.SoulShards - 100
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("minor healing") {
                  if (Spellbook.KnowMinorHealing = false) {
                    if (player.SoulShards > 99) {
                      msg ("<br/>You learn the spell Minor Healing.")
                      Spellbook.KnowMinorHealing = true
                      player.SoulShards = player.SoulShards - 100
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("firebolt") {
                  if (Spellbook.KnowFirebolt = false) {
                    if (player.SoulShards > 99) {
                      msg ("<br/>You learn the spell Firebolt.")
                      Spellbook.KnowFirebolt = true
                      player.SoulShards = player.SoulShards - 100
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("minor aid") {
                  if (Spellbook.KnowMinorAid = false) {
                    if (player.SoulShards > 99) {
                      msg ("<br/>You learn the spell Minor Aid.")
                      Spellbook.KnowMinorAid = true
                      player.SoulShards = player.SoulShards - 100
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("analysis") {
                  if (Spellbook.KnowAnalysis = false) {
                    if (player.SoulShards > 99) {
                      msg ("<br/>You learn the spell Analysis.")
                      Spellbook.KnowAnalysis = true
                      player.SoulShards = player.SoulShards - 100
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("minor rejuvenation") {
                  if (Spellbook.KnowMinorRejuvenation = false) {
                    if (player.SoulShards > 99) {
                      msg ("<br/>You learn the spell Minor Rejuvenation.")
                      Spellbook.KnowMinorRejuvenation = true
                      player.SoulShards = player.SoulShards - 100
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                default {
                  msg ("You decide to not buy a spell today.")
                }
              }
            }
          }
          case ("2nd") {
            msg ("Second level spells cost <b>300</b> soul shards each. The second level spells available to purchase are:<br/>")
            if (Spellbook.KnowMinorBlessing = false) {
              msg ("Available: (<b>minor blessing</b>)")
            }
            if (Spellbook.KnowMinorRegeneration = false) {
              msg ("Available: (<b>minor regeneration</b>)")
            }
            if (Spellbook.KnowMinorHaste = false) {
              msg ("Available: (<b>minor haste</b>)")
            }
            if (Spellbook.KnowRelocate = false) {
              msg ("Available: (<b>relocate</b>)")
            }
            if (Spellbook.KnowPiercingZap = false) {
              msg ("Available: (<b>piercing zap</b>)")
            }
            if (Spellbook.KnowIcyLance = false) {
              msg ("Available: (<b>icy lance</b>)")
            }
            if (Spellbook.KnowAcidSpray = false) {
              msg ("Available: (<b>acid spray</b>)")
            }
            msg ("Which spell would you like to purchase?")
            get input {
              switch (result) {
                case ("icy lance") {
                  if (Spellbook.KnowIcyLance = false) {
                    if (player.SoulShards > 299) {
                      msg ("<br/>You learn the spell Icy Lance.")
                      Spellbook.KnowIcyLance = true
                      player.SoulShards = player.SoulShards - 300
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("minor blessing") {
                  if (Spellbook.KnowMinorBlessing = false) {
                    if (player.SoulShards > 299) {
                      msg ("<br/>You learn the spell Minor Blessing.")
                      Spellbook.KnowMinorBlessing = true
                      player.SoulShards = player.SoulShards - 300
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("acid spray") {
                  if (Spellbook.KnowAcidSpray = false) {
                    if (player.SoulShards > 299) {
                      msg ("<br/>You learn the spell Acid Spray.")
                      Spellbook.KnowAcidSpray = true
                      player.SoulShards = player.SoulShards - 300
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("piercing zap") {
                  if (Spellbook.KnowPiercingZap = false) {
                    if (player.SoulShards > 299) {
                      msg ("<br/>You learn the spell Piercing Zap.")
                      Spellbook.KnowPiercingZap = true
                      player.SoulShards = player.SoulShards - 300
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("minor regeneration") {
                  if (Spellbook.KnowMinorRegeneration = false) {
                    if (player.SoulShards > 299) {
                      msg ("<br/>You learn the spell Minor Regeneration.")
                      Spellbook.KnowMinorRegeneration = true
                      player.SoulShards = player.SoulShards - 300
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("relocate") {
                  if (Spellbook.KnowRelocate = false) {
                    if (player.SoulShards > 299) {
                      msg ("<br/>You learn the spell Relocate.")
                      Spellbook.KnowRelocate = true
                      player.SoulShards = player.SoulShards - 300
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("minor haste") {
                  if (Spellbook.KnowMinorHaste = false) {
                    if (player.SoulShards > 299) {
                      msg ("<br/>You learn the spell Minor Haste.")
                      Spellbook.KnowMinorHaste = true
                      player.SoulShards = player.SoulShards - 300
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                default {
                  msg ("You decide to not buy a spell today.")
                }
              }
            }
          }
          case ("3rd") {
            msg ("Third level spells cost <b>500</b> soul shards each. The third level spells available to purchase are:<br/>")
            if (Spellbook.KnowHealing = false) {
              msg ("Available: (<b>healing</b>)")
            }
            if (Spellbook.KnowSpellPotencyI = false) {
              msg ("Available: (<b>spell potency i</b>)")
            }
            if (Spellbook.KnowAid = false) {
              msg ("Available: (<b>aid</b>)")
            }
            if (Spellbook.KnowTerrify = false) {
              msg ("Available: (<b>terrify</b>)")
            }
            if (Spellbook.KnowPiercingLance = false) {
              msg ("Available: (<b>piercing lance</b>)")
            }
            if (Spellbook.KnowMagicZot = false) {
              msg ("Available: (<b>magic zot</b>)")
            }
            if (Spellbook.KnowShockBolt = false) {
              msg ("Available: (<b>shock bolt</b>)")
            }
            msg ("Which spell would you like to purchase?")
            get input {
              switch (result) {
                case ("magic zot") {
                  if (Spellbook.KnowMagicZot = false) {
                    if (player.SoulShards > 499) {
                      msg ("<br/>You learn the spell Magic Zot.")
                      Spellbook.KnowMagicZot = true
                      player.SoulShards = player.SoulShards - 500
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("healing") {
                  if (Spellbook.KnowHealing = false) {
                    if (player.SoulShards > 499) {
                      msg ("<br/>You learn the spell Healing.")
                      Spellbook.KnowHealing = true
                      player.SoulShards = player.SoulShards - 500
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("shock bolt") {
                  if (Spellbook.KnowShockBolt = false) {
                    if (player.SoulShards > 499) {
                      msg ("<br/>You learn the spell Shock Bolt.")
                      Spellbook.KnowShockBolt = true
                      player.SoulShards = player.SoulShards - 500
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("piercing lance") {
                  if (Spellbook.KnowPiercingLance = false) {
                    if (player.SoulShards > 499) {
                      msg ("<br/>You learn the spell Piercing Lance.")
                      Spellbook.KnowPiercingLance = true
                      player.SoulShards = player.SoulShards - 500
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("aid") {
                  if (Spellbook.KnowAid = false) {
                    if (player.SoulShards > 499) {
                      msg ("<br/>You learn the spell Aid.")
                      Spellbook.KnowAid = true
                      player.SoulShards = player.SoulShards - 500
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("terrify") {
                  if (Spellbook.KnowTerrify = false) {
                    if (player.SoulShards > 499) {
                      msg ("<br/>You learn the spell Terrify.")
                      Spellbook.KnowTerrify = true
                      player.SoulShards = player.SoulShards - 500
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("spell potency i") {
                  if (Spellbook.KnowSpellPotencyI = false) {
                    if (player.SoulShards > 499) {
                      msg ("<br/>You learn the spell Spell Potency I.")
                      Spellbook.KnowSpellPotencyI = true
                      player.SoulShards = player.SoulShards - 500
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                default {
                  msg ("You decide to not buy a spell today.")
                }
              }
            }
          }
          case ("4th") {
            msg ("Fourth level spells cost <b>700</b> soul shards each. The fourth level spells available to purchase are:<br/>")
            if (Spellbook.KnowBlessing = false) {
              msg ("Available: (<b>blessing</b>)")
            }
            if (Spellbook.KnowRegeneration = false) {
              msg ("Available: (<b>regeneration</b>)")
            }
            if (Spellbook.KnowHaste = false) {
              msg ("Available: (<b>haste</b>)")
            }
            if (Spellbook.KnowRejuvenation = false) {
              msg ("Available: (<b>rejuvenation</b>)")
            }
            if (Spellbook.KnowInvisibility = false) {
              msg ("Available: (<b>invisibilty</b>)")
            }
            if (Spellbook.KnowPiercingZot = false) {
              msg ("Available: (<b>piercing zot</b>)")
            }
            if (Spellbook.KnowFireball = false) {
              msg ("Available: (<b>fireball</b>)")
            }
            if (Spellbook.KnowAgony = false) {
              msg ("Available: (<b>agony</b>)")
            }
            msg ("Which spell would you like to purchase?")
            get input {
              switch (result) {
                case ("piercing zot") {
                  if (Spellbook.KnowPiercingZot = false) {
                    if (player.SoulShards > 699) {
                      msg ("<br/>You learn the spell Piercing Zot.")
                      Spellbook.KnowPiercingZot = true
                      player.SoulShards = player.SoulShards - 700
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("blessing") {
                  if (Spellbook.KnowBlessing = false) {
                    if (player.SoulShards > 699) {
                      msg ("<br/>You learn the spell Blessing.")
                      Spellbook.KnowBlessing = true
                      player.SoulShards = player.SoulShards - 700
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("agony") {
                  if (Spellbook.KnowAgony = false) {
                    if (player.SoulShards > 699) {
                      msg ("<br/>You learn the spell Agony.")
                      Spellbook.KnowAgony = true
                      player.SoulShards = player.SoulShards - 700
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("fireball") {
                  if (Spellbook.KnowFireball = false) {
                    if (player.SoulShards > 699) {
                      msg ("<br/>You learn the spell Fireballl.")
                      Spellbook.KnowFireball = true
                      player.SoulShards = player.SoulShards - 700
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("regeneration") {
                  if (Spellbook.KnowRegeneration = false) {
                    if (player.SoulShards > 699) {
                      msg ("<br/>You learn the spell Regeneration.")
                      Spellbook.KnowRegeneration = true
                      player.SoulShards = player.SoulShards - 700
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("invisibility") {
                  if (Spellbook.KnowInvisibility = false) {
                    if (player.SoulShards > 699) {
                      msg ("<br/>You learn the spell Invisibility.")
                      Spellbook.KnowInvisibility = true
                      player.SoulShards = player.SoulShards - 700
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("haste") {
                  if (Spellbook.KnowHaste = false) {
                    if (player.SoulShards > 699) {
                      msg ("<br/>You learn the spell Haste.")
                      Spellbook.KnowHaste = true
                      player.SoulShards = player.SoulShards - 700
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("rejuvenation") {
                  if (Spellbook.KnowRejuvenation = false) {
                    if (player.SoulShards > 699) {
                      msg ("<br/>You learn the spell Rejuvenation.")
                      Spellbook.KnowRejuvenation = true
                      player.SoulShards = player.SoulShards - 700
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                default {
                  msg ("You decide to not buy a spell today.")
                }
              }
            }
          }
          case ("5th") {
            msg ("Fifth level spells cost <b>900</b> soul shards each. The fifth level spells available to purchase are:<br/>")
            if (Spellbook.KnowMajorHealing = false) {
              msg ("Available: (<b>major healing</b>)")
            }
            if (Spellbook.KnowMajorAid = false) {
              msg ("Available: (<b>major aid</b>)")
            }
            if (Spellbook.KnowPowerWeaponI = false) {
              msg ("Available: (<b>power weapon i</b>)")
            }
            if (Spellbook.KnowForceShieldI = false) {
              msg ("Available: (<b>force shield i</b>)")
            }
            if (Spellbook.KnowPiercingFireball = false) {
              msg ("Available: (<b>piercing fireball</b>)")
            }
            if (Spellbook.KnowConeOfCold = false) {
              msg ("Available: (<b>cone of cold</b>)")
            }
            if (Spellbook.KnowExplosion = false) {
              msg ("Available: (<b>explosion</b>)")
            }
            msg ("Which spell would you like to purchase?")
            get input {
              switch (result) {
                case ("piercing fireball") {
                  if (Spellbook.KnowPiercingFireball = false) {
                    if (player.SoulShards > 899) {
                      msg ("<br/>You learn the spell Piercing Fireball.")
                      Spellbook.KnowPiercingFireball = true
                      player.SoulShards = player.SoulShards - 900
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("major healing") {
                  if (Spellbook.KnowMajorHealing = false) {
                    if (player.SoulShards > 899) {
                      msg ("<br/>You learn the spell Major Healing.")
                      Spellbook.KnowMajorHealing = true
                      player.SoulShards = player.SoulShards - 900
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("major aid") {
                  if (Spellbook.KnowMajorAid = false) {
                    if (player.SoulShards > 899) {
                      msg ("<br/>You learn the spell Major Aid.")
                      Spellbook.KnowMajorAid = true
                      player.SoulShards = player.SoulShards - 900
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("explosion") {
                  if (Spellbook.KnowExplosion = false) {
                    if (player.SoulShards > 899) {
                      msg ("<br/>You learn the spell Explosion.")
                      Spellbook.KnowExplosion = true
                      player.SoulShards = player.SoulShards - 900
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("cone of cold") {
                  if (Spellbook.KnowConeOfCold = false) {
                    if (player.SoulShards > 899) {
                      msg ("<br/>You learn the spell Cone of Cold.")
                      Spellbook.KnowConeOfCold = true
                      player.SoulShards = player.SoulShards - 900
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("power weapon i") {
                  if (Spellbook.KnowPowerWeaponI = false) {
                    if (player.SoulShards > 899) {
                      msg ("<br/>You learn the spell Power Weapon I.")
                      Spellbook.KnowPowerWeaponI = true
                      player.SoulShards = player.SoulShards - 900
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("force shield i") {
                  if (Spellbook.KnowForceShieldI = false) {
                    if (player.SoulShards > 899) {
                      msg ("<br/>You learn the spell Force Shield I.")
                      Spellbook.KnowForceShieldI = true
                      player.SoulShards = player.SoulShards - 900
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                default {
                  msg ("You decide to not buy a spell today.")
                }
              }
            }
          }
          case ("6th") {
            msg ("Sixth level spells cost <b>1100</b> soul shards each. The sixth level spells available to purchase are:<br/>")
            if (Spellbook.KnowMajorBlessing = false) {
              msg ("Available: (<b>major blessing</b>)")
            }
            if (Spellbook.KnowMajorRegeneration = false) {
              msg ("Available: (<b>major regeneration</b>)")
            }
            if (Spellbook.KnowMajorHaste = false) {
              msg ("Available: (<b>major haste</b>)")
            }
            if (Spellbook.KnowSpellPotencyII = false) {
              msg ("Available: (<b>spell potency ii</b>)")
            }
            if (Spellbook.KnowPiercingCold = false) {
              msg ("Available: (<b>piercing cold</b>)")
            }
            if (Spellbook.KnowInferno = false) {
              msg ("Available: (<b>inferno</b>)")
            }
            if (Spellbook.KnowBlizzard = false) {
              msg ("Available: (<b>blizzard</b>)")
            }
            msg ("Which spell would you like to purchase?")
            get input {
              switch (result) {
                case ("piercing cold") {
                  if (Spellbook.KnowPiercingCold = false) {
                    if (player.SoulShards > 1099) {
                      msg ("<br/>You learn the spell Piercing Cold.")
                      Spellbook.KnowPiercingCold = true
                      player.SoulShards = player.SoulShards - 1100
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("major blessing") {
                  if (Spellbook.KnowMajorBlessing = false) {
                    if (player.SoulShards > 1099) {
                      msg ("<br/>You learn the spell Major Blessing.")
                      Spellbook.KnowMajorBlessing = true
                      player.SoulShards = player.SoulShards - 1100
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("major regeneration") {
                  if (Spellbook.KnowMajorRegeneration = false) {
                    if (player.SoulShards > 1099) {
                      msg ("<br/>You learn the spell Major Regeneration.")
                      Spellbook.KnowMajorRegeneration = true
                      player.SoulShards = player.SoulShards - 1100
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("blizzard") {
                  if (Spellbook.KnowBlizzard = false) {
                    if (player.SoulShards > 1099) {
                      msg ("<br/>You learn the spell Blizzard.")
                      Spellbook.KnowBlizzard = true
                      player.SoulShards = player.SoulShards - 1100
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("inferno") {
                  if (Spellbook.KnowInferno = false) {
                    if (player.SoulShards > 1099) {
                      msg ("<br/>You learn the spell Inferno.")
                      Spellbook.KnowInferno = true
                      player.SoulShards = player.SoulShards - 1100
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("major haste") {
                  if (Spellbook.KnowMajorHaste = false) {
                    if (player.SoulShards > 1099) {
                      msg ("<br/>You learn the spell Major Haste.")
                      Spellbook.KnowMajorHaste = true
                      player.SoulShards = player.SoulShards - 1100
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                case ("spell potency ii") {
                  if (Spellbook.KnowSpellPotencyII = false) {
                    if (player.SoulShards > 1099) {
                      msg ("<br/>You learn the spell Spell Potency II.")
                      Spellbook.KnowSpellPotencyII = true
                      player.SoulShards = player.SoulShards - 1100
                    }
                    else {
                      msg ("You lack the soul shards.")
                    }
                  }
                  else {
                    msg ("You know that spell already.")
                  }
                }
                default {
                  msg ("You decide to not buy a spell today.")
                }
              }
            }
          }
        }
      }
    ]]></script>
  </command>
</asl>

one other possibility that you could look into:

sometimes doing stuff in the GUI/Editor, and then removing it, still leaves the actual code of it in place, which can cause errors.

so, you might want to scour through your entire game code for this type of stuff.

Also, did you edit any of the default/built-in stuff? As you could have made mistakes with it, which is causing your errors with your game.

Lastly, try making a new game, and try out chunks of your code and/or entire code with that new game, and see if it works (then there's just some kind of error with that original game file) or not (there's a problem with your code)


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums