Difference between revisions of "FindCnt"

From Wiki
Jump to: navigation, search
(Example)
Line 11: Line 11:
 
goto loop
 
goto loop
 
....</pre>
 
....</pre>
 +
 +
<pre>
 +
finditem * C_ , #BACKPACKID
 +
if #FINDCNT > 0
 +
{
 +
display ok There are #FINDCNT items in your backpack!
 +
}
 +
if #FINDCNT < 1
 +
{
 +
display ok No items were found in your backpack!
 +
}
 +
halt
 +
</pre>
  
 
{{footer}}
 
{{footer}}

Revision as of 14:56, 31 August 2007

The #findCnt system variable contains the number of objects that matches what was searched for with the findItem command.

Example

....
loop:
finditem %housesign G_5
if #findcnt < 1
{
gosub placement
}
goto loop
....
finditem * C_ , #BACKPACKID
if #FINDCNT > 0
{
 display ok There are #FINDCNT items in your backpack!
}
if #FINDCNT < 1
{
 display ok No items were found in your backpack!
}
halt

See also

Main Page Documentation