Skip to content

Expressions

Expressions Overview

When using the if or while conditions, you can access the following expressions to check against.

The following operators are supported:

Operator Description
= Equal
== Equal
!= Not equal
< Less than
<= Less than or equal
> Greater than
>= Greater than or equal

count/counter

  • count ('name of counted item')
  • counter ('name of counted item')

Description: Used to get the current number of a specific counted item in Razor

Note

You must have a counter setup in Display->Counters before using this expression. More info

Example

1
2
3
if count 'garlic' < 5
    say 'getting low on garlic'
endif

findbuff

  • findbuff 'name of buff/debuff

Description: Used to check if a specific buff/debuff is applied to you.

Example

1
2
3
4
5
if findbuff 'magic reflection'
    overhead 'Im set!'
else
    cast 'magic reflection'
endif

findtype

  • findtype ('name of item') [inrangecheck (true/false)/backpack] OR findtype (graphicID) [inrangecheck (true/false)/backpack]

Description: Used to check if a specific item name of graphic ID exists. Range check, if true, will check within 2 tiles.

Example

1
2
3
if findtype 'saw'
    say 'found saw'
endif
1
2
3
if findtype 'saw' true
    say 'found saw within 2 tiles'
endif
1
2
3
if findtype 'saw' backpack
    say 'found saw in my pack'
endif

hidden

  • hidden

Description: Used to check if you are hidden.

Example

1
2
3
if hidden
    overhead 'they cant see me'
endif

hp & maxhp

  • hp
  • maxhp
  • hits
  • maxhits

Description: Used to get your current or max hit points/health levels.

Example

1
2
3
4
while hp < 100
    say 'not at 100 yet'
    wait 5000
endwhile
1
2
3
if maxhp = 120
    say 'Full hp!'
endif

insysmsg

  • insysmsg ('message to look for')
  • insysmessage ('message to look for')

Description: Used to check if certain text appears within the system message log.

Example

1
2
3
if insysmsg 'too far away'
    overhead 'You are too far away'
endif

lhandempty

  • lhandempty

Description: Used to check if your left hand is empty

Example

1
2
3
if lhandempty
    hotkey 'empty right hand!'
endif

mana & maxmana

  • mana
  • maxmana

Description: Used to get your current or max mana levels.

Example

1
2
3
4
while mana < maxmana
    skill 'meditation'
    wait 11000
endwhile

mounted

  • mounted

Description: Used to check if you are currently on a mount

Example

1
2
3
4
5
if mounted
    say 'mounted'
else
    say 'not mounted'
endif

poisoned

  • poisoned

Description: Used to check if you are currently poisoned.

Example

1
2
3
if poisoned
    hotkey 'drink cure'
endif

position

  • position (x, y)
  • position (x, y, z)

Description: Used to check if your current position matches the provided.

Example

1
2
3
4
5
if position 2729 2133
overhead 'You are currently in front of the Bucs Den teleporter'
elseif position 2728 2133 5
overhead 'You are standing on the Bucs Den teleporter'
endif

queued

  • queued

Description: Used to check if your current queue is active (from restocking, organizing, etc)

Example

1
2
3
4
5
    if queued
        overhead 'Queue is active'
    else
        overhead 'No queue'
    endif
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
overhead 'Organizing'

organizer 1

while queued
    overhead 'Currently Organizing'
    wait 500 
endwhile

overhead 'Organized'
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
overhead 'Restocking'

restock 11
waitfortarget 
target 'self'

while queued
    overhead 'Currently restocking'
    wait 500 
endwhile

overhead 'Restocked'

rhandempty

  • rhandempty

Description: Used to check if your right hand is empty

Example

1
2
3
if rhandempty
    hotkey 'empty right hand!'
endif

skill

  • skill ('name')

Description: Used to get the current skill level for a given skill.

Example

1
2
3
4
5
if skill 'magery' < 62.5
    cast 'invisibility'
    waitfortarget
    target 'self'
endif

stam & maxstam

  • stam
  • maxstam

Description: Used to get your current stamina or max stamina.

Example

1
2
3
if stam < 30
say 'I need to rest'
endif
1
2
3
if maxstam = 120
say 'I feel so powerful!'
endif

str, dex & int

  • str
  • dex
  • int

Description: Used to get your current strength, dexterity and intelligence.

Example

1
2
3
if str = 100
    say 'I am a strong person'
endif

weight

  • weight

Description: Used to get your current weight.

Example

1
2
3
if weight = 300
    say 'I feel heavy'
endif

Last update: 2021-01-14