Skip to content

Condition & Loops

Conditions & Loops Overview

As found in the Razor macro system, you can use if, for and while when writing a script.

if

1
2
3
4
5
6
7
if (statement)

elseif (statement)

else

endif

Example

1
2
3
4
5
6
7
8
9
if stam = 100
    say 'Stamina full'
elseif stam < 20
    say 'Still a ways to go'
elseif stam < 60
    say 'Getting closer'
else
    say 'waiting'
endif
1
2
3
if not stam = 100
    say 'Stamina is not full'    
endif

for

1
2
3
for (value)

endfor

Example

1
2
3
4
for 10
    say 'hello'
    wait 1000
endfor

while

1
2
3
while statement

endwhile

Example

1
2
3
4
while hits < 100
    say 'I need a heal!'
    wait 1000
endwhile

Last update: December 13, 2022