随Outlands客户端分发的Razor助手是Razor社区版的一个分支。如果您需要Razor脚本编写的基础帮助,请点击链接查看Quick的文档:http://www.razorce.com/guide/
Outlands还通过以下功能扩展了该脚本引擎。
修改后的Commands和表达式(Modified Commands and Expressions)
几个按类型搜索的Commands和表达式已得到大幅扩展:
dclicktype
dclicktype ('name') OR ('graphic') [source] [hue] [quantity] [range]
findtype
findtype ('name') OR ('graphic') [source] [hue] [quantity] [range]
色调(hue)允许按色调限制。来源(source)可以是特定容器的序列号、'self'(自身)表示已装备物品,或'ground'(地面)。数量(quantity)是最小数量,范围(range)是距玩家的最大范围。
lifttype表达式进一步限制为仅对'backpack'(背包)、'self'(自身)或'ground'(地面)来源进行操作。
findtypelist
工作方式类似于findtype,但第一个参数是列表名称。如果列表存在,找到的序列号将被添加到列表中。
findtypelist ('listname') ('name of item') OR ('graphic') [src] [hue] [qty] [range]
targettype
targettype ('name') OR ('graphic') [source] [hue] [quantity] [range]
lifttype
lifttype ('name') OR ('graphic') [amount] [src] [hue]
overhead和sysmessage插值(overhead and sysmessage interpolation)
overhead和sysmessage(及其别名)现在都支持如下字符串插值:
setvar myvar 10
overhead "my var is: <nowiki></nowiki>"
循环和索引变量(Loops and index variable)
所有循环现在都有一个作用域内的运行索引变量,名为'index',从0开始。
新别名(New Aliases)
ground
现在可以使用 'ground' 别名。这在扩展的 targeting commands 中作为 "source" 参数非常有用。
新表达式(New Expressions)
find
现在可以通过 find 表达式基于序列号进行搜索:
if find (serial) [src] [hue] [qty] [range]
参数的工作方式与 findtype command 完全相同。
findlayer
现在可以搜索角色已装备的物品:
if findlayer self gloves as mygloves
overhead 'Wearing gloves!'
endif
有效的层位有:
righthand
lefthand
shoes
pants
shirt
head
gloves
ring
talisman
neck
hair
waist
innertorso
bracelet
face
facialhair
middletorso
earrings
arms
cloak
backpack
outertorso
outerlegs
innerlegs
onehandedsecondary
quiver
outerbody
targetexists
一个用于测试客户端当前是否显示目标光标的表达式:
if targetexists ['any'/'beneficial'/'harmful'/'neutral']
followers
一个用于计算当前追随者数量的表达式:
if followers < 5
overhead "Can still tame stuff!"
endif
hue
获取物品色相(hue)的表达式:
if hue someObject = 0x1809
overhead "Found hue of my item!"
endif
name
获取当前角色名称(name)的表达式:
if name = 'MyName'
overhead "It's me!"
endif
paralyzed
测试角色是否被麻痹(paralyzed)的表达式:
if paralyzed
overhead "Can't move!"
endif
invul
测试角色是否被祝福/无敌(blessed/invulnerable)(黄色生命条)的表达式:
if invul
overhead "I'm gonna live forever!"
endif
warmode
测试角色是否处于战斗模式(warmode)的表达式:
if warmode
overhead "Ready to attack!"
endif
noto
检查任何移动物(mobile)的恶名(notoriety)的表达式:
if noto some_Mobile = hostile
overhead "Safe to attack!"
endif
有效的恶名值有:
innocent (blue)
friend (green)
hostile (gray)
criminal (gray)
enemy (orange)
murderer (red)
invulnerable (yellow)
死亡(dead)
检查一个移动对象是否死亡的表达式:
if dead someMobile
overhead "He's dead, Jim!"
endif
最大负重(maxweight)
if maxweight > 400
overhead "I have a lot of strength"
endif
负重差(diffweight)
if diffweight > 20
overhead "I can lift 20 more stone"
endif
生命差(diffhits)
if diffhits > 40
overhead "I need a heal!"
endif
魔法差(diffmana)
if diffmana > 40
useskill Meditation
endif
耐力差(diffstam)
if diffstam > 30
overhead "Need stamina"
endif
计数类型(counttype)
返回容器中相同类型物品的数量。如果物品可堆叠,则返回堆叠中的物品数量。
if counttype (name or graphic) [src] [hue] [range]
界面存在(gumpexists)
if gumpexists (gumpId/'any')
如果该gump存在,则返回true。
ingump
if ingump (text) [gumpId/'any']
在给定的gump中查找文本。
varexist
检查给定的变量(如果传递了!则为别名)是否已声明
if varexist someVar
overhead "Select shelf"
setvar someVar
endif
bandaging
检查当前是否正在应用绷带,并返回剩余时间(秒)(适用于治疗和兽医)。
if bandaging > 5
overhead "More than 5 seconds till next bandage"
endif
更简单的版本
if not bandaging
hotkey "Bandage Self"
endif
cooldown
检查冷却是否激活,可以与持续时间进行比较。
if cooldown "mycooldown"
overhead "cooldown is active"
endif
if cooldown "mycooldown" > 2000
overhead "more than 2 seconds remaining on cooldown"
endif
新Commands(New Commands)
setvar
setvar命令已在Outlands上修改,以支持更广泛的用例。可选的第二个参数现在是变量的序列号。如果提供了该参数,则不会提示你选择目标光标。
setvar my_name 0x123
这可用于图形ID、色调、序列号、名称等。默认情况下,这会创建一个持久变量,即使在应用程序重启后也会保留。要使变量仅在当前程序运行期间存在,请附加'!'运算符。该变量不会出现在Razor变量列表中,但在Razor运行时仍将是全局的,并可从任何脚本使用。
setvar! my_name 0x123
unsetvar
此外,新增了一个用于取消设置变量的命令。它支持与setvar相同的修饰词缀(Modifiers):
unsetvar my_name
ignore
已添加忽略列表(Ignore List),以避免在使用各种搜索命令时找到对象:
ignore (serial or list)
这也支持与setvar相同的运算符来控制忽略列表(Ignore List)的作用域。
unignore
与ignore类似,unignore命令从忽略列表中移除一个序列号(或序列号列表):
unignore (serial or list)
这也支持与setvar相同的运算符来控制忽略列表(Ignore List)的作用域。
clearignore
清除忽略列表(Ignore List):
clearignore
这也支持与setvar相同的运算符来控制忽略列表(Ignore List)的范围。
warmode
已添加一个用于显式设置战斗模式(warmode)状态的命令:
warmode ('on' / 'off')
getlabel
已添加一个用于获取物品标签(label)的命令——即你单击物品时看到的文本。
getlabel (serial) (name)
这将获取由序列号(serial)标识的物品的标签(label),并创建一个你选择名称的新变量来保存该文本。
getlabel backpack my_label
overhead my_label
重命名(rename)
已添加一个用于重命名追随者的命令:
rename myFollower Bob
技能(skill)
一个使用技能的命令
skill discord
一个检查技能等级的方法
if skill anatomy >= 80
有效的主动技能列表:
anatomy
animallore // "animal lore"
itemidentification // "item identification" // itemid
armslore // "arms lore"
begging
peacemaking // peacemaking // peace
cartography // cartography
detectinghidden // detect hidden
discord // Discordance
evaluatingintelligence // "evaluate intelligence" // evalint
forensicevaluation // "forensic evaluation" // forensiceval
hiding
provocation // provocation // provo
inscription
poisoning
spiritspeak // "spirit speak" // spirit
stealing
taming // "animal taming"
tasteidentification // "taste id" // tasteid // taste
tracking
meditation
stealth
removetrap
resisting spells
设置技能(setskill)
已添加一个用于设置技能锁定状态的 Commands:
setskill Blacksmithing up
有效选项为 up、down 或 lock。
waitforgump
waitforgump [gumpId]
等待一个 gump 出现。如果提供了 gump ID,则等待该特定 gump;否则等待下一个 gump。
gumpresponse
gumpresponse (buttonId) [gumpId]
按下指定 gump(或最后一个打开的 gump)上的给定按钮
gumpclose
gumpclose [gumpId]
关闭指定的 gump,如果未指定 gumpId,则关闭最后一个打开的 gump。
cooldown
cooldown <'cooldown name'> [milliseconds]
触发指定名称的冷却。如果未传入毫秒数,则使用冷却的默认值。
新运算符(New Operators)
as
现在有一个 'as' 运算符,用于将表达式的结果捕获为别名。这对于 `findtype` 表达式特别有用,如下所示
if findtype dagger as mydagger
dclick mydagger
endif
in
此外还有一个 'in' 运算符,可用于检查一个字符串是否为另一个字符串的子串:
if this in thisthatandtheother
overhead yes
endif
当组合使用来分类物品时,这些运算符特别强大:
if findtype dagger as mydagger
getlabel mydagger daggerlabel
if blessed in daggerlabel
overhead "Found newbie dagger"
endif
endif
列表(Lists)
列表支持包括以下 Commands:
createlist
createlist ('list name')
创建一个新列表
clearlist
clearlist ('list name')
清除一个现有列表
removelist
removelist ('list name')
删除一个列表
pushlist
pushlist ('list name') ('element value') ['front'/'back'] //comment
将项目添加到列表的前面或后面
poplist
poplist ('list name') ('element value'/'front'/'back') //comment
从列表的前面或后面移除一个项目。
如果在表达式中使用,弹出的值可以通过 'as' 保存,如下所示:
if poplist testlist back as popped
overhead popped
endif
listexists
此外,还添加了以下与列表相关的表达式。这些表达式可以在 <code>if</code> 和 <code>while</code> 语句中使用。
listexists ('list name')
如果列表存在则为真
list
list (list name) (operator) (value)
将列表的长度与整数进行比较
inlist
inlist (list name) (element)
测试元素是否在列表中。
atlist
atlist ('list name') (index)
返回列表中指定索引处的项。索引从0开始。
示例:
if atlist mylist 2 as thirdentry
overhead thirdentry
else
overhead "index out of bounds or list item retrievend was no serial"
endif
迭代列表(Iterating lists)
最后,<code>for</code> 和 <code>foreach</code> 循环可用于迭代,如下所示:
for 10
say 'hello'
endfor
这将精确迭代10次。
foreach x in my_list
say x
endfor
这将迭代 my_list 中的元素,每次迭代将变量 'x' 赋值为下一个元素。
计时器(Timers)
计时器(Timers)表示在脚本其余部分执行时运行的后台计时器。所有单位均为毫秒。可以查询它们以检查自启动以来经过的时间,或将其重置为更早的计数。
已添加以下用于处理计时器的 Commands:
createtimer
createtimer (timer name)
创建一个新的计时器,从0开始。
removetimer
removetimer (timer name)
销毁一个现有的计时器。
settimer
settimer (timer name) (value)
将计时器设置为给定值。它将立即从给定值开始向上计数。
此外,还为计时器添加了两个表达式:
timer(timer)
timer ('timer name') (operator) (value)
将计时器的当前值(自启动以来经过的时间,以毫秒为单位)与给定值进行比较
timerexists(timerexists)
timerexists ('timer name')
检查计时器是否存在
示例:
// Create a new timer
if not timerexists 'sample'
createtimer 'sample'
endif
// Reset every 10 seconds
if timer 'sample' > 10000
settimer 'sample' 0
endif
冷却(Cooldowns)
冷却在客户端补丁1.0.0.14中引入
冷却可以使用Razor脚本Commands触发
// starts the cooldown named "mycooldown" with its default cooldown time
cooldown "mycooldown"
// starts the cooldown named "mycooldown" with a 30 second timer (note that milliseconds are used in Razor)
cooldown "mycooldown" 30000
在表达式中,cooldown command可用于检查冷却剩余时间
// checks if the cooldown is running
if cooldown "mycooldown"
// do something
endif
// checks if the cooldown has more than 5 seconds left
if cooldown "mycooldown" > 5000
// do something
endif
玩家对战(PvP)限制(PvP Restrictions)
当玩家积极参与结构化玩家对战(PvP)时——无论是作为玩家对战(PvP)事件的一部分,还是在阵营标记(Faction Flagged)状态下进行玩家对战(PvP)时——都会施加一个玩家对战(PvP)减益效果(PvP Debuff)。非自愿的玩家对战(pvp)(例如PK)不受影响。
激活时,以下自动化功能将在Razor脚本(Razor scripting)、宏和客户端中被禁用:
setvar on players
droprelloc
waitforsysmsg
settimer
removetimer
getlabel
rename
cooldown
wait/pause
Expressions:
bandaging
findbuff/finddebuff
mana
maxmana
diffmana
hits
maxhits
diffhits
stam
maxstam
diffstam
poisoned
paralyzed
hidden
str
dex
int
position
timer
followers
hue
blessed
notoriety
dead (on mobs other than the player)
maxweight
diffweight
gumpexists
ingump
cooldown
casting
'pvp'表达式:
新增了一个玩家对战(pvp)表达式,用于检查上述玩家对战(pvp)脚本限制是否当前处于激活状态。
if pvp
//those commands are disabled
endif
序列号处理:
在玩家对战(pvp)脚本限制生效期间,任何属于玩家的序列号在脚本和宏中将解析为0x0,即被禁用。
示例:玩家将另一个玩家的序列号存储在变量player中。当标记为玩家对战(pvp)时,如果他们对任何命令(例如attack player或setlasttarget player)解析此变量,该变量将产生0x0。
物品处理:
在玩家对战(pvp)脚本限制生效期间,所有使用查找处理(find, findtype, findtypelist, dclicktype, lifttype, counttype)的命令和表达式将仅查找玩家装备或背包中的物品。
队伍和公会消息:
这些消息现在将永远不会被Razor或客户端拾取。