All pastes #739348 Raw Edit

oscript

public text v1 · immutable
·published 2007-10-17 02:25 UTC
rendered paste body
; ::: Scott's OGame Script :::
; Version 1.0
; Special Thanks to everyone in the SeersIRC #ogame Channel for helping me to fix all the bugs and suggestions.
; Credit for all formulas and the wording on some descriptions given to Bibob's guide "All Buildings, Researches, Fleets, and Defences" --- http://board.ogame.org/thread.php?threadid=89308

; Table of Contents

; 1.0 Useful Sites
;--- 1.1 OGame
;--- 1.2 OStat
;--- 1.3 O-Calc
;--- 1.4 GTool
;--- 1.5 DragoSim
;--- 1.6 SpeedSim
;--- 1.7 CR Converter
;--- 1.8 OProjekt
; 2.0 Buildings
;--- 2.1 Metal Mine
;--- 2.2 Crystal Mine
;--- 2.3 Deuterium Synthesizer
;--- 2.4 Solar Plant
;--- 2.5 Fusion Reactor
;--- 2.6 Robotics Factory
;--- 2.7 Nanite Factory
;--- 2.8 Shipyard
;--- 2.9 Metal Storage
;--- 2.10 Crystal Storage
;--- 2.11 Deuterium Tank
;--- 2.12 Reseach Lab
;--- 2.13 Alliance Depot
;--- 2.14 Terraformer
;--- 2.15 Missile Silo
;--- 2.16 Lunar Base
;--- 2.17 Sensor Phalanx
;--- 2.18 Jump Gate
; 3.0 Researches (Technologies)
;--- 3.1 Espionage Technology
;--- 3.2 Computer Technology
;--- 3.3 Weapons Technology
;--- 3.4 Shielding Technology
;--- 3.5 Armour Technology
;--- 3.6 Energy Technology
;--- 3.7 Hyperspace Technology
;--- 3.8 Combustion Drive
;--- 3.9 Impulse Drive
;--- 3.10 Hyperspace Drive
;--- 3.11 Laser Technology
;--- 3.12 Ion Technology
;--- 3.13 Plasma Technology
;--- 3.14 Intergalactic Research Network
;--- 3.15 Graviton Technology
; 4.0 Ships
;--- 4.1 Small Cargo
;--- 4.2 Large Cargo
;--- 4.3 Light Fighter
;--- 4.4 Heavy Fighter
;--- 4.5 Cruiser
;--- 4.6 Battles Ship
;--- 4.7 Colony Ship
;--- 4.8 Recycler
;--- 4.9 Espionage Probe
;--- 4.10 Bomber
;--- 4.11 Solar Satellite
;--- 4.12 Destroyer
;--- 4.13 Death Star
;--- 4.14 Battlecruiser
; 5.0 Defenses
;--- 5.1 Rocket Launcher
;--- 5.2 Light Laser
;--- 5.3 Heavy Laser
;--- 5.4 Gauss Cannon
;--- 5.5 Ion Cannon
;--- 5.6 Plasma Turret
;--- 5.7 Small Shield Dome
;--- 5.8 Large Shield Dome
;--- 5.9 Anti-Ballistic Missiles
;--- 5.10 Interplanetary Missiles
; 6.0 Miscellaneous
;--- 6.1 Moon Destruction
;--- 6.2 Moon Information
;--- 6.3 Harvest




; ### ####### ###
; ### ALIASES ###
; ### ####### ###

alias n notice $nick $1-
alias m msg # $1-

alias nolevelmetal {
  %noise A 7Metal Mine is essential for collecting 7metal.  Each increased level will produce more 7metal and cost more 3energy.  Use 4!metal <level> (or 4!metal2 <level> for the speed universe) to see more about a specific level.
  halt
}
alias nolevelcrystal {
  %noise A 12Crystal Mine is essential for collecting 12crystal.  Each increased level will produce more 12crystal and cost more 3energy.  Use 4!crystal <level> (or 4!crystal2 <level> for the speed universe) to see more about a specific level.
  halt
}
alias noleveldeut {
  %noise A 6Deuterium Synthesizer is essential for collecting 6deuterium.  Each increased level will produce more 6deuterium and cost more 3energy.  Use 4!deut <level> <max temp> (or 4!deut2 <level> <max temp> for the speed universe) to see more about a specific level.
  halt
}
alias nolevelsolar {
  %noise A 3Solar Plant is the primary source of 3energy for your planet and without 3energy your mines will stop working.  Each increased level will produce more 3energy per hour.  Use 4!solar <level> to see more about a specific level.
  halt
}
alias nolevelfusion {
  %noise A 10Fusion Reactor is a secondary source of 3energy.  It produces more 3energy than a 3solar plant but requires 6deuterium to keep it operational.  Each increased level will produce more 3energy per hour, but consume more 6deuterium per hour.  Use 4!fusion <level> <max temp> (or 4!fusion2 <level> <max temp> for the speed universe) to see more about a specific level.  [Requirements: Deuterium Synthesizer (5) - Energy Technology (3)]
  halt
}
alias nolevelrobo {
  %noise A 10Robotics Factory decreases the building time of buildings.  Use 4!robo <level> to see more about a specific level.
  halt
}
alias nolevelnanite {
  %noise A 10Nanite Factory is a better 10Robotics Factory as it cuts the building time of buildings, ships, and defenses in half with each level.  Use 4!nanite <level> to see more about a specific level. 14[Requirements: Robotics Factory (10) - Computer Technology (10)]
  halt
}
alias nolevelshipyard {
  %noise A 10Shipyard is needed to build ships and defenses.  Each increased level lowers building time of ships or defenses.  Use 4!shipyard <level> to see more about a specific level. 14[Requirements: Robotics Factory (2)]
  halt
}
alias nolevelmstorage {
  %noise A 7Metal Storage is needed to increase the ammount of 7metal you can store on a planet before the 7metal mine stops working.  Use 4!mstorage <level> to see more about a specific level.
  halt
}
alias nolevelcstorage {
  %noise A 12Crystal Storage is needed to increase the ammount of 12crystal you can store on a planet before the 12crystal mine stops working.  Use 4!cstorage <level> to see more about a specific level.
  halt
}
alias noleveldtank {
  %noise A 6Deuterium Tank is needed to increase the ammount of 6deuterium you can store on a planet before the 6deuterium synthesizer stops working.  Use 4!dtank <level> to see more about a specific level.
  halt
}
alias nolevellab {
  %noise A 10Research Lab is needed to research technologies.  Each increased level will decrease the ammount of time needed to research a technology.  Use 4!lab <level> to see more about a specific level.
  halt
}
alias nolevelterra {
  %noise A 10Terraformer creates more fields for your planet.  Each increased level will give $+ 4 5  $+ extra fields ( $+ 4 1  $+ of which is used up by the 10Terraformer itself).  Use 4!terra <level> to see more about a specific level. 14[Requirements: Nanite Factory (1) - Energy Technology (12)]
  halt
}
alias noleveladepot {
  %noise The 10Alliance Depot supplies fuel to friendly fleets in orbit helping with ACS Defense.  Each increased level can supply $+ 6 10,000 deuterium  $+ per hour to the orbiting fleet  Use 4!adepot <level> to see more about a specific level. 13[NOTE: This is only available in a universe that has ACS]
  halt
}
alias nolevelsilo {
  %noise The 10Missile Silo is necessary for building 2ABMs (2Anti-Ballistic Missiles) and 4IPMs (4Interplanetary Missiles).  Each increased level will hold $+ 4 10  $+ more 2ABMs or $+ 4 5  $+ more 4IPMs (or a combination of the two).  Use 4!silo <level> to see more about a specific level.
  halt
}
alias nolevellunar {
  %noise A 10Lunar Base creates more fields for your moon.  Each increased level will give $+ 4 3  $+ extra fields ( $+ 4 1  $+ of which is used up by the 10Lunar Base itself).  Use 4!lunar <level> to see more about a specific level. 13[NOTE: A lunar base can only be built on a moon]
  halt
}
alias nolevellanx {
  %noise A 10Sensor Phalanx can be used to scan planets to see their incoming and outgoing fleets.  Each increased level will be able to scan systems further away from you.  Use 4!lanx <level> to see more about a specific level. 13[NOTE: A sensor phalanx can only be built on a moon]
  halt
}
alias noleveljg {
  %noise A 10Jump Gate is used to send a fleet (13no resources) instantly to another moon of yours that has a 10jump gate.  This building has no additional uses after level $+ 4 1  $+ .  Use 4!jg <level> to find out more about a specific level. 13[NOTE: A jump gate can only be built on a moon]
  halt
}
alias nolevelesp {
  %noise 10Espionage Technology is used to spy on others and detect incoming fleets.  Each increased level will make it easier for you to see all of the enemies information.  Use 4!esptech <level> to find out more about a specific level. 14[Requirements: Research Lab (3)]
  halt
}
alias nolevelcomp {
  %noise 10Computer Technology is used to control more fleets.  Each increased level will give $+ 4 1  $+ additional fleet slot.  Use 4!comptech <level> to find out more about a specific level. 14[Requirements: Research Lab (1)]
  halt
}
alias nolevelweapon {
  %noise 10Weapon Technology is a vital technology for battles.  Each increased level will increase weapon strength by $+ 4 10% $+ .  Use 4!weapon <level> to find out more about a specific level. 14[Requirements: Research Lab (4)]
  halt
}
alias nolevelshielding {
  %noise 10Shielding Technology is a vital technology for battles.  Each increased level will increase shield strength by $+ 4 10% $+ .  Use 4!shielding <level> to find out more about a specific level. 14[Requirements: Energy Technology (3) - Research Lab (6)]
  halt
}
alias nolevelarmour {
  %noise 10Armour Technology is a vital technology for battles.  Each increased level will increase armour strength by $+ 4 10% $+ .  Use 4!armour <level> to find out more about a specific level. 14[Requirements: Research Lab (2)]
  halt
}
alias nolevelenergy {
  %noise 10Energy Technology is a requirements technology and currently has no uses beyond level $+ 4 12 $+ .  Use 4!energy <level> to find out more about a specific level. 14[Requirements: Research Lab (1)]
  halt
}
alias nolevelhypertech {
  %noise 10Hyperspace Technology is a requirements technology and currently has no uses beyond level $+ 4 8.  Use 4!hypertech <level> to find out more about a specific level. 14[Requirements: Energy Technology (5) - Shielding Technology (5) - Research Lab (7)]
  halt
}
alias nolevelcdrive {
  %noise The 10Combustion Engine is used by 10Small Cargos, 10Large Cargos, 10Light Fighters, 10Recyclers, and 10Espionage Probes.  Each increased level will increase the base speed of these ships by $+ 4 10%.  Use 4!cdrive <level> to find out more about a specific level. 14[Requirements: Energy Technology (1) - Research Lab (1)]
  halt
}
alias nolevelidrive {
  %noise The 10Impulse Engine is used by 10Heavy Fighters, 10Cruisers, 10Colony Ships, and 10Bombers.  Each increased level will increase the base speed of these ships by $+ 4 10%.  Use 4!idrive <level> to find out more about a specific level. 14[Requirements: Energy Technology (1) - Research Lab (2)]
  halt
}
alias nolevelhdrive {
  %noise The 10Hyperspace Engine is used by 10Battle Ships, 10Destroyers, 10Death Stars, and 10Battle Cruisers.  Each increased level will increase the base speed of these ships by $+ 4 10%.  Use 4!hdrive <level> to find out more about a specific level. 14[Requirements: Hyperspace Technology (3) - Research Lab (7)]
  halt
}
alias nolevellaser {
  %noise 10Laser Technology is a requirements technology and currently has no uses beyond level $+ 4 12.  Use 4!laser <level> to find out more about a specific level. 14[Requirements: Energy Technology (2) - Research Lab (1)]
  halt
}
alias nolevelion {
  %noise 10Ion Technology is a requirements technology and currently has no uses beyond level $+ 4 5.  Use 4!ion <level> to find out more about a specific level. 14[Requirements: Energy Technology (4) - Laser Technology (5) - Research Lab (4)]
  halt
}
alias nolevelplasma {
  %noise 10Plasma Technology is a requirements technology and currently has no uses beyond level $+ 4 7.  Use 4!plasma <level> to find out more about a specific level. 14[Requirements: Energy Technology (8) - Laser Technology (10) - Ion Technology (5) - Research Lab (4)]
  halt
}
alias nolevelirn {
  %noise The 10Intergalactic Research Network is used to link up your Research Labs to greatly decrease research time (this technology has no use above level $+ 4 8.  Use 4!irn <level> to find out more about a specific level. 14[Requirements: Computer Technology (8) - Hyperspace Technology (8) - Research Lab (10)]
  halt
}
alias nolevelgravi {
  %noise 10Graviton Technology is required to build 10Death Stars and currently has no use beyond level $+ 4 1.  Use 4!gravi <level> to find out more about a specific level. 14[Requirements: Research Lab (12)]
  halt
}
alias nonumbersc {
  %noise 10Small Cargos are used to transport resources and have a maximum capacity of $+ 13 5,000  $+ units.  Use 4!sc <number> to find the cost of a number of ships.  14[Requirements: Shipyard (2) - Combustion Drive (2)]
  halt
}
alias nonumberlc {
  %noise 10Large Cargos are used to transport resources and have a maximum capacity of $+ 13 25,000  $+ units.  Use 4!lc <number> to find the cost of a number of ships.  14[Requirements: Shipyard (4) - Combustion Drive (6)]
  halt
}
alias nonumberlf {
  %noise 10Light Fighters are the first combat ships that can be built.  They have low fire power and used primarily as fodder later in the game.  Use 4!lf <number> to find the cost of a number of ships.  14[Requirements: Shipyard (1) - Combustion Drive (1)]
  halt
}
alias nonumberhf {
  %noise 10Heavy Fighters are nearly three times stronger than 10Light Fighters and are sometimes used as fodder by large fleeters.  Use 4!hf <number> to find the cost of a number of ships.  14[Requirements: Shipyard (3) - Armour Technology (2) - Impulse Drive (2)]
  halt
}
alias nonumbercr {
  %noise 10Cruisers are fairly strong ships that are valuable for their rapid fire against 10Light Fighters and 10Rocket Launchers.  Use 4!cr <number> to find the cost of a number of ships.  14[Requirements: Shipyard (5) - Ion Technology (2) - Impulse Drive (4)]
  halt
}
alias nonumberbs {
  %noise 10Battleships are the main ships in most fleets.  They are strong with good fire power and only have rapid fire from 10Death Stars and 10Battlecruisers.  Use 4!bs <number> to find the cost of a number of ships.  14[Requirements: Shipyard (7) - Hyperspace Drive (4)]
  halt
}
alias nonumbercs {
  %noise 10Colony Ships are needed to colonize new planets.  You can have a maximum of $+ 4 8 colonies and each colony can have a maximum of $+ 4 319 fields.  Use 4!cs <number> to find the cost of a number of ships.  14[Requirements: Shipyard (4) - Impulse Drive (3)]
  halt
}
alias nonumberrec {
  %noise 10Recyclers are needed to harvest debris floating in space.  Each 10recycler can harvest up to $+ 13 20,000  $+ units in a debris field.  Use 4!rec <number> to find the cost of a number of ships.  14[Requirements: Shipyard (4) - Combustion Drive (6) - Shielding Technology (2)]
  halt
}
alias nonumberprobe {
  %noise 10Espionage Probes are needed to spy on enemy planets to get information about resources, fleets, defenses, buildings, and technologies on that planet.  Sending more 10probes will yield more information but result in a larger chance of being shot down.  Use 4!probe <number> to find the cost of a number of ships.  14[Requirements: Shipyard (3) - Combustion Drive (3) - Espionage Technology (2)]
  halt
}
alias nonumberbomb {
  %noise 10Bombers are strong ships that are used primarily against defenses due to their large rapid fire against 10rocket launchers, 10light lasers, 10heavy lasers, and 10ion cannons.  Use 4!bomb <number> to find the cost of a number of ships.  14[Requirements: Shipyard (8) - Impulse Drive (6) - Laser Technology (8) - Plasma Technology (5)]
  halt
}
alias nonumbersat {
  %noise 10Solar Satellites are another source of 3energy for your planet.  They cannot be moved from the planet they are built on and produce more 3energy on planets with low slot numbers (1, 2, and 3).  Use 4!sat <number> <max temp> to find the cost of a number of ships.  14[Requirements: Shipyard (1)]
  halt
}
alias nonumberdessie {
  %noise 4Destroyers are the strongest ships that aren't rediculously expensive.  They eat up a lot of 6deuterium as the move through space, but $+ 4 70 can destroy a 10Death Star.  Use 4!dessie <number> to find the cost of a number of ships.  14[Requirements: Shipyard (9) - Hyperspace Drive (6) - Hyperspace Technology (5)]
  halt
}
alias nonumberds {
  %noise 10Death Stars are the strongest ships in the game.  Because of its low speed, 10Death Stars are primarily only used for turtle bashing, moon destruction missions, and saving 6deuterium on fleet saves.  Use 4!ds <number> to find the cost of a number of ships.  14[Requirements: Shipyard (12) - Hyperspace Drive (7) - Hyperspace Technology (6) - Graviton Technology (1)]
  halt
}
alias nonumberbc {
  %noise 10Battlecruisers are strong ships with low 6deuterium costs.  They are widely built due to their large rapid fire against 10Battleships and 10Cruisers.  Use 4!bc <number> to find the cost of a number of ships.  14[Requirements: Shipyard (8) - Hyperspace Drive (5) - Hyperspace Technology (5) - Laser Technology (12)]
  halt
}
alias nonumberrl {
  %noise 10Rocket Launchers are the first defensive units that can be built.  In the begining a few are good to stop pure cargo raids, but later in the game they are used just as defense fodder.  Use 4!rl <number> to find the cost of a number of these structures.  14[Requirements: Shipyard (1)]
  halt
}
alias nonumberll {
  %noise 10Light Lasers are slighty more expensive than 10Rocket Launchers and a tad more powerful.  Like 10rocket lauchers, these structures are used primarily as fodder in the late game.  Use 4!ll <number> to find the cost of a number of these structures.  14[Requirements: Shipyard (2) - Energy Technology (1) - Laser Technology (3)]
  halt
}
alias nonumberhl {
  %noise 10Heavy Lasers are a medium sized laser that is nearly $+ 4 4 times stronger than a 10light laser.  Use 4!hl <number> to find the cost of a number of these structures.  14[Requirements: Shipyard (4) - Energy Technology (3) - Laser Technology (6)]
  halt
}
alias nonumbergauss {
  %noise 10Gauss Cannons are the first big defensive sturctures that can be built.  They a quite powerful and can destroy small ships with one shot.  Use 4!gauss <number> to find the cost of a number of these structures.  14[Requirements: Shipyard (6) - Energy Technology (6) - Weapon Technology (3) - Shielding Technology (1)]
  halt
}
alias nonumberic {
  %noise 10Ion Cannons don't have the best fire power for their cost.  Instead, these structures have a larger shield to make up for it.  Use 4!ic <number> to find the cost of a number of these structures.  14[Requirements: Shipyard (4) - Ion Technology (4)]
  halt
}
alias nonumberpt {
  %noise 10Plasma Turrets are the biggest defensive structures that can be built.  They can destroy anything smaller than a 10destroyer in one hit.  Use 4!pt <number> to find the cost of a number of these structures.  14[Requirements: Shipyard (8) - Plasma Technology (7)]
  halt
}
alias nonumberabm {
  %noise 2Anti-Ballistic Missiles are built to stop incoming 4Interplanetary Missiles.  Each 2ABM will destroy one 4IPM and itself.  Use 4!abm <number> to find the cost of a number of these missiles.  14[Requirements: Missile Silo (2)]
  halt
}
alias nonumberipm {
  %noise 4Interplanetary Missiles are sent to other planets to destroy the defenses there.  Defenses destroyed by 4IPMs are not rebuilt.  Use 4!ipm <number> to find the cost of a number of these missiles.  14[Requirements: Missile Silo (4)]
  halt
}
alias badlevel {
  %noise Please use a 4positive integer between $+ 4 1 and $+ 4 50
  halt
}
alias badnumber {
  %noise Please use a 4positive integer between $+ 4 1 and $+ 4 50,000
  halt
}
alias format {
  %noise When 2comparing two levels please have the 14first number be 9smaller than the 14second number. Also, make sure the 14first number is 9no less than $+ 4 0 and the 14second number is 9no more than $+ 4 50.
  halt
}

on $*:text:/^[@!.]oscript on$/si:#ogame: {
  if ((($nick isop $chan)  || ($nick ishop $chan)) && ($me == OScript)) {
    set %oscript 1
    m OScript has been turned ON
  }
}
on $*:text:/^[@!.]oscript off$/si:#ogame: {
  if ((($nick isop $chan)  || ($nick ishop $chan)) && ($me == OScript)) {
    set %oscript 0
    m OScript has been turned OFF
  }
}
on $*:text:/^[@!.]oscript status$/si:#ogame: {
  if ((%oscript == 0) && ($me == OScript)) m OScript is not currently running.  An Op must type 4!oscript on to turn on the script
  if ((%oscript == 1) && ($me == OScript)) m OScript is currently running 
}

on $*:text:*:# {
  if (($chan == #ogame ) && ($me == OScript) && (%oscript == 1)) {
    set %number 1
    if ($left($1,1) == @) set %noise m
    else set %noise n

    if ($regex($1,/^[@!.]colony$/si) == 1) %noise DON'T LISTEN TO FCMSAAB ABOUT COLONIES!!!
    if ($regex($1,/^[@!.]turtle$/si) == 1) %noise One Word: StarKiller58 ... http://img297.imageshack.us/img297/6321/rocketsqa8.png


    ; ### ################### ###
    ; ### 1.0 Useful Websites ###
    ; ### ################### ###

    if ($regex($1,/^[@!.]ogame$/si) == 1) %noise 12http://www.ogame.org
    if ($regex($1,/^[@!.]ostat$/si) == 1) %noise 12http://www.ostat.org/index.php
    if ($regex($1,/^[@!.]ocalc$/si) == 1) %noise 12http://www.o-calc.com/
    if ($regex($1,/^[@!.]gtool$/si) == 1) %noise 12http://firefox1307.freehostia.com/index.php?language=english
    if ($regex($1,/^[@!.]dragosim$/si) == 1) %noise 12http://drago-sim.com/index.php?lang=english
    if ($regex($1,/^[@!.]speedsim$/si) == 1) %noise 12http://www.speedsim.net/
    if ($regex($1,/^[@!.]crconvert(er)?$/si) == 1) %noise 12http://crconv.vafan.se/
    if ($regex($1,/^[@!.]mines$/si) == 1) %noise 12http://mines.oprojekt.net/index.php?o=setLanguage&setLang=en
    if ($regex($1,/^[@!.]records$/si) == 1) %noise 12http://board.ogame.org/thread.php?threadid=25155
    if ($regex($1,/^[@!.]script$/si) == 1) %noise 12http://pastebin.ca/new.php
    if ($regex($1,/^[@!.]commands$/si) == 1) %noise 12http://www.freewebs.com/ogamescript/ --- You can also use !building ; !research ; !ship ; !defense to see all the commands in one catagory

    ; ### ############# ###
    ; ### 2.0 Buildings ###
    ; ### ############# ###

    if ($regex($1,/^[@!.]building(s)?$/si) == 1) %noise The 11building commands are as follows: 4!metal !crystal  !deut  !solar  !fusion  !robo  !nanite  !shipyard  !mstorage  !cstorage  !dtank  !lab  !adepot  !terra  !silo  !lunar  !lanx  !jg --- If you type just the command with no numbers following it you can see general information and the format for the specific command

    ; ### ############## ###
    ; ### 2.1 Metal Mine ###
    ; ### ############## ###

    if ($regex($1,/^[@!.]metal(mine)?(2)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelmetal
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((60 * (1 - (1.5 ^ %second )) / (1 - 1.5)) - (60 * (1 - (1.5 ^ %first )) / (1 - 1.5))) ,0),db)
        set %rccost $bytes($round($calc((15 * (1 - (1.5 ^ %second )) / (1 - 1.5)) - (15 * (1 - (1.5 ^ %first )) / (1 - 1.5))) ,0),db)
        %noise To go from 7Metal Mine level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources
        halt
      }  
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($round($calc(60 * (1.5 ^ (%lvl - 1))) ,0),db)
      set %rccost $bytes($round($calc(15 * (1.5 ^ (%lvl - 1))) ,0),db)
      if ($right($1,1) == 2) {
        set %rprod $bytes($round($calc(2 * 30 * %lvl * (1.1 ^ %lvl )) ,0),db)
        set %speed 14(Speed Universe)
      }
      else {
        set %rprod $bytes($round($calc(30 * %lvl * (1.1 ^ %lvl )) ,0),db)
        unset %speed 
      }
      set %renergy $bytes($round($calc(10 * %lvl * (1.1 ^ %lvl )) ,0),db)
      %noise Level $+ 4 $2  $+ 7Metal Mine %speed will produce $+ 7 %rprod  $+ metal per hour, cost $+ 3 %renergy  $+ energy per hour, and cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to build
      halt
    }

    ; ### ################ ###
    ; ### 2.2 Crystal Mine ###
    ; ### ################ ###

    if ($regex($1,/^[@!.]crystal(mine)?(2)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelcrystal
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((48 * (1 - (1.6 ^ %second )) / (1 - 1.6)) - (48 * (1 - (1.6 ^ %first )) / (1 - 1.6))) ,0),db)
        set %rccost $bytes($round($calc((24 * (1 - (1.6 ^ %second )) / (1 - 1.6)) - (24 * (1 - (1.6 ^ %first )) / (1 - 1.6))) ,0),db)
        %noise To go from 12Crystal Mine level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources
        halt
      }  
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($round($calc(48 * (1.6 ^ (%lvl - 1))) ,0),db)
      set %rccost $bytes($round($calc(24 * (1.6 ^ (%lvl - 1))) ,0),db)
      if ($right($1,1) == 2) {
        set %rprod $bytes($round($calc(2 * 20 * %lvl * (1.1 ^ %lvl )) ,0),db)
        set %speed 14(Speed Universe)
      }
      else {
        set %rprod $bytes($round($calc(20 * %lvl * (1.1 ^ %lvl )) ,0),db)
        unset %speed 
      }      
      set %renergy $bytes($round($calc(10 * %lvl * (1.1 ^ %lvl )) ,0),db)
      %noise Level $+ 4 $2  $+ 12Crystal Mine %speed will produce $+ 12 %rprod  $+ crystal per hour, cost $+ 3 %renergy  $+ energy per hour, and cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to build
      halt
    }

    ; ### ######################### ###
    ; ### 2.3 Deuterium Synthesizer ###
    ; ### ######################### ###

    if ($regex($1,/^[@!.]deut(erium)?(synthesizer)?(2)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) noleveldeut
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((225 * (1 - (1.5 ^ %second )) / (1 - 1.5)) - (225 * (1 - (1.5 ^ %first )) / (1 - 1.5))) ,0),db)
        set %rccost $bytes($round($calc((75 * (1 - (1.5 ^ %second )) / (1 - 1.5)) - (75 * (1 - (1.5 ^ %first )) / (1 - 1.5))) ,0),db)
        %noise To go from 6Deuterium Synthesizer level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources
        halt
      }  
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      if ((!$3) || ($3 !isnum)) {
        n You must include the 10max temperature of the planet. The correct format is 4!deut <level> <max temp>
        halt
      }
      set %lvl $2
      set %maxtemp $3
      set %rmcost $bytes($round($calc(225 * (1.5 ^ (%lvl - 1))) ,0),db)
      set %rccost $bytes($round($calc(75 * (1.5 ^ (%lvl - 1))) ,0),db)
      if ($right($1,1) == 2) {
        set %rprod $bytes($round($calc(2 * 10 * %lvl * (1.1 ^ %lvl ) * (-.002 * %maxtemp + 1.28)) ,0),db)
        set %speed 14(Speed Universe)
      }
      else {
        set %rprod $bytes($round($calc(10 * %lvl * (1.1 ^ %lvl ) * (-.002 * %maxtemp + 1.28)) ,0),db)
        unset %speed 
      }
      set %renergy $bytes($round($calc(20 * %lvl * (1.1 ^ %lvl )) ,0),db)
      %noise Level $+ 4 $2  $+ 6Deuterium Synthesizer %speed will produce $+ 6 %rprod  $+ deuterium per hour, cost $+ 3 %renergy  $+ energy per hour, and cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to build
      halt
    }

    ; ### ############### ###
    ; ### 2.4 Solar Plant ###
    ; ### ############### ###

    if ($regex($1,/^[@!.]solar(plant)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelsolar
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((75 * (1 - (1.5 ^ %second )) / (1 - 1.5)) - (75 * (1 - (1.5 ^ %first )) / (1 - 1.5))) ,0),db)
        set %rccost $bytes($round($calc((30 * (1 - (1.5 ^ %second )) / (1 - 1.5)) - (30 * (1 - (1.5 ^ %first )) / (1 - 1.5))) ,0),db)
        %noise To go from 3Solar Plant level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources
        halt
      }  
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($round($calc(75 * (1.5 ^ (%lvl - 1))) ,0),db)
      set %rccost $bytes($round($calc(30 * (1.5 ^ (%lvl - 1))) ,0),db)
      set %rprod $bytes($round($calc(20 * %lvl * (1.1 ^ %lvl )) ,0),db)
      %noise Level $+ 4 $2  $+ 3Solar Plant will produce $+ 3 %rprod  $+ energy per hour and cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to build
      halt
    }

    ; ### ################## ###
    ; ### 2.5 Fusion Reactor ###
    ; ### ################## ###

    if ($regex($1,/^[@!.]fusion(reactor)?(2)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelfusion
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((900 * (1 - (1.8 ^ %second )) / (1 - 1.8)) - (900 * (1 - (1.8 ^ %first )) / (1 - 1.8))) ,0),db)
        set %rccost $bytes($round($calc((360 * (1 - (1.8 ^ %second )) / (1 - 1.8)) - (360 * (1 - (1.8 ^ %first )) / (1 - 1.8))) ,0),db)
        set %rdcost $bytes($round($calc((180 * (1 - (1.8 ^ %second )) / (1 - 1.8)) - (180 * (1 - (1.8 ^ %first )) / (1 - 1.8))) ,0),db)
        %noise To go from 10Fusion Reactor level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      }  
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      if ((!$3) || ($3 !isnum)) {
        n You must include the 10max temperature of the planet. The correct format is 4!fusion <level> <max temp>
        halt
      }
      set %lvl $2
      set %maxtemp $3
      set %rmcost $bytes($round($calc(900 * (1.8 ^ (%lvl - 1))) ,0),db)
      set %rccost $bytes($round($calc(360 * (1.8 ^ (%lvl - 1))) ,0),db)
      set %rdcost $bytes($round($calc(180 * (1.8 ^ (%lvl - 1))) ,0),db)
      set %rprod $bytes($round($calc(50 * %lvl * (1.1 ^ %lvl )) ,0),db)
      if ($right($1,1) == 2) {
        set %renergy $bytes($round($calc(2 * 10 * %lvl * (1.1 ^ %lvl ) * (-.002 * %maxtemp + 1.28)) ,0),db)
        set %speed 14(Speed Universe)
      }
      else {
        set %renergy $bytes($round($calc(10 * %lvl * (1.1 ^ %lvl ) * (-.002 * %maxtemp + 1.28)) ,0),db)
        unset %speed 
      }
      %noise Level $+ 4 $2  $+ 10Fusion Reactor %speed will produce $+ 3 %rprod  $+ energy per hour, cost $+ 6 %renergy  $+ deuterium per hour, and cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build
      halt
    }

    ; ### #################### ###
    ; ### 2.6 Robotics Factory ###
    ; ### #################### ###

    if ($regex($1,/^[@!.]robo(tics)?(factory)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelrobo
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((400 * (1 - (2 ^ %second )) / (1 - 2)) - (400 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((120 * (1 - (2 ^ %second )) / (1 - 2)) - (120 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((200 * (1 - (2 ^ %second )) / (1 - 2)) - (200 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Robotics Factory level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      } 
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(400 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(120 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(200 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Robotics Factory will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build
      halt
    }

    ; ### ################## ###
    ; ### 2.7 Nanite Factory ###
    ; ### ################## ###

    if ($regex($1,/^[@!.]nanite(factory)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelnanite
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((1000000 * (1 - (2 ^ %second )) / (1 - 2)) - (1000000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((500000 * (1 - (2 ^ %second )) / (1 - 2)) - (500000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((100000 * (1 - (2 ^ %second )) / (1 - 2)) - (100000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Nanite Factory level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      } 
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(1000000 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(500000 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(100000 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Nanite Factory will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build
      halt
    }

    ; ### ############ ###
    ; ### 2.8 Shipyard ###
    ; ### ############ ###

    if ($regex($1,/^[@!.]shipyard$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelshipyard
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((400 * (1 - (2 ^ %second )) / (1 - 2)) - (400 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((200 * (1 - (2 ^ %second )) / (1 - 2)) - (200 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((100 * (1 - (2 ^ %second )) / (1 - 2)) - (100 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Shipyard level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(400 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(200 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(100 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Shipyard will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build
      halt
    }

    ; ### ################# ###
    ; ### 2.9 Metal Storage ###
    ; ### ################# ###

    if ($regex($1,/^[@!.]m(etal)?storage$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelmstorage
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((2000 * (1 - (2 ^ %second )) / (1 - 2)) - (2000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 7Metal Storage level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 0  $+ / $+ 6 0  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(2000 * (2 ^ (%lvl - 1))),db)
      set %capacity $bytes($calc(100000 + 50000*($ceil($calc(1.6 ^ %lvl -1)))),db)
      %noise Level $+ 4 $2  $+ 7Metal Storage will cost ( $+ 7 %rmcost  $+ / $+ 12 0  $+ / $+ 6 0  $+ ) resources to build and can hold $+ 7 %capacity  $+ metal
      halt
    }

    ; ### #################### ###
    ; ### 2.10 Crystal Storage ###
    ; ### #################### ###

    if ($regex($1,/^[@!.]c(rystal)?storage$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelcstorage
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((2000 * (1 - (2 ^ %second )) / (1 - 2)) - (2000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((1000 * (1 - (2 ^ %second )) / (1 - 2)) - (1000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 12Crystal Storage level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(2000 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(1000 * (2 ^ (%lvl - 1))),db)
      set %capacity $bytes($calc(100000 + 50000*($ceil($calc(1.6 ^ %lvl -1)))),db)
      %noise Level $+ 4 $2  $+ 12Crystal Storage will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to build and can hold $+ 12 %capacity  $+ crystal
      halt
    }

    ; ### ################### ###
    ; ### 2.11 Deuterium Tank ###
    ; ### ################### ###

    if ($regex($1,/^[@!.]d(eut)?(erium)?tank$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) noleveldtank
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((2000 * (1 - (2 ^ %second )) / (1 - 2)) - (2000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((2000 * (1 - (2 ^ %second )) / (1 - 2)) - (2000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 6Deuterium Tank level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(2000 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(2000 * (2 ^ (%lvl - 1))),db)
      set %capacity $bytes($calc(100000 + 50000*($ceil($calc(1.6 ^ %lvl -1)))),db)
      %noise Level $+ 4 $2  $+ 6Deuterium Tank will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to build and can hold $+ 6 %capacity  $+ deuterium
      halt
    }

    ; ### ################# ###
    ; ### 2.12 Research Lab ###
    ; ### ################# ###

    if ($regex($1,/^[@!.](r)?(esearch)?lab$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevellab
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((200 * (1 - (2 ^ %second )) / (1 - 2)) - (200 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((400 * (1 - (2 ^ %second )) / (1 - 2)) - (400 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((200 * (1 - (2 ^ %second )) / (1 - 2)) - (200 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Research Lab level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(200 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(400 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(200 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Research Lab will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build
      halt
    }

    ; ### ################ ###
    ; ### 2.13 Terraformer ###
    ; ### ################ ###

    if ($regex($1,/^[@!.]terra(former)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelterra
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rccost $bytes($round($calc((50000 * (1 - (2 ^ %second )) / (1 - 2)) - (50000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((100000 * (1 - (2 ^ %second )) / (1 - 2)) - (100000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %recost $bytes($round($calc((1000 * (1 - (2 ^ %second )) / (1 - 2)) - (1000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Terraformer level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 0  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources and require $+ 3 %recost  $+ energy
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rccost $bytes($calc(50000 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(100000 * (2 ^ (%lvl - 1))),db)
      set %recost $bytes($calc(1000 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Terraformer will cost ( $+ 7 0  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources and requires $+ 3 %recost  $+ energy to build
      halt
    }

    ; ### ################### ###
    ; ### 2.14 Alliance Depot ###
    ; ### ################### ###

    if ($regex($1,/^[@!.]a(lliance)?depot$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) noleveladepot
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((20000 * (1 - (2 ^ %second )) / (1 - 2)) - (20000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((40000 * (1 - (2 ^ %second )) / (1 - 2)) - (40000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Alliance Depot level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(20000 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(40000 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Alliance Depot will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to build
      halt
    }

    ; ### ################# ###
    ; ### 2.15 Missile Silo ###
    ; ### ################# ###

    if ($regex($1,/^[@!.](m)?(issile)?silo$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelsilo
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((20000 * (1 - (2 ^ %second )) / (1 - 2)) - (20000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((20000 * (1 - (2 ^ %second )) / (1 - 2)) - (20000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((1000 * (1 - (2 ^ %second )) / (1 - 2)) - (1000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Missile Silo level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(20000 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(20000 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(1000 * (2 ^ (%lvl - 1))),db)
      if (%lvl > 1) set %abmcap $calc(%lvl * 10)
      else set %abmcap 0
      if (%lvl > 3) set %ipmcap $calc(%lvl * 5)
      else set %ipmcap 0
      %noise Level $+ 4 $2  $+ 10Missile Silo will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build and can hold a maximum of $+ 2 %abmcap  $+ ABMs or $+ 4 %ipmcap  $+ IPMs
      halt
    }

    ; ### ############### ###
    ; ### 2.16 Lunar Base ###
    ; ### ############### ###

    if ($regex($1,/^[@!.]lunar(base)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevellunar
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((20000 * (1 - (2 ^ %second )) / (1 - 2)) - (20000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((40000 * (1 - (2 ^ %second )) / (1 - 2)) - (40000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((20000 * (1 - (2 ^ %second )) / (1 - 2)) - (20000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Lunar Base level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(20000 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(40000 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(20000 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Lunar Base will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build
      halt
    }

    ; ### ################### ###
    ; ### 2.17 Sensor Phalanx ###
    ; ### ################### ###

    if ($regex($1,/^[@!.](sensor)?(pha)?lanx$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevellanx
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((20000 * (1 - (2 ^ %second )) / (1 - 2)) - (20000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((40000 * (1 - (2 ^ %second )) / (1 - 2)) - (40000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((20000 * (1 - (2 ^ %second )) / (1 - 2)) - (20000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Sensor Phalanx level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(20000 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(40000 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(20000 * (2 ^ (%lvl - 1))),db)
      set %range $calc((%lvl ^ 2) - 1)
      %noise Level $+ 4 $2  $+ 10Sensor Phalanx will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build and can be used on planets up to $+ 5 %range  $+ systems away
      halt
    }

    ; ### ############## ###
    ; ### 2.18 Jump Gate ###
    ; ### ############## ###

    if ($regex($1,/^[@!.]j(ump)?g(ate)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) noleveljg
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((2000000 * (1 - (2 ^ %second )) / (1 - 2)) - (2000000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((4000000 * (1 - (2 ^ %second )) / (1 - 2)) - (4000000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((2000000 * (1 - (2 ^ %second )) / (1 - 2)) - (2000000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Jump Gate level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(2000000 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(4000000 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(2000000 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Jump Gate will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build
      halt
    }

    ; ### ############################# ###
    ; ### 3.0 Researches (Technologies) ###
    ; ### ############################# ###

    if (($regex($1,/^[@!.]research(es)?$/si) == 1) || ($regex($1,/^[@!.]tech(s)?(nologies)?$/si) == 1)) %noise The 11research commands are as follows: 4!esptech !comptech  !weapon  !shielding  !armour  !energy  !hypertech  !cdrive  !idrive  !hdrive  !laser  !ion  !plasma  !irn  !gravi   --- If you type just the command with no numbers following it you can see general information and the format for the specific command

    ; ### ######################## ###
    ; ### 3.1 Espionage Technology ###
    ; ### ######################## ###

    if ($regex($1,/^[@!.]esp(ionage)?tech(nology)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelesp
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((200 * (1 - (2 ^ %second )) / (1 - 2)) - (200 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((1000 * (1 - (2 ^ %second )) / (1 - 2)) - (1000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((200 * (1 - (2 ^ %second )) / (1 - 2)) - (200 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Espionage Technology level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(200 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(1000 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(200 * (2 ^ (%lvl - 1))),db)
      unset %vision
      if ((%lvl > 1) && (%lvl < 4)) set -n %vision At this level, you can detect how many ships are in an attacking fleet
      if ((%lvl > 3) && (%lvl < 8)) set -n %vision At this level, you can detect what ship types are in an attacking fleet
      if (%lvl > 7) set -n %vision At this level, you can detect how many of each ship are in an attacking fleet
      %noise Level $+ 4 $2  $+ 10Espionage Technology will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to research. %vision
      halt
    }

    ; ### ####################### ###
    ; ### 3.2 Computer Technology ###
    ; ### ####################### ###

    if ($regex($1,/^[@!.]comp(uter)?tech(nology)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelcomp
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rccost $bytes($round($calc((400 * (1 - (2 ^ %second )) / (1 - 2)) - (400 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((600 * (1 - (2 ^ %second )) / (1 - 2)) - (600 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Computer Technology level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 0  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rccost $bytes($calc(400 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(600 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Computer Technology will cost ( $+ 7 0  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to research
      halt
    }

    ; ### ##################### ###
    ; ### 3.3 Weapon Technology ###
    ; ### ##################### ###

    if ($regex($1,/^[@!.]weapon(tech)?(nology)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelweapon
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((800 * (1 - (2 ^ %second )) / (1 - 2)) - (800 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((200 * (1 - (2 ^ %second )) / (1 - 2)) - (200 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Weapon Technology level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(800 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(200 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Weapon Technology will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to research
      halt
    }

    ; ### ######################## ###
    ; ### 3.4 Shielding Technology ###
    ; ### ######################## ###

    if ($regex($1,/^[@!.]shielding(tech)?(nology)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelshielding
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((200 * (1 - (2 ^ %second )) / (1 - 2)) - (200 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((600 * (1 - (2 ^ %second )) / (1 - 2)) - (600 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Shielding Technology level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(200 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(600 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Shielding Technology will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to research
      halt
    }

    ; ### ##################### ###
    ; ### 3.5 Armour Technology ###
    ; ### ##################### ###

    if ($regex($1,/^[@!.]armour(tech)?(nology)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelarmour
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((1000 * (1 - (2 ^ %second )) / (1 - 2)) - (1000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Armour Technology level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 0  $+ / $+ 6 0  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(1000 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Armour Technology will cost ( $+ 7 %rmcost  $+ / $+ 12 0  $+ / $+ 6 0  $+ ) resources to research
      halt
    }

    ; ### ##################### ###
    ; ### 3.6 Energy Technology ###
    ; ### ##################### ###

    if ($regex($1,/^[@!.]energy(tech)?(nology)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelenergy
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rccost $bytes($round($calc((800 * (1 - (2 ^ %second )) / (1 - 2)) - (800 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((400 * (1 - (2 ^ %second )) / (1 - 2)) - (400 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Energy Technology level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 0  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rccost $bytes($calc(800 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(400 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Energy Technology will cost ( $+ 7 0  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to research
      halt
    }

    ; ### ######################### ###
    ; ### 3.7 Hyperspace Technology ###
    ; ### ######################### ###

    if ($regex($1,/^[@!.]hyper(space)?tech(nology)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelhypertech
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rccost $bytes($round($calc((4000 * (1 - (2 ^ %second )) / (1 - 2)) - (4000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((2000 * (1 - (2 ^ %second )) / (1 - 2)) - (2000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Hyperspace Technology level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 0  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rccost $bytes($calc(4000 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(2000 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Hyperspace Technology will cost ( $+ 7 0  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to research
      halt
    }

    ; ### #################### ###
    ; ### 3.8 Combustion Drive ###
    ; ### #################### ###

    if ($regex($1,/^[@!.]c(ombustion)?drive$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelcdrive
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((400 * (1 - (2 ^ %second )) / (1 - 2)) - (400 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((600 * (1 - (2 ^ %second )) / (1 - 2)) - (600 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Combustion Drive level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 0  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(400 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(600 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Combustion Drive will cost ( $+ 7 %rmcost  $+ / $+ 12 0  $+ / $+ 6 %rdcost  $+ ) resources to research
      halt
    }

    ; ### ################# ###
    ; ### 3.9 Impulse Drive ###
    ; ### ################# ###

    if ($regex($1,/^[@!.]i(mpulse)?drive$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelidrive
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((2000 * (1 - (2 ^ %second )) / (1 - 2)) - (2000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((4000 * (1 - (2 ^ %second )) / (1 - 2)) - (4000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((600 * (1 - (2 ^ %second )) / (1 - 2)) - (600 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Impulse Drive level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(2000 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(4000 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(600 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Impulse Drive will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to research
      halt
    }

    ; ### ##################### ###
    ; ### 3.10 Hyperspace Drive ###
    ; ### ##################### ###

    if ($regex($1,/^[@!.]h(yper)?(space)?drive$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelhdrive
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((10000 * (1 - (2 ^ %second )) / (1 - 2)) - (10000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((20000 * (1 - (2 ^ %second )) / (1 - 2)) - (20000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((6000 * (1 - (2 ^ %second )) / (1 - 2)) - (6000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Hyperspace Drive level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(10000 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(20000 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(6000 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Hyperspace Drive will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to research
      halt
    }

    ; ### ##################### ###
    ; ### 3.11 Laser Technology ###
    ; ### ##################### ###

    if ($regex($1,/^[@!.]laser(tech)?(nology)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevellaser
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((200 * (1 - (2 ^ %second )) / (1 - 2)) - (200 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((100 * (1 - (2 ^ %second )) / (1 - 2)) - (100 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Laser Technology level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(200 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(100 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Laser Technology will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to research
      halt
    }

    ; ### ################### ###
    ; ### 3.12 Ion Technology ###
    ; ### ################### ###

    if ($regex($1,/^[@!.]ion(tech)?(nology)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelion
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((1000 * (1 - (2 ^ %second )) / (1 - 2)) - (1000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((300 * (1 - (2 ^ %second )) / (1 - 2)) - (300 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((100 * (1 - (2 ^ %second )) / (1 - 2)) - (100 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Ion Technology level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(1000 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(300 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(100 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Ion Technology will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to research
      halt
    }

    ; ### ###################### ###
    ; ### 3.13 Plasma Technology ###
    ; ### ###################### ###

    if ($regex($1,/^[@!.]plasma(tech)?(nology)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelplasma
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((2000 * (1 - (2 ^ %second )) / (1 - 2)) - (2000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((4000 * (1 - (2 ^ %second )) / (1 - 2)) - (4000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((1000 * (1 - (2 ^ %second )) / (1 - 2)) - (1000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Plasma Technology level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(2000 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(4000 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(1000 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Plasma Technology will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to research
      halt
    }

    ; ### ################################### ###
    ; ### 3.14 Intergalactic Research Network ###
    ; ### ################################### ###

    if ($regex($1,/^[@!.]i(ntergalactic)?r(esearch)?n(etwork)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelirn
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %rmcost $bytes($round($calc((240000 * (1 - (2 ^ %second )) / (1 - 2)) - (240000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rccost $bytes($round($calc((400000 * (1 - (2 ^ %second )) / (1 - 2)) - (400000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        set %rdcost $bytes($round($calc((160000 * (1 - (2 ^ %second )) / (1 - 2)) - (160000 * (1 - (2 ^ %first )) / (1 - 2))) ,0),db)
        %noise To go from 10Intergalactic Research Network level $+ 4 %first  $+ to level $+ 4 %second  $+ will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %rmcost $bytes($calc(240000 * (2 ^ (%lvl - 1))),db)
      set %rccost $bytes($calc(400000 * (2 ^ (%lvl - 1))),db)
      set %rdcost $bytes($calc(160000 * (2 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Intergalactic Research Network will cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to research
      halt
    }

    ; ### ######################## ###
    ; ### 3.15 Graviton Technology ###
    ; ### ######################## ###

    if ($regex($1,/^[@!.]gravi(ton)?(tech)?(nology)?$/si) == 1) {
      if ($2 == 0) badlevel
      if (!$2) nolevelgravi
      if (- isin $2) {
        set %total $len($2)
        set %middle $pos($2,-,1)
        set %first $left($2,$calc(%middle - 1))
        set %second $right($2,$calc(%total - %middle ))
        if ((%first < 0) || (%second > 50) || (%first > %second ) || (%first !isnum) || (%second !isnum)) format
        set %recost $bytes($round($calc((300000 * (1 - (3 ^ %second )) / (1 - 3)) - (300000 * (1 - (3 ^ %first )) / (1 - 3))) ,0),db)
        %noise To go from 10Graviton Technology level $+ 4 %first  $+ to level $+ 4 %second  $+ will require $+ 3 %recost  $+ energy
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 50) || ($2 !== $int($2))) badlevel
      set %lvl $2
      set %recost $bytes($calc(300000 * (3 ^ (%lvl - 1))),db)
      %noise Level $+ 4 $2  $+ 10Graviton Technology will require $+ 3 %recost  $+ energy to research
      halt
    }

    ; ### ######### ###
    ; ### 4.0 Ships ###
    ; ### ######### ###

    if ($regex($1,/^[@!.]ship(s)?$/si) == 1) %noise The 11ship commands are as follows: 4!sc !lc  !lf  !hf  !cr  !bs  !cs  !rec  !probe  !bomb  !sat  !dessie  !ds / !rip  !bc   --- If you type just the command with no numbers following it you can see general information and the format for the specific command

    ; ### ############### ###
    ; ### 4.1 Small Cargo ###
    ; ### ############### ###

    if ($regex($1,/^[@!.]s(mall)?c(argo)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumbersc
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(2000 * %number ),db)
      set %rccost $bytes($calc(2000 * %number ),db)
      %noise 4 $2  $+ 10Small Cargo(s) cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to build and can hold a total of $+ 13 $bytes($calc(5000 * %number ),db)  $+ resources
      halt
    }

    ; ### ############### ###
    ; ### 4.2 Large Cargo ###
    ; ### ############### ###

    if ($regex($1,/^[@!.]l(arge)?c(argo)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumberlc
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(6000 * %number ),db)
      set %rccost $bytes($calc(6000 * %number ),db)
      %noise 4 $2  $+ 10Large Cargo(s) cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to build and can hold a total of $+ 13 $bytes($calc(25000 * %number ),db)  $+ resources
      halt
    }

    ; ### ################# ###
    ; ### 4.3 Light Fighter ###
    ; ### ################# ###

    if ($regex($1,/^[@!.]l(ight)?f(ighter)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumberlf
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(3000 * %number ),db)
      set %rccost $bytes($calc(1000 * %number ),db)
      %noise 4 $2  $+ 10Light Fighter(s) cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to build
      halt
    }

    ; ### ################# ###
    ; ### 4.4 Heavy Fighter ###
    ; ### ################# ###

    if ($regex($1,/^[@!.]h(eavy)?f(ighter)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumberhf
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(6000 * %number ),db)
      set %rccost $bytes($calc(4000 * %number ),db)
      %noise 4 $2  $+ 10Heavy Fighter(s) cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to build
      halt
    }

    ; ### ########### ###
    ; ### 4.5 Cruiser ###
    ; ### ########### ###

    if ($regex($1,/^[@!.]cr(uiser)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumbercr
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(20000 * %number ),db)
      set %rccost $bytes($calc(7000 * %number ),db)
      set %rdcost $bytes($calc(2000 * %number ),db)
      %noise 4 $2  $+ 10Cruiser(s) cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build
      halt
    }

    ; ### ############## ###
    ; ### 4.6 Battleship ###
    ; ### ############## ###

    if ($regex($1,/^[@!.]b(attle)?s(hip)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumberbs
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(45000 * %number ),db)
      set %rccost $bytes($calc(15000 * %number ),db)
      %noise 4 $2  $+ 10Battleship(s) cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to build
      halt
    }

    ; ### ############### ###
    ; ### 4.7 Colony Ship ###
    ; ### ############### ###

    if ($regex($1,/^[@!.]c(olony)?s(hip)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumbercs
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(10000 * %number ),db)
      set %rccost $bytes($calc(20000 * %number ),db)
      set %rdcost $bytes($calc(10000 * %number ),db)
      %noise 4 $2  $+ 10Colony Ship(s) cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build
      halt
    }

    ; ### ############ ###
    ; ### 4.8 Recycler ###
    ; ### ############ ###

    if ($regex($1,/^[@!.]rec(ycler)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumberrec
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(10000 * %number ),db)
      set %rccost $bytes($calc(6000 * %number ),db)
      set %rdcost $bytes($calc(2000 * %number ),db)
      %noise 4 $2  $+ 10Recycler(s) cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build and can harvest $+ 13 $bytes($calc(20000 * %number ),db)  $+ resources from a debris field
      halt
    }

    ; ### ################### ###
    ; ### 4.9 Espionage Probe ###
    ; ### ################### ###

    if ($regex($1,/^[@!.](esp)?(ionage)?probe$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumberprobe
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rccost $bytes($calc(1000 * %number ),db)
      %noise 4 $2  $+ 10Espionage Probe(s) cost ( $+ 7 0  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to build
      halt
    }

    ; ### ########### ###
    ; ### 4.10 Bomber ###
    ; ### ########### ###

    if ($regex($1,/^[@!.]bomb(er)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumberbomb
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(50000 * %number ),db)
      set %rccost $bytes($calc(25000 * %number ),db)
      set %rdcost $bytes($calc(15000 * %number ),db)
      %noise 4 $2  $+ 10Bomber(s) cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build
      halt
    }

    ; ### #################### ###
    ; ### 4.11 Solar Satellite ###
    ; ### #################### ###

    if ($regex($1,/^[@!.](solar)?sat(ellite)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumbersat
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      if ((!$3) || ($3 !isnum)) {
        n You must include the 10max temperature of the planet. The correct format is 4!sat <level> <max temp>
        halt
      }
      set %number $2
      set %maxtemp $3
      set %rccost $bytes($calc(2000 * %number ),db)
      set %rdcost $bytes($calc(500 * %number ),db)
      %noise 4 $2  $+ 10Solar Satellites(s) cost ( $+ 7 0  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build and will supply $+ 3 $bytes($round($calc(%number *((%maxtemp / 4) +20)), 0),db)  $+ energy
      halt
    }

    ; ### ############# ###
    ; ### 4.12 Destoyer ###
    ; ### ############# ###

    if (($regex($1,/^[@!.]dest(royer)?$/si) == 1) || ($regex($1,/^[@!.]dessie$/si) == 1)) {
      if ($2 == 0) badnumber
      if (!$2) nonumberdessie
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(60000 * %number ),db)
      set %rccost $bytes($calc(50000 * %number ),db)
      set %rdcost $bytes($calc(15000 * %number ),db)
      %noise 4 $2  $+ 10Destroyer(s) cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build
      halt
    }

    ; ### ############### ###
    ; ### 4.13 Death Star ###
    ; ### ############### ###

    if (($regex($1,/^[@!.]d(eath)?s(tar)?$/si) == 1) || ($regex($1,/^[@!.]rip$/si) == 1)) {
      if ($2 == 0) badnumber
      if (!$2) nonumberds
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(5000000 * %number ),db)
      set %rccost $bytes($calc(4000000 * %number ),db)
      set %rdcost $bytes($calc(1000000 * %number ),db)
      %noise 4 $2  $+ 10Death Star(s) cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build
      halt
    }

    ; ### ################## ###
    ; ### 4.14 Battlecruiser ###
    ; ### ################## ###

    if ($regex($1,/^[@!.]b(attle)?c(ruiser)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumberbc
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(30000 * %number ),db)
      set %rccost $bytes($calc(40000 * %number ),db)
      set %rdcost $bytes($calc(15000 * %number ),db)
      %noise 4 $2  $+ 10Battlecruiser(s) cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build
      halt
    }

    ; ### ############ ###
    ; ### 5.0 Defenses ###
    ; ### ############ ###

    if ($regex($1,/^[@!.]defense(s)?$/si) == 1) %noise The 11defense commands are as follows: 4!rl !ll  !hl  !gauss  !ic  !pt  !ssd  !lsd  !abm  !ipm   --- If you type just the command with no numbers following it you can see general information and the format for the specific command

    ; ### ################### ###
    ; ### 5.1 Rocket Launcher ###
    ; ### ################### ###

    if ($regex($1,/^[@!.]r(ocket)?l(auncher)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumberrl
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(2000 * %number ),db)
      %noise 4 $2  $+ 10Rocket Launcher(s) cost ( $+ 7 %rmcost  $+ / $+ 12 0  $+ / $+ 6 0  $+ ) resources to build
      halt
    }

    ; ### ############### ###
    ; ### 5.2 Light Laser ###
    ; ### ############### ###

    if ($regex($1,/^[@!.]l(ight)?l(aser)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumberll
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(1500 * %number ),db)
      set %rccost $bytes($calc(500 * %number ),db)
      %noise 4 $2  $+ 10Light Laser(s) cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to build
      halt
    }

    ; ### ############### ###
    ; ### 5.3 Heavy Laser ###
    ; ### ############### ###

    if ($regex($1,/^[@!.]h(eavy)?l(aser)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumberhl
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(6000 * %number ),db)
      set %rccost $bytes($calc(2000 * %number ),db)
      %noise 4 $2  $+ 10Heavy Laser(s) cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to build
      halt
    }

    ; ### ################ ###
    ; ### 5.4 Gauss Cannon ###
    ; ### ################ ###

    if ($regex($1,/^[@!.]gauss(cannon)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumbergauss
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(20000 * %number ),db)
      set %rccost $bytes($calc(15000 * %number ),db)
      set %rdcost $bytes($calc(2000 * %number ),db)
      %noise 4 $2  $+ 10Gauss Cannon(s) cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build
      halt
    }

    ; ### ############## ###
    ; ### 5.5 Ion Cannon ###
    ; ### ############## ###

    if ($regex($1,/^[@!.]i(on)?c(annon)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumberic
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(2000 * %number ),db)
      set %rccost $bytes($calc(6000 * %number ),db)
      %noise 4 $2  $+ 10Ion Cannon(s) cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 0  $+ ) resources to build
      halt
    }

    ; ### ################# ###
    ; ### 5.6 Plasma Turret ###
    ; ### ################# ###

    if ($regex($1,/^[@!.]p(lasma)?t(urret)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumberpt
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(50000 * %number ),db)
      set %rccost $bytes($calc(50000 * %number ),db)
      set %rdcost $bytes($calc(30000 * %number ),db)
      %noise 4 $2  $+ 10Plasma Turret(s) cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build
      halt
    }

    ; ### ##################### ###
    ; ### 5.7 Small Shield Dome ###
    ; ### ##################### ###

    if ($regex($1,/^[@!.]s(mall)?s(hield)?d(ome)?$/si) == 1) {
      if ($2 isnum) {
        %noise Only 41 10Small Shield Dome can be built per planet.  Please just use 4!ssd for more information
        halt
      }
      if (!$2) {
        %noise A 10Small Shield Dome is used to protect the other defensive structures.  Only one can be built per planet and costs ( $+ 7 10,000  $+ / $+ 12 10,000  $+ / $+ 6 0  $+ ) resources to build
        halt
      }
    }

    ; ### ##################### ###
    ; ### 5.8 Large Shield Dome ###
    ; ### ##################### ###

    if ($regex($1,/^[@!.]l(arge)?s(hield)?d(ome)?$/si) == 1) {
      if ($2 isnum) {
        %noise Only 41 10Large Shield Dome can be built per planet.  Please just use 4!lsd for more information
        halt
      }
      if (!$2) {
        %noise A 10Large Shield Dome is used to protect the other defensive structures.  Only one can be built per planet and costs ( $+ 7 50,000  $+ / $+ 12 50,000  $+ / $+ 6 0  $+ ) resources to build
        halt
      }
    }

    ; ### ########################## ###
    ; ### 5.9 Anti-Ballistic Missile ###
    ; ### ########################## ###

    if ($regex($1,/^[@!.]a(nti)?b(allistic)?m(issile)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumberabm
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(8000 * %number ),db)
      set %rdcost $bytes($calc(2000 * %number ),db)
      %noise 4 $2  $+ 2Anti-Ballistic Missile(s) cost ( $+ 7 %rmcost  $+ / $+ 12 0  $+ / $+ 6 %rdcost  $+ ) resources to build
      halt
    }

    ; ### ########################### ###
    ; ### 5.10 Interplanetary Missile ###
    ; ### ########################### ###

    if ($regex($1,/^[@!.]i(nter)?p(lanetary)?m(issile)?$/si) == 1) {
      if ($2 == 0) badnumber
      if (!$2) nonumberipm
      if (($2 !isnum) || ($2 < 1) || ($2 > 50000) || ($2 !== $int($2))) badnumber
      set %number $2
      set %rmcost $bytes($calc(12500 * %number ),db)
      set %rccost $bytes($calc(2500 * %number ),db)
      set %rdcost $bytes($calc(10000 * %number ),db)
      %noise 4 $2  $+ 4Interplanetary Missile(s) cost ( $+ 7 %rmcost  $+ / $+ 12 %rccost  $+ / $+ 6 %rdcost  $+ ) resources to build
      halt
    }

    ; ### #################### ###
    ; ### 6.1 Moon Destruction ###
    ; ### #################### ###

    if ($regex($1,/^[@!.]moondestroy$/si) == 1) {
      if ((!$2) || (!$3)) {
        %noise The only way to destroy a moon is to send one or more RIPs at a moon on a destruction mission.  Use 4!moondestroy <RIP number> <Moon size> to see the chance of either being destroyed. 
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 10000) || ($2 !== $int($2))) {
        %noise The number of RIPs must be between 1 and 10,000 
        halt
      }
      if (($3 !isnum) || ($3 < 1) || ($3 > 9000) || ($3 !== $int($3))) {
        %noise The Moon size must be between 1 and 9,000 km 
        halt
      }
      set %rip $2
      set %moon $3
      set %moondestroy $calc((100 - (%moon ^ .5)) * (%rip ^ .5))
      set %ripdestroy $calc((%moon ^ .5) / 2)
      %noise The chance that moon is destroyed is %moondestroy and the chance that the RIPs are destroyed is %ripdestroy
      halt
    }

    ; ### #################### ###
    ; ### 6.2 Moon Information ###
    ; ### #################### ###

    if ($regex($1,/^[@!.]moon$/si) == 1) {
      if (!$2) {
        %noise Whenever a battle occurs there is the chance for a moon to be created.  A 100k DF will yield a 1% moonchance, a 200k DF will yield a 2%, and so on up to a 20% chance.  Use !moon <moon size> to see the maximum number of fields for the given size.
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 9000) || ($2 !== $int($2))) {
        %noise The size of the moon must be between 1 and 9,000 km 
        halt
      }
      set %fields $floor($calc(($2 / 1000) ^ 2))
      %noise The maximum number of fields that can be used on the moon is %fields
      halt
    } 

    ; ### ########### ###
    ; ### 6.3 Harvest ###
    ; ### ########### ###

    if ($regex($1,/^[@!.]harvest$/si) == 1) {
      if ((!$2) || (!$3)) {
        %noise Recyclers are neccessary to harvest a debri field.  Use !harvest <metal in the DF> <crystal in the DF> to see how many recyclers are needed to harvest the DF.
        halt
      }
      if (($2 !isnum) || ($2 < 1) || ($2 > 9999999999) || ($2 !== $int($2))) {
        %noise Use a positive integer for the ammount of metal in the DF 
        halt
      }
      if (($3 !isnum) || ($3 < 1) || ($3 > 9999999999) || ($3 !== $int($3))) {
        %noise Use a positive integer for the ammount of crystal in the DF 
        halt
      }
      set %total $calc($2 + $3)
      set %cyclers $ceil($calc(%total / 20000))
      %noise A DF of ( $bytes($2 ,db) / $bytes($3 ,db) ) will require %cyclers recyclers.
      halt
    } 
  }
}