12. Built-In variables
This section will tell you what each built-in variable reads.  For more information on built-in variables, read section 2E.
 
x The x position of the NPC. 
y The y position of the NPC. 
timeout The amount of time left until the NPC reaches 0, in seconds.
rupees The amount of rupees the NPC has.
bombs The amount of bombs the NPC has.
darts The amount of darts (a.k.a. arrows) the NPC has.
hearts The amount of hearts the NPC has.
glovepower The glove power of the NPC, ranges from 1 to 3.
swordpower The sword power of the NPC, ranges from -20 to 20.
shieldpower The shield power of the NPC, ranges from 0 to 3.
dir If the NPC is a showcharacter, this is the current direction it is facing.
sprite If the NPC is a showcharacter, this is the current sprite being shown.
ap The amount of AP the NPC has.
hurtdx The x location for the NPC to be hurt at when hit.
hurtdy The y location for the NPC to be hurt at when hit.
playerhurtpower The amount of life the player lost last time it received damage.
save[0],..,save[9] Temporary variables that are stored online for use by the NPC, which can be read by all clients on the level.  The values stored can be from 0 to 220.
screenwidth This variable is equal to the number of pixels wide the screen resolution is (read only).
screenheight This variable is equal to the number of pixels high the screen resolution is (read only).
npcscount The amount of NPCs currently on the level.
npcs[index].id The id number of the NPC.
npcs[index].x The x cordinate of the NPC.
npcs[index].y The y cordinate of the NPC.
npcs[index].width The width (in tiles) of the image used by the NPC.
npcs[index].height The height (in tiles) of the image used by the NPC.
npcs[index].timeout The time remaining on the NPC's timeout.
npcs[index].rupees The number of rupees the NPC has.
npcs[index].bombs The number of bombs the NPC has.
npcs[index].darts The number of darts (arrows) the NPC has.
npcs[index].hearts The number of hearts the NPC has.
npcs[index].glovepower The glove power of the NPC. 1=no glove 2=red 3=yellow
npcs[index].shieldpower The shield power of the NPC. 0=no shield 1=regular 2=mirror 3=lizard
npcs[index].swordpower The sword power of the NPC. From -20 to 20
npcs[index].dir The direction the NPC is facing. 0=up 1=left 2=down 3=right  (showcharacter NPCs only)
npcs[index].sprite The sprite currently set to the NPC.  (showcharacter NPCs only)
npcs[index].ap The ap of the NPC.  (showcharacter NPCs only)
npcs[index].hurtdx The x push-away difference when the player hurts the NPC (when hitplayer/hitnpc is used).
npcs[index].hurtdy The y push-away difference when the player hurts the NPC (when hitplayer/hitnpc is used).
npcs[index].save[0]...save[9] The values of the save variables of the NPC.
playerscount  The amount of players currently on the level.
players[index].x The x cordinate of the player.
players[index].y The y cordinate of the player.
players[index].rupees The amount of rupees the player has.
players[index].bombs The amount of bombs the player has.
players[index].darts The amount of darts (a.k.a. arrows) the player has.
players[index].mp The amount of MP the player has. From 0 to 100.
players[index].ap The amount of AP the player has. From 0 to 100.
players[index].hearts The current amount of life the player has.
players[index].fullhearts The max amount of life the player can have.
players[index].dir The direction the player is currently facing, where 0 = up, 1 = left, 2 = down, and 3 = right.
players[index].glovepower The strength of the player's glove.(2-glove1,3-glove2)
players[index].swordpower The strength of the player's sword. From -20 to 20.
players[index].shieldpower Strength of the player's shield. (1-normal sword,2-mirror shield,3-lizard shield)
players[index].headset This variable is equal to the number of the image the player is using as a head.
players[index].sprite The current sprite of the player.
players[index].id The id number of the player.  All showcharacter NPC's have an id of -1.
players[index].saysnumber The numerical value of the number said by the player.
compuscount The amount of baddies currently on the level.
compus[index].x The compu's x position.
compus[index].y The compu's y position.
compus[index].type The type of baddy that the compu is.  The baddy list shows the types in order from 0 to 9.
compus[index].dir The direction the baddy's body is facing.
compus[index].headdir The direction the baddy's the head is facing.
compus[index].power The power (a.k.a. life ) of the baddy.
compus[index].mode The current mode of the baddy.  Refer to the section on compu modes for the values.
bombscount The current number of bombs on the level.
bombs[index].x The bomb's x position.
bombs[index].y The bomb's y position.
bombs[index].power The power of the bomb. (1=bomb, 2=super bomb, 3=jolt bomb)
bombs[index].time Time until the bomb explodes. (Starts at 3, counts down to 0)
arrowscount The current number of arrows on the level.  This also includes balls (shot from octos or NPCs).
arrows[index].x The x position of the arrow.
arrows[index].y The y position of the arrow.
arrows[index].dx The x displacement of the arrow (the x distance the arrow travles every .05 seconds)
arrows[index].dy The y displacement of the arrow (the y distance the arrow travles every .05 seconds)
arrows[index].type The type of the arrow.  (-1=ball, 0=arrow, 1=fireball, 2=fireblast, 3=nuke)
arrows[index].from The value of who shot the arrow, either compu or player. (0=compu, 1=current player)
itemscount The current number of items on the level.
items[index].x The item's x position.
items[index].y The item's y position.
items[index].type The items type (0-24, use the item list to figure out what numbers for what type).
items[index].time The amount of time left until the item disapears.
exploscount The amount of explosions currently on the level.
explos[index].x The x position of the explosion.
explos[index].y The y position of the explosion.
explos[index].power The power of the explosion. (1=fire, 2=jolt).
explos[index].time The time left until the explosion is gone.
explos[index].dir The direction from which the explosion is produced.
horsescount The current number of horses on the level.
horses[index].x The x position of the horse.
horses[index].y The y position of the horse.
horses[index].dir The direction the horse is facing.
horses[index].bushes The number of bushes the horse has eaten.
horses[index].bombs The number of bombs the horse has eaten (after eating 1 bomb, this is 3, since the horse has 3 blasts left).
horses[index].bombpower The power of the bomb the horse ate (1=bomb, 2=superbomb, 3=jolt).
horses[index].type The type of of horse (0=riding, 1=boat).
signscount The current number of signs on the level.
signs[index].x The x position of the specified sign.
signs[index].y The y position of the specified sign.
board[index] The value of the board at the x,y location.  Such as: board[x+64*y]==1+1*16; Is true if the board at the NPC's x,y is equal to 1,1.
arraylen( arrayname ) The size of an array.
vecx(dir) Returns the x value to move based on (dir).
vecy(dir) Returns the y value to move based on (dir).
onmapx(levelname) Returns the x value of the specified level on the current map.
onmapy(levelname) Returns the y value of the specified level on the current map.
strtofloat( str )  Returns the numerical value of the string.  For example, if you have the string mystring (which you set on your own) and its value is 52.  Then strtofloat(#s(mystring)) would be equal to 52.  For more information on strings, read section 2F.
strlen(str) Returns the length of the string.
startswith(part,str) Checks to see if the value "str" begins with "part".
indexof(part,str) Returns the index of the location of "part" within "str".  -1 = isn't contained within the string, 0 = the string starts with it.
#e(startindex,length,str) Extracts a substring out of "str".  Begins after "startindex" for as long as "length".  When "length"=-1 it'll extract everything.
#T(str) Removes spaces at beginning and end of "str".
tokenize(str) Divides "str" into "tokens".  Tokens are determined by spaces within the string.  Everything within ""s is considered one token.
tokenscount Returns the number of tokens produced by tokenize.
#t(index) Returns a token.
tokenize2 delimeter,str Like tokenize, but you can specify other delimiters besides spaces and commas.
testbomb( x, y ) This variable is equal to the index of the bomb specified at ( x, y ).  Or, -1 if there is no bomb at  ( x, y ).
testitem( x, y ) This variable is equal to the index of the item specified at ( x, y ).  Or, -1 if there is no item at  ( x, y ).
testexplo( x, y ) This variable is equal to the index of the explosion specified at ( x, y ).  Or, -1 if there is no explosion at    ( x, y ).
testhorse( x, y ) This variable is equal to the index of the horse specified at ( x, y ).  Or, -1 if there is no horse at ( x, y ).
testnpc( x, y ) This variable is equal to the index of the NPC specified at ( x, y ).  Or, -1 if there is no NPC at ( x, y ).
testplayer( x, y ) This variable is equal to the index of the player specified at ( x, y ).  {If it is a showcharacter npc, then this will be -1}  Or, -2 if there is no player/character at ( x, y ).
testcompu( x, y ) This variable is equal to the index of the baddy specified at ( x, y ).  Or, -1 if there is no baddy at ( x, y ).
testsign( x, y) This variable is equal to the index of the sign specified at ( x, y).  Or, -1 if there is no sign at    ( x, y).