Difference between revisions of "FindCnt"

From Wiki
Jump to: navigation, search
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
−
__NOTOC__
+
{{header|FindItem|ro|The #findCnt system variable contains the number of objects that matches what was searched for with the [[findItem]] command.}}
−
== #findCnt ==
+
−
'''FindItem System Variables'''
+
−
=== Description ===
+
−
{{ro}}
+
  
−
The [[Var_findCnt|#findCnt]] system variable contains the number of objects that matches what was searched for with the [[findItem|findItem]] command.
+
== Example ==
−
 
+
<pre>....
−
==== Example ====
+
−
<pre>
+
−
....
+
 
loop:
 
loop:
 
finditem %housesign G_5
 
finditem %housesign G_5
Line 17: Line 10:
 
}
 
}
 
goto loop
 
goto loop
−
....
+
....</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>
 
</pre>
−
==== See Also ====
+
 
−
{|
+
=See Also=
−
| Width=200px | [[findItem|findItem]] || Width=200px | [[Var_findID|&#0035;findID]]|| Width=200px | [[Var_findType|&#0035;findType]] || Width=200px | [[Var_findX|&#0035;findX]] || Width=200px | [[Var_findY|&#0035;findY]] || Width=200px | [[Var_findZ|&#0035;findZ]] || Width=200px | [[Var_findDist|&#0035;findDist]] || Width=200px | [[Var_findKind|&#0035;findKind]] || Width=200px | [[Var_findStack|&#0035;findStack]] || Width=200px | [[Var_findBagID|&#0035;findBagID]] || Width=200px | [[Var_findMod|&#0035;findMod]] || Width=200px | [[Var_findRep|&#0035;findRep]] || Width=200px | [[Var_findCol|&#0035;findCol]] || Width=200px | [[Var findIndex|&#0035;findIndex]] 
+
{{FindItem}}
−
|}
+
−
----
+
−
{|
+
−
| Width=200px | [[Main_Page]] || Width=200px | [[Documentation]] || Width=200px | [[Documentation#FindItem|FindItem System Variables]]
+
−
|}
+

Latest revision as of 10:13, 7 September 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

FindItem

  • These system variables are set when the FindItem command is used.
#findID ⇒ Returns the id of the object returned by findItem
#findType ⇒ Returns the type of the object returned by findItem
#findX ⇒ Returns the x-coordinate of the object returned by findItem
#findY ⇒ Returns the y-coordinate of the object returned by findItem
#findZ ⇒ Returns the z-coordinate of the object returned by findItem
#findDist ⇒ Returns the distance from the character to the object returned by findItem
#findKind ⇒ Returns the kind of the object returned by findItem
#findStack ⇒ Returns the number of stacked items in the object returned by findItem
#findBagID ⇒ Returns the bag the object returned by findItem is contained in
#findMod ⇔ Returns displacement for #findX and #findY
#findRep ⇒ Returns the reputation of the object returned by findItem
#findCol ⇒ Returns the color of the object returned by findItem
#findIndex ⇔ Gets the values of all other findItem results without restarting the time-consuming FindItem command.
#findCnt ⇒ Returns the number of objects that matches what was searched for with the findItem command