[i=s] 本帖最后由 Zt. 于 2025-4-6 20:31 编辑 [/i]
<<<脚本循环>>>
------重要点:脚本循环只在while-endwhile 内执行
------如有@跳转则在@跳转后执行,完后返回继续执行循环,继续跳转.循环多少次跳转多少次
[@run]
#if
#act
mov n0 1
while n0 < 3
sendmsg 1 aaaa:<$str(n0)>
goto @继续判断
inc n0 1
endwhile
[@继续判断]
#if
#act
mov n0 1
while n0 < 10
sendmsg 1 bbbb:<$str(n0)>
inc n0 1
endwhile
<<<遍历背包>>>
------重要点:可以调取背包唯一ID,物品名字,物品颜色,物品标记,当前物品是否是极品.
------遍历背包获取是一条一条获取增加的.通过一条一条的增加来获取到的数量.
下面为获取背包物品名字/后得出物品总数
[@run]
#if
#act
mov n1
loopbagitems @跳转 s物品唯一ID s物品名字
sendmsg 7 物品数量:<$str(n1)>
[@跳转]
#if
equal s$物品名字 木剑
#act
inc n1 1
<<脚本耗时>>
-----重要点:必须管理权限为10.
[@run]
#if
#act
printusetime 1
mov n0 1
while n0 < 10000
goto @测
inc n0 1
endwhile
printusetime 2
[@测]
#if
#act
inc n$你好 1