This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
lua:flagcheck [2014/06/20 19:36] vodur |
— (current) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | Syntax 1: | ||
| - | |||
| - | <code lua> | ||
| - | T:flagcheck() | ||
| - | </code> | ||
| - | |||
| - | Arguments: none | ||
| - | |||
| - | Return value: table. | ||
| - | |||
| - | Returns a table of currently set flags. | ||
| - | |||
| - | Example: | ||
| - | |||
| - | <code lua>for k,v in pairs(mob:act()) do | ||
| - | |||
| - | say("My "..v.." flag is set") | ||
| - | |||
| - | end | ||
| - | </code> | ||
| - | |||
| - | Syntax 2: | ||
| - | |||
| - | > T:flagcheck( flag ) | ||
| - | |||
| - | <code lua> | ||
| - | |||
| - | </code> | ||
| - | |||
| - | Arguments: | ||
| - | |||
| - | **flag **- string value of the flag to be checked | ||
| - | |||
| - | Return value: boolean | ||
| - | |||
| - | Returns true if the given flag is set, false if the flag is not set. | ||
| - | |||
| - | Error if **flag ** is not a valid flag for the method. | ||
| - | |||
| - | Example: | ||
| - | |||
| - | <code lua>if mob:act("safe") then | ||
| - | |||
| - | mob:say("I'm safe") else mob:say("I'm not safe") | ||
| - | |||
| - | end | ||
| - | </code> | ||