Skip to content

Commands

Overview

The commands issued in the scripting engine are similar to a commands you might enter into a command prompt or shell. Each line has a starting command, and a set of parameters. Some of those parameters are required, some are optional.

command (required) [optional]

All parameters are shown inside of parenthesis or brackets. Parameters within parenthesis are required while those in brackets are optional and will default to specific value if not provided.

If you want to pass several words as a single parameter you must wrap them using ' or ". For example 'hello goodbye' is one parameter, while hello goodbye is two.

For example, if your script is something like:

1
2
# Say 'Hello'
say Hello friends!

You will end up just saying Hello. Instead, you if you wrap the words in single (') or double quotes (") the engine will see it as a single parameter.

1
2
# Say 'Hello friends!'
say 'Hello friends!'

If you prefix a command with the @ this will silence any warning/output from the command. For example:

Example

1
2
3
4
5
// Generate warning if robe is out of reach
lifttype 'robe'

// Silence warning if robe is out of reach
@lifttype 'robe'

Without the @ symbol, if a robe isn't available, you would get an warning message telling you that it couldn't find a robe. But since the @ symbol was provided, no warning is displayed.

alliance

Syntax: alliance ('message to send')

Description: This command will force your character to say an alliance message passed as the parameter.

Example

1
alliance 'Allies assemble!'

attack

Syntax: attack (serial) or attack ('variablename')

Description: Attack a specific serial or variable tied to a serial.

Example

1
attack '0x21B4'
1
attack 'attackdummy'

cast

Syntax: cast ('name of spell')

Description: Cast a spell by name

Example

1
2
3
cast 'greater heal'
wft
target 'self'

clearall

Syntax: clearall

Description: Combines the following actions into one commmand: Cancel Current Target, Clear Target Queue, Drop What You Are Currently Holding and Clear Drag/Drop Queue into a single command.

Example

1
2
3
if insysmsg 'cannot find'
    clearall
endif

cleardragdrop

Syntax: cleardragdrop

Description: Clears Razor's the drag/drop queue

Example

1
2
3
if insysmsg 'cannot reach'
    cleardragdrop
endif

clearhands

Syntax: clearhands ('left'/'right'/'both')

Description: Undress your hands based on the param.

Example

1
clearhands 'both'
1
clearhands 'left'

clearsysmsg

Syntax: clearsysmsg

Description: Clears the internal system message queue

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
sysmsg 'hello'
sysmsg 'bye'

if insysmsg 'hello'
    say 'hello!'
endif

clearsysmsg

if insysmsg 'bye'
    say 'this condition wont be met since it was cleared on line 8'
endif

dclick

Syntax: dclick (serial) or dclick ('left'/'right'/'hands')

Description: This command will use (double-click) a specific item or mobile or use the item in one of your hands using left, right or hands to use an item in either hand.

Example

1
dclick '0x34AB'
1
dclick 'myvariable'
1
dclick 'hands'
1
dclick 'right'

dclicktype

Syntax: dclicktype ('name of item') OR (graphicID) [true/backpack]

Description: This command will use (double-click) an item type either provided by the name or the graphic ID.

Range Check

If you include the optional true parameter, items within range (2 tiles) will only be considered. If you include the optional backpack parameter, items in your backpack only be considered.

Getting the graphic name or ID

To get the name or the ID of item, use the >info command in Razor and click on the item. You can use either the Item Name or Id.

item-command

Example

1
2
3
dclicktype 'dagger'
waitfortarget
targettype 'robe'
1
2
3
dclicktype 'dagger' true
waitfortarget
targettype 'robe' true
1
2
3
dclicktype 'dagger' backpack
waitfortarget
targettype 'robe' backpack

dress

Syntax: dress ('name of dress list')

Description: This command will execute a spec dress list you have defined in Razor.

Example

1
dress 'My Sunday Best'

drop

Syntax: drop (serial) (x) (y) [z] or drop (serial) (layer) or drop 'ground' (x) (y) [z]

Description: This command will drop the item you are holding either at your feet, on a specific layer , at a specific X/Y/Z location on the ground or within the defined serial.

Tip

The functionality of drop 'ground' (x) (y) [z] is also available in with droprelloc.

Tip

A list of available layers for reference that can be used with this command.

Example

1
2
lift '0x400D54A7'
drop 'self' InnerTorso
1
2
lift '0x400D54A7'
drop 'ground' 5926 1148 0

droprelloc

Syntax: droprelloc (x) (y)

Description: This command will drop the item you're holding to a location relative to your position.

Example:

Example

1
2
3
lift '0x400EED2A'
wait 1000
droprelloc 1 1

emote

Syntax: emote ('message to send') [hue]

Description: This command will force your character to emote the message passed as the parameter.

Tip

This command will append * around the emote so emote 'smiles' will be displayed in game as *smiles*.

Example

1
emote 'smiles'
1
emote 'smiles in another color' 454

guild

Syntax: guild ('message to send')

Description: This command will force your character to say a guild message passed as the parameter.

Example

1
guild 'Hello fellow guildmates!'

gumpresponse

Syntax: gumpresponse (buttonID)

Description: Responds to a specific gump button

Example

1
gumpresponse 4

gumpclose

Syntax: gumpclose

Description: This command will close the last gump that opened.

Example

1
gumpclose

hotkey

Syntax: hotkey ('name of hotkey')

Description: This command will execute any Razor hotkey by name.

Example

1
2
3
skill 'detect hidden'
waitfortarget
hotkey 'target self'

interrupt

Syntax: interrupt

Description: This command will interrupt a casting action.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
cast 'energy bolt'
if hp < 10
    interrupt
    cast 'greater healing'
    wft
    target 'self'
end if

wft
target 'last'    

lasttarget

Syntax: lasttarget

Description: This command will target your last target set in Razor.

Example

1
2
3
cast 'magic arrow'
waitfortarget
lasttarget

lift

Syntax: lift (serial) [amount]

Description: This command will lift a specific item and amount. If no amount is provided, 1 is defaulted.

Example

1
2
3
lift '0x400EED2A'
wait 1000
droprelloc 1 1 0

lifttype

Syntax: lifttype (gfx) [amount] or lifttype ('name of item') [amount]

Description: This command will lift a specific item by type either by the graphic id or by the name. If no amount is provided, 1 is defaulted.

Example

1
2
3
lifttype 'robe'
wait 1000
droprelloc 1 1
1
2
3
lifttype '0x1FCD'
wait 1000
droprelloc 1 1

Syntax: menu (serial) (index) [false]

Description: Selects a specific index within a context menu. Razor will block the menu from appearing by default. If you include the optional false parameter, the context menu won't be blocked by Razor.

Context Menu

This command applies to the context menu accessed on some servers via a single-click (such as on yourself, to open your paperdoll or backpack).

context-menu

Example

1
menu 0 0
1
menu 0 1

Syntax: menuresponse (index) (menuId) [hue]

Description: Responds to a specific menu and menu ID

Warning

This command does not work on context menus, they are for a less used menu type. See the menu command to use context/popup menus.

Example

1
menuresponse 3 4

organizer

Syntax: organizer (number) ['set']

Description: This command will execute a specific organizer agent. If the set parameter is included, you will instead be prompted to set the organizer agent's hotbag.

Example

1
organizer 1
1
organizer 4 'set'

overhead

Syntax: overhead ('text') [color] [serial]

Description: This command will display a message over your head. Only you can see this.

Example

1
2
3
if stam = 100
    overhead 'ready to go!'
endif

potion

Syntax: potion ('potion type')

Types: heal, cure, refresh, nightsight, ns, explosion, strength, str, agility

Description: This command will use a specific potion based on the type.

Example

1
potion 'agility'
1
potion 'heal'

promptresponse

Syntax: promptresponse ('prompt response')

Description: This command will respond to a prompt triggered from actions such as renaming runes or giving a guild title.

Example

1
2
3
dclicktype 'rune'
waitforprompt
promptresponse 'to home'

random

Syntax: random (max number)

Description: This command will generate a random number between 1 and the max number.

Example

1
2
3
4
5
6
7
8
9
clearsysmsg

random 10

if insysmsg 'Random: 5'
    say 'Hello!'
else
    say 'Hail!'
endif

restock

Syntax: restock (number) ['set']

Description: This command will execute a specific restock agent. If the set parameter is included, you will instead be prompted to set the restock agent's hotbag.

Example

1
2
3
if count garlic < 4
    restock 1
endif
1
restock 4 'set'

say

Syntax: say ('message to send') [hue] or msg ('message to send') [hue]

Description: This command will force your character to say the message passed as the parameter.

Example

1
say 'Hello world!'
1
say 'Hello world!' 454

script

Syntax: script 'name' or script 'category\name'

Description: This command will call another script.

Tip

You can call scripts in categories using cat1\cat2\scriptname format.

Example

1
2
3
if hp = 40
    script 'healcure'
endif
1
2
3
if mana = 40
    script 'magery\meditation'
endif

scavenger

Syntax: scavenger ['clear'/'add'/'on'/'off'/'set']

Description: This command will control the scavenger agent.

  • clear: Clear scavenger agent cache
  • add: Select an item to add to the list
  • on: Turn on the scavenger agent
  • off: Turn off the scavenger agent
  • set: Set the scavenger agent's hotbag

Example

1
scavenger 'off'

sell

Syntax: sell

Description: This command will set the Sell agent's hotbag.

Example

1
sell

setability

Syntax: setability ('primary'/'secondary'/'stun'/'disarm') ['on'/'off']

Description: This will set a specific ability on or off. If on or off is missing, on is defaulted.

Example

1
setability 'stun'
1
setability 'stun' off

setlasttarget

Syntax: setlasttarget

Description: This command will pause the script until you select a target to be set as Last Target.

Example

1
2
3
4
5
6
overhead 'set last target'
setlasttarget
overhead 'set!'
cast 'magic arrow'
waitfortarget
target 'last'

setvar

Syntax: setvar ('variable') [timeout or setvariable ('variable') [timeout]

Description: This command will pause the script until you select a target to be assigned a variable. Please note, the variable must exist before you can assign values to it. Default timeout is 30 seconds that can be changed by passing in a new timeout value in milliseconds.

Example

1
2
3
4
5
setvar 'dummy'

cast 'magic arrow'
waitfortarget
target 'dummy'

skill

Syntax: skill 'name of skill' or skill last

Description: This command will use a specific skill (assuming it's a usable skill).

Supported skill names

anatomy, animallore, itemidentification, itemid, armslore, begging, peacemaking, peace, cartography, detectinghidden, discord, discordance, evaluatingintelligence, evalint, forensicevaluation, forensiceval, hiding, provocation, provo, inscription, poisoning, spiritspeak, stealing, taming, tasteidentification, tasteid, tracking, meditation, stealth, removetrap, imbuing

Example

1
2
3
4
5
while mana < maxmana
    say 'mediation!'
    skill 'meditation'
    wait 11000
endwhile

sysmsg

Syntax: sysmsg ('message to display in system message')

Description: This command will display a message in the lower-left of the client.

Example

1
2
3
if stam = 100
    sysmsg 'ready to go!'
endif

target

Syntax: target (closest/random/next/prev) [type1,type2] [humanoid/monster] or target (closest/random/next/prev) [type1!type2] [humanoid/monster] or target (serial) or target (clear/cancel)

Description: This command will target a specific mobile based either the type searched for or the serial. If you provide a list of target types, you can use , for a general list and ! for a priority list.

Type Notoriety Name Notoriety Color
nonfriendly Attackable, Criminal, Enemy, Murderer Gray (but not criminal), Gray, Orange, Red
friendly Innocent, Guild/Ally Blue, Green
enemy Enemy Orange
red/murderer Murderer Red
gray/grey Attackable, Criminal Gray (but not criminal), Gray
criminal Criminal Gray
blue/innocent Innocent Blue
friend Based on your friends list Any
List Type Delimiter Description
General , When the script tries to acquire a target, it will look for all the target types passed in the list. See Examples.
Priority ! When the script tries to acquire a target, it will prioritize each type. See Examples.

Example

1
2
3
cast 'lightning'
waitfortarget
target '0xBB3'
1
2
3
4
5
6
cast 'lightning'
waitfortarget

// General list using a ,
// If a red mobile is closer than a gray mobile, this will target the red mobile
target closest gray,red
1
2
3
4
5
6
cast 'lightning'
waitfortarget

// Priority list using a !
// If a red mobile is closer than a gray mobile, this will target the gray mobile
target closest gray!red
1
2
3
cast 'lightning'
waitfortarget
target closest 'red'
1
2
3
cast 'lightning'
waitfortarget
target closest 'gray,red' monster
1
2
3
cast 'lightning'
waitfortarget
target random
1
2
3
cast 'lightning'
waitfortarget
target random 'red' monster
1
target next humanoid
1
target cancel
1
target clear

targetrelloc

Syntax: targetrelloc (x-offset) (y-offset)

Description: This command will target a specific location on the map relative to your position.

Example

1
2
3
cast 'fire field'
waitfortarget
targetrelloc 1 1

targetloc

Syntax: targetloc (x) (y) (z)

Description: This command will target a specific location on the map.

Example

=== "Specific location"

1
2
3
4
5
```vim
cast 'fire field'
waitfortarget
targetloc 5923 1145 0
```

targettype

Syntax: targettype (graphic) or targettype ('name of item or mobile type') true or targettype ('name of item or mobile type') backpack

Description: This command will target a specific type of mobile or item based on the graphic id or based on the name of the item or mobile.

Range Check

If the optional parameter is passed in as true only items within the range of 2 tiles will be considered. If the optional parameter is passed in as backpack only items in your backpack will be considered.

Getting the graphic name or ID

To get the name or the ID of item, use the >info command in Razor and click on the item. You can use either the Item Name or Id.

item-command

Example

1
2
3
dclicktype 'dagger'
waitfortarget
targettype 'robe'
1
2
3
dclick '0x4005ECAF'
waitfortarget
targettype '0x1F03'
1
2
3
dclick '0x4005ECAF'
waitfortarget
targettype '0x1F03' true
1
2
3
dclick 'dagger'
waitfortarget
targettype 'robe' true
1
2
3
dclicktype 'dagger' backpack
waitfortarget
targettype 'robe' backpack

undress

Syntax: undress ['name of dress list']' or undress 'LayerName'

Description: This command will either undress you completely if no dress list is provided. If you provide a dress list, only those specific items will be undressed. Lastly, you can define a layer name to undress.

Tip

Available layers for reference

Example

1
undress
1
undress 'My Sunday Best'
1
2
undress 'Shirt'
undrsss 'Pants'

useonce

Syntax: useonce ['add'/'addcontainer']

Description: This command will execute the UseOnce agent. If the add parameter is included, you can add items to your UseOnce list. If the addcontainer parameter is included, you can add all items in a container to your UseOnce list.

Example

1
useonce
1
useonce 'add'
1
useonce 'addcontainer'

virtue

Syntax: virtue ('honor'/'sacrifice'/'valor')

Description: This command will invoke Honor, Sacrifice or Valor.

Example

1
virtue 'honor'
1
virtue 'sacrifice'
1
virtue 'valor'

walk

Syntax: walk ('direction')

Description: This command will turn and/or walk your player in a certain direction.

Example

1
2
3
4
5
6
7
8
walk 'North'
walk 'Up'
walk 'West'
walk 'Left'
walk 'South'
walk 'Down'
walk 'East'
walk 'Right'

wait & pause

Syntax: wait [time in milliseconds or pause [time in milliseconds]

Description: This command will pause the execution of a script for a given time.

Tip

1000 milliseconds is equal to 1 second.

1000 x number of seconds = total milliseconds

Example

1
2
3
while stam < 100    
    wait 5000
endwhile

waitforgump

Syntax: waitforgump [gump id/'any'] [timeout]

Description: This command will wait for a gump. If no gump id is provided, it will wait for any gump. Default timeout is 30 seconds that can be changed by passing in a new timeout value in milliseconds.

Timeout parameter

To modify the default 30 second timeout for any gump, you must include include the any keyword before the timeout.

waitforgump 'any' 5000 will wait for 5 seconds

waitforgump 5000 will wait 30 seconds for a gump with the id of 5000

Example

1
waitforgump 'any' 
1
waitforgump 'any' 10000
1
waitforgump 4
1
waitforgump 34252 5000

waitformenu

Syntax: waitformenu [menu id/'any'] [timeout]

Description: This command will wait for a context menu. If no menu id is provided, it will wait for any menu. Default timeout is 30 seconds that can be changed by passing in a new timeout value in milliseconds.

Timeout parameter

To modify the default 30 second timeout for any menu, you must include include the any keyword before the timeout.

waitformenu 'any' 5000 will wait for 5 seconds

waitformenu 5000 will wait 30 seconds for a menu with the id of 5000

Warning

This command does not work on context menus, they are for an less used menu type. See the menu command to use context/popup menus.

Example

1
waitformenu
1
waitformenu 'any' 5000
1
waitformenu 4

waitforprompt

Syntax: waitforprompt [promptid/'any'] [timeout]

Description: This command will wait for a prompt before continuing. If no prompt id is provided, it will wait for any prompt. Default timeout is 30 seconds that can be changed by passing in a new timeout value in milliseconds.

Timeout parameter

To modify the default 30 second timeout for any gump, you must include include the any keyword before the timeout.

waitforprompt 'any' 5000 will wait for 5 seconds

waitforprompt 5000 will wait 30 seconds for a prompt with the id of 5000

Example

1
2
3
dclicktype 'rune'
waitforprompt
promptresponse 'to home'
1
2
3
dclicktype 'rune'
waitforprompt 'any' 5000
promptresponse 'to home'

waitforsysmsg

Syntax: waitforsysmsg 'message to wait for' [timeout] or wfsysmsg 'message to wait for' [timeout]

Description: This command will wait a specific message to be added to the system message queue before continuing. Default timeout is 30 seconds that can be changed by passing in a new timeout value in milliseconds.

Example

1
2
waitforsysmsg 'ready to go'
overhead 'Ready!'
1
2
waitforsysmsg 'ready to go' 5000
overhead 'Done waiting'

waitfortarget

Syntax: waitfortarget [pause in milliseconds] or wft [pause in milliseconds]

Description: This command will cause the script to pause until you have a target cursor. By default it will wait 30 seconds but you can define a specific wait time if you prefer.

Example

1
2
3
cast 'energy bolt'
waitfortarget
hotkey 'Target Closest Enemy'
1
2
3
cast 'energy bolt'
wft
target 'last'

whisper

Syntax: whisper ('message to send') [hue]

Description: This command will force your character to whisper the message passed as the parameter.

Example

1
whisper 'Hello world!'
1
whisper 'Hello world!' 454

yell

Syntax: yell ('message to send') [hue]

Description: This command will force your character to yell the message passed as the parameter.

Example

1
yell 'Hello world!'
1
yell 'Hello world!' 454

Last update: 2021-08-25
Back to top