English
Chinese
  yTin Online Help  

  中文主页 | Home (english) | 快快下载 | 实战教程 | 命令帮助 | 实用工具 | 常问问题 | 讨论留言 | 友好泥潭 | 我的程序 | 全球镜像 |
math

format:            #math {variable} {expression}

Performs math functions and stored the result in a variable.   The math
follows a C-like precedence, as follows, with the top of the list having
the highest priority.

Operators                              Function
------------------------------------------------
!                                          logical not
*                                          integer multiply
/                                          integer divide
+                                          integer addition
-                                          integer subtraction
>                                          greater than (result is non-zero or zero)
>=                                       greater than or equal (result is non-zero or zero)
<                                          less than (result is non-zero or zero)
<=                                       less than or equal (result is non-zero or zero)
= or ==                                 equals (result is non-zero or zero)
!=                                       not equal (result is non-zero or zero)
& or &&                                 logical and (result is non-zero or zero)
| or ||                                 logical or (result is non-zero or zero)

True is any non-zero number, and False is zero.   In the expression, you may
use T and F as true and false.   Parentheses () have highest precedence,
so inside the parentheses is always evaluated first.

examples:
#math {heals} {$mana/40}
Assuming there is a variable $mana, divide its value by 40 and store the
result in $heals.
#action {^You receive %0 experience} {updatexp %0}
#alias updatexp {#math {xpneed} {$xpneed-%%0}
Let's say you have a variable which stores xp needed for your next
level.   The above will modify that variable after every kill, showing
the amount still needed.