So one of the issues happening in the script is that finditem locates anything on the facet within the range you specify - without regard for the Z axis.
So version 1.2 of this script if finding plants on other floors of the house and trying to include those in the count.
The fix is not to rely solely on #FINDCNT for the quantity, but actually process the returned list from FINDITEM and test that it is within range for Z.
Here is an example on how to fix it - there would be several places in this script where such a solution model needs to be applied:
finditem %plant G_2
set %total_cnt 0
if #findcnt > 0
{
for #findindex 1 #findcnt
{
if #findz >= #charposz && #findz < #charposz + 20 ; each level of a house is 20 Z 'levels' - so you are testing anything from the current floor, but below the next higher floor
set %total_cnt %total_cnt + 1
}
}
;set %total_cnt #findcnt
Event property takes time to fill data into #PROPERTY
There is a "repeat...until weight in #PROPERTY sequence" which has ignored the the ID for the plant. The repeat block is not repeated when #PROPERTY is not finished filling it's value. This is skipping processing plants. #PROPERTY gets populated with a single '$' and then gets set to whatever the value is.
Sometimes you can get a #PROPERTY description that has it's name and "no significant properties". Here is one method to verify that the #PROPERTY variable is populated without a hardcoded wait by checking for a 2nd '$' character:
event property #findid
while ( ( str count #property $ ) < 2 )
wait 1
until weight in #property
Currently seeing plants in the count skipped. I have 702 plants, but anywhere from 495 - 566 get processed (gathering seeds). Have you experienced this before? My guess is lag issues where the script assumes success. Maybe an action takes place before the required cool down between actions, so the 2nd action actually fails, but the script doesn't have any catch on the failed action.
I believe this to be the culprit in
start_button. It will issue the event property and immediately check for the results of #PROPERTY in the
until statement. It needs something like the above example to guarantee #PROPERTY has a valid value:
set %currentplant #findid
ignoreitem #findid
event property #findid
while ( ( str count #property $ ) < 2 )
wait 1
until weight in #property
It ignores this plant, issues the event property and if #PROPERTY is not finished populating it's text, it repeats the loop and never processes this plant.
Gaderian