It's amazing what people do around here "just for fun".
The main issue you're having is a misunderstanding of {i}. {i} refers to the number of iterations of a repeated *action*. It has no relationship to command-level looping.
Command looping was originally created for doing things like scrolling through lists. It doesn't keep track of the number of times that it's been allowed to loop. If you want, you can create your own variable and increment it. But sadly, that will require the much-maligned Python.
This is not really a job well-suited for the macro builder. It can be done much more easily and efficiently using Python. But if, for fun, you want to figure out ways to do this in the macro builder, we would do something like this:
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.0.3-->
<commandGroup open="True" name="crazy loops" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="288" name="initiate pings" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>LAN scanner</param>
<param>5000</param>
<param>-10</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.TriggerEvent</cmdType>
<params>
<param>crazyPing</param>
<param>{i}</param>
</params>
<cmdRepeat>255</cmdRepeat>
</action>
<phrase>initiate pings</phrase>
</command>
<command id="464" name="crazyPing" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="5" loopMax="255" description="This stops the looping at 100 -- so, it runs for IP addresses in the range 192.168.5.255 to .100">
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)<(B)</ifType>
<ifParams>{1}&&100</ifParams>
<then>
<action>
<cmdType>VC.StopMacro</cmdType>
<params />
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else />
</if>
<action>
<cmdType>Results.SetVar</cmdType>
<params>
<param>IPaddress</param>
<param>192.168.5.{1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Launch.Capture</cmdType>
<params>
<param>C:\Windows\System32\ping.exe</param>
<param>-a {Var.IPaddress} -n 1 -w 500</param>
<param>True</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.RegEx</cmdType>
<params>
<param>Lost.*?(\d+)</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)==(B)</ifType>
<ifParams>{Match.1.1}&&0</ifParams>
<then>
<action>
<cmdType>Results.RegEx</cmdType>
<params>
<param>Pinging\s(.*?)(.lan)*(\swith|\s\[)</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>PayloadXML.AddPair</cmdType>
<params>
<param>payloads\Network_IP_Table.xml</param>
<param>{Var.IPaddress}</param>
<param>{Match.1.1}</param>
<param>false</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.addText</cmdType>
<params>
<param>Device {Match.1.1} added with IP {Var.IPaddress}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else>
<action>
<cmdType>OSD.addText</cmdType>
<params>
<param>no device found on {Var.IPaddress}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</else>
</if>
<event>crazyPing</event>
</command>
</commandGroup>