Created
November 21, 2016 04:42
-
-
Save yaqinking/eb78d8b63d3ef227ee0c091baefcad53 to your computer and use it in GitHub Desktop.
KAG/TJS script example 计算传入 macro 的变量值时
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[iscript] | |
/** | |
* 计算传入 macro 的变量值时 | |
*/ | |
var result = 0; | |
var xpos = 0; | |
var xmov = 0; | |
[endscript] | |
@macro name=calc_move | |
@eval exp="xpos=+mp.xpos" | |
@eval exp="xmov=+mp.xmov" | |
@eval exp="result=xpos+xmov" | |
XPos [emb exp="xpos"][r] | |
XMov [emb exp="xmov"][r] | |
Result [emb exp="result"][p] | |
@endmacro | |
@calc_move xpos=100 xmov=-300 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment