Actions

RuneScript: Difference between revisions

From RuneWiki

No edit summary
No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
=== Terminology ===
<nowiki>*</nowiki>(this page records known info from https://github.com/RuneStar/leaks<nowiki/>)*
<code>op</code> = operable


<code>ap</code> = approachable
===Extra Resources===
https://osrs-docs.com/ pw: rsps
 
https://neptune-ps.gitlab.io/runescript/index.html
 
https://github.com/data-dependent/osrs-guides/blob/master/skilling.md
 
===Terminology===
<code>op</code> = operable interaction (occurs within 1 tile / line of walk)
 
<code>ap</code> = approachable interaction (occurs within approachable range of up to 10 tiles / line of sight)


<code>cam</code> = camera
<code>cam</code> = camera


<code>if</code> = interface
<code>if</code> = interface
<code>com</code> = interface component


<code>inv</code> = inventory
<code>inv</code> = inventory
Line 14: Line 25:
<code>obj</code> = "object", represents items
<code>obj</code> = "object", represents items


<code>p_</code> = protected
<code>p_</code> = protected (not able to access full set of variables)


<code>stat</code> = skill
<code>stat</code> = skill


<code>oc</code> = related to obj
<code>oc</code> = related to obj config
 
<code>op____[1-5]</code> = option 1 through 5 used on target
 
<code>op____u</code> = item used on target
 
<code>op____t</code> = spell used on target
 
<code>opobj</code> = interacted item on ground
 
<code>opheld</code> = interacted with item in inventory


===Constants===
===Constants===
Line 26: Line 47:
^max_32bit_int = 0x7FFFFFFF
^max_32bit_int = 0x7FFFFFFF
</syntaxhighlight>
</syntaxhighlight>
===Function Signatures===
Functions can be registered 3 ways.
<code>[proc,name](params)(return)</code> known as a procedure or subroutine. Called via <code>gosub(name)</code> or by prefixing with <code>~</code>.
<code>[label,name](params)</code> similar to GOTO/LABEL syntax. Called via <code>jump(name)</code> or by prefixing with <code>@</code>.
<code>[trigger,on]</code> contextual function handler registered for a specific action occurring in the engine.
====Triggers====
<code>opnpc[1-5]</code> / <code>opnpcu</code> / <code>opnpct</code>
<code>apnpc1[1-5]</code>
<code>opplayer[1-5]</code> / <code>opplayeru</code> / <code>opplayert</code>
<code>applayer[1-5]</code>
<code>oploc[1-5]</code> / <code>oplocu</code> / <code>oploct</code>
<code>aploc[1-5]</code>
<code>opobj[1-5]</code> / <code>opobju</code> / <code>opobjt</code>
<code>opheld[1-5]</code> / <code>opheldu</code> / <code>opheldt</code>
<code>if_button[1-10]</code>
<code>ai_queue[1-20]</code>there's different queue types: 1 = retaliation, 2 = damage, 3 = death, 8 = bind effects
<code>ai_conqueue</code> controller queue


===Engine Functions===
===Engine Functions===
Calling with <code>.</code> or <code>*</code> can change behavior (does not affect procs or labels):
The character <code>.</code> can precede npc_ function names, indicating it's targeting a secondary NPC.
The character <code>.</code> can precede npc_ function names, indicating it's targeting a secondary NPC.


Line 206: Line 261:
|p_aprange
|p_aprange
|-
|-
|p_arrivdelay
|p_arrivedelay
|-
|-
|p_delay
|p_delay
Line 253: Line 308:
|-
|-
|weakqueue
|weakqueue
|}
===Core Content Functons===
{| class="wikitable"
!Name
|-
|~mesbox
|-
|~objbox
|-
|~chatplayer
|-
|~chatnpc
|-
|~.chatnpc_to_other
|-
|~p_choice[1-5]
|-
|@multi[1-5]
|-
|~p_loaddelay
|-
|~p_countdialog
|-
|~if_openmain
|-
|~npc_death
|-
|~npc_meleeattack
|-
|~npc_meleedamage
|-
|~playerhit
|-
|~playerhit_n_melee
|-
|~playerwalk3
|-
|~givexp
|}
|}

Latest revision as of 19:03, 23 June 2023

*(this page records known info from https://github.com/RuneStar/leaks)*

Extra Resources

https://osrs-docs.com/ pw: rsps

https://neptune-ps.gitlab.io/runescript/index.html

https://github.com/data-dependent/osrs-guides/blob/master/skilling.md

Terminology

op = operable interaction (occurs within 1 tile / line of walk)

ap = approachable interaction (occurs within approachable range of up to 10 tiles / line of sight)

cam = camera

if = interface

com = interface component

inv = inventory

loc = "location", represents an object in the world e.g. a Tree

obj = "object", represents items

p_ = protected (not able to access full set of variables)

stat = skill

oc = related to obj config

op____[1-5] = option 1 through 5 used on target

op____u = item used on target

op____t = spell used on target

opobj = interacted item on ground

opheld = interacted with item in inventory

Constants

^lootdrop_duration = 200
^dm_default = "Nothing interesting happens."
^max_32bit_int = 0x7FFFFFFF

Function Signatures

Functions can be registered 3 ways.

[proc,name](params)(return) known as a procedure or subroutine. Called via gosub(name) or by prefixing with ~.

[label,name](params) similar to GOTO/LABEL syntax. Called via jump(name) or by prefixing with @.

[trigger,on] contextual function handler registered for a specific action occurring in the engine.

Triggers

opnpc[1-5] / opnpcu / opnpct

apnpc1[1-5]

opplayer[1-5] / opplayeru / opplayert

applayer[1-5]

oploc[1-5] / oplocu / oploct

aploc[1-5]

opobj[1-5] / opobju / opobjt

opheld[1-5] / opheldu / opheldt

if_button[1-10]

ai_queue[1-20]there's different queue types: 1 = retaliation, 2 = damage, 3 = death, 8 = bind effects

ai_conqueue controller queue

Engine Functions

Calling with . or * can change behavior (does not affect procs or labels):

The character . can precede npc_ function names, indicating it's targeting a secondary NPC.

The character * can follow queue function names, indicating a second set of arguments are being passed.

Name
anim
buffer_full
buildappearance
cam_lookat
cam_moveto
cam_reset
clearbit
clearqueue
controller_coord
controller_del
controller_findexact
controller_queue
coord
displayname
enum_getoutputcount
facesquare
finduid
getqueue
healenergy
huntnext
if_close
if_setevents
inarea
inv_add
inv_del
inv_getobj
inv_getvar
inv_itemspace2
inv_moveitem
inv_resendslot
inv_setslot
inv_setvar
inv_size
inv_total
inzone
last_comsubid
last_int
last_slot
last_useitem
last_useslot
last_verifyobj
loc_add
loc_angle
loc_anim
loc_category
loc_coord
loc_del
loc_find
loc_findallzone
loc_findnext
loc_param
loc_type
longqueue
map_clock
map_members
mes
mes_typed
movecoord
name
npc_add
npc_anim
npc_basestat
npc_category
npc_coord
npc_del
npc_delay
npc_facesquare
npc_findexact
npc_param
npc_queue
npc_range
npc_say
npc_sethunt
npc_sethuntmode
npc_setmode
npc_statheal
npc_type
obj_add
obj_add
objectverify
oc_category
oc_desc
oc_members
oc_name
oc_param
p_aprange
p_arrivedelay
p_delay
p_pausebutton
p_telejump
p_transmogrify
random
randominc
region_findbycoord
region_getcoord
runclientscript
scale
seqlength
setbit
softtimer
sound_area
sound_synth
split_init
split_pagecount
staffmodlevel
stat
stat_base
stat_heal
testbit
weakqueue

Core Content Functons

Name
~mesbox
~objbox
~chatplayer
~chatnpc
~.chatnpc_to_other
~p_choice[1-5]
@multi[1-5]
~p_loaddelay
~p_countdialog
~if_openmain
~npc_death
~npc_meleeattack
~npc_meleedamage
~playerhit
~playerhit_n_melee
~playerwalk3
~givexp