Use skill: Difference between revisions
imported>StDoodle mNo edit summary |
imported>StDoodle mNo edit summary |
||
Line 51: | Line 51: | ||
name={{#var:name}}| | name={{#var:name}}| | ||
aggregate={{#var:aggregate}}| | aggregate={{#var:aggregate}}| | ||
return_type= | return_type=buffer| | ||
return_also={{#var:return_also}}| | return_also={{#var:return_also}}| | ||
parameter1={{Param|skill|to_use}}| | parameter1={{Param|skill|to_use}}| | ||
Line 59: | Line 59: | ||
name={{#var:name}}| | name={{#var:name}}| | ||
aggregate={{#var:aggregate}}| | aggregate={{#var:aggregate}}| | ||
return_type= | return_type=buffer| | ||
return_also={{#var:return_also}}| | return_also={{#var:return_also}}| | ||
parameter1={{Param|int|casts}}| | parameter1={{Param|int|casts}}| | ||
Line 70: | Line 70: | ||
}} | }} | ||
{{RFI|The page of old listed the possibility of specifying casts for the consult version, but ashref does not; please clarify}} |
Revision as of 01:57, 9 March 2010
Normal Use
Function Syntax
boolean use_skill(int casts ,skill to_use )
boolean use_skill(int casts ,skill to_use ,string target )
- casts is the number of casts
- target is the recipient (optional, for use with buffs only)
Attempts to cast the skill to_use a number of times specified by casts. Defaults to casting on yourself, but you can specify a target for buffs.
Code Sample
This example will attempt to cast the specified skill as many times as it can with the MP the character has left.
effect chosen = $effect[ Empathy ];
use_skill( my_mp() / mp_cost( to_skill(chosen) ) , to_skill(chosen) );
CLI Equivalent
The CLI command "cast" functions similarly to the normal version of this function (with similar parameters).
In-combat Consulting
Function Syntax
buffer use_skill(skill to_use )
buffer use_skill(int casts ,skill to_use )
- casts is the (optional) number of casts
- to_use is the skill to use
Will loop the specified number of casts (default to 1 if omitted) using the specified skill to_use, never reconsulting the script until the loop is complete.
Attention KoLmafia Experts!
We need your help; some details of this function's operation are unknown or unclear.
The following specific question has been raised:
- The page of old listed the possibility of specifying casts for the consult version, but ashref does not; please clarify