This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
lua:flagcheck [2014/06/20 19:35] vodur created |
— (current) | ||
---|---|---|---|
Line 1: | Line 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> | ||
- | |||
- | <code | ||
- | |||
- | lua | ||
- | > | ||
- | |||
- | T:flagcheck( flag ) | ||
- | |||
- | </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> | ||