I assume, based on your previous question, that you want the number of affected armor stands stored on the player. For that there is no need for CommandStats or /tp. You simply need to ensure the commands are activated in the correct order for a /fill clock (see here for a tutorial that covers activation order via /fill).
Otherwise, the set of commands is essentially the same as those in your previous question, albeit adding instead of setting to mimic CommandStats.
Prerequisites:
Objective to state how many armor stands were near the player.
/scoreboard objectives add ASNum dummy
Clock commands:
The following must be run in numerical order on a clock.
Reset the player's ASNum score to a default of 0.
/scoreboard players set @a ASNum 0
Cause armor stands around the player to increase their "ASNum" score by 1. This causes the player's score to be equal to the number of armor stands around them, rather than always 1, to mimic CommandStats.
/execute @e[type=ArmorStand] ~ ~ ~ scoreboard players add @a[r=10] ASNum 1
Players with an ASNum score of 0 would be those not within 10 blocks of an armor stand. Players with a score of 1 or higher will have that many armor stands around them.
/say @a[score_ASNum=0] had no armor stands near them.
/say @a[score_ASNum_min=1] has at least 1 armor stand near them.
/say @a[score_ASNum_min=10] has at least 10 armor stands near them.
Assuming you have the "sentry gun" shooting arrows, you would use the command:
/summon Arrow x y z {damage:1,Motion:[x.0,y.0,z.0]}
You would have to plug into the first set of coordinates where you want the arrows to be shooting from, and the direction the arrows are shooting in the second. TIP: The higher the number you set for your direction (second set of coordinates, the faster the arrow will travel! You can set anything for the damage (except dont get too crazy :P)
As for your "Tool Box" Idea, you can do the test for command on a redstone ticker:
testfor @e[x,y,z,r,type=Item] {Item:{id:minecraft:iron_block}}
(Unfortunately, you cant test for a custom named block/entity - at least to my knowledge) Run a comparator out of this command block, to another command block (does not NEED to be a command block). This will start a fast ticking redstone clock on another command block. This command block will have the command:
testfor @e[x,y+1,z,r,type=Item] {Item:{id:minecraft: ... }}
Make sure that the coordinates you plug into the last testfor command have y+1 the y coordinate of the testfor command before that. This means it will test for the item on top of your "tool box". Run a comparator out of that command block to start the /summon Arrow command, or in other words, start up your sentry!
(The arrows are seen only as little black dots in this photo, but thats because I have the speed ramped up :)
Basically, its a system of Testing positive for an iron block at x y z - starting ticker to test for ... entity at x y+1 z - testing positive for ... entity at x y+1 z - starting ticker to shoot "sentry gun"
Hope this helps
Best Answer
Fill needs two sets of coordinates, one for each corner of the box you want to fill. Try this: