FANDOM


The osrs_oh script is used by the Open Source Rule Set to handle the OnHeartbeat event. The content of the script is the following.

/////////////////////////////////////////////////////////////////////////////
//
// file:
//      osrs_oh
//
// purpose:
//      OnHeartbeat event script.
//
/////////////////////////////////////////////////////////////////////////////

// the include file for Open Source Rule Set events
#include "osrs_inc"

/////////////////////////////////////////////////////////////////////////////
void main()
{
    // determine what type of object is calling this script
    int iCallingClass = osrs_GetCallerEventClass(OBJECT_SELF);
    switch(iCallingClass)
    {
        ////////////////////////////////////////      module
        case I_OSRS_EVENT_CLASS_MODULE:
            // Module::OnHearbeat Pre-event
            if (!osrs_mo_oh_pre())
            {
                return;
            }

            // Module::OnHearbeat event
            if (!osrs_mo_oh())
            {
                return;
            }

            // Module::OnHearbeat post-event
            osrs_mo_oh_post();

            break;



        ////////////////////////////////////////      Area
        case I_OSRS_EVENT_CLASS_AREA:
            // Area::OnHearbeat Pre-event
            if (!osrs_a_oh_pre())
            {
                return;
            }

            // Area::OnHearbeat event
            if (!osrs_a_oh())
            {
                return;
            }

            // Area::OnHearbeat post-event
            osrs_a_oh_post();

            break;



        ////////////////////////////////////////      creature
        case I_OSRS_EVENT_CLASS_CREATURE:
            // Creature::OnHearbeat Pre-event
            if (!osrs_c_oh_pre())
            {
                return;
            }

            // Creature::OnHearbeat event
            if (!osrs_c_oh())
            {
                return;
            }

            // Creature::OnHearbeat post-event
            osrs_c_oh_post();

            break;



        ////////////////////////////////////////      placeable
        case I_OSRS_EVENT_CLASS_PLACEABLE:
            // Placeable::OnHearbeat Pre-event
            if (!osrs_p_oh_pre())
            {
                return;
            }

            // Placeable::OnHearbeat event
            if (!osrs_p_oh())
            {
                return;
            }

            // Placeable::OnHearbeat post-event
            osrs_p_oh_post();

            break;



        ////////////////////////////////////////      Door
        case I_OSRS_EVENT_CLASS_DOOR:
            // Door::OnHeartbeat Pre-event
            if (!osrs_d_oh_pre())
            {
                return;
            }

            // Door::OnHeartbeat event
            if (!osrs_d_oh())
            {
                return;
            }

            // Door::OnHeartbeat post-event
            osrs_d_oh_post();

            break;



        ////////////////////////////////////////      Encounter
        case I_OSRS_EVENT_CLASS_ENCOUNTER:
            // Encounter::OnHearbeat Pre-event
            if (!osrs_e_oh_pre())
            {
                return;
            }

            // Encounter::OnHearbeat event
            if (!osrs_e_oh())
            {
                return;
            }

            // Encounter::OnHearbeat post-event
            osrs_e_oh_post();

            break;



        ////////////////////////////////////////      Trigger
        case I_OSRS_EVENT_CLASS_TRIGGER:
            // Trigger::OnHearbeat Pre-event
            if (!osrs_tri_oh_pre())
            {
                return;
            }

            // Trigger::OnHearbeat event
            if (!osrs_tri_oh())
            {
                return;
            }

            // Trigger::OnHearbeat post-event
            osrs_tri_oh_post();

            break;



        ////////////////////////////////////////      trap
        case I_OSRS_EVENT_CLASS_TRAP:
            // trap::OnHeartbeat Pre-event
            if (!osrs_tra_oh_pre())
            {
                return;
            }

            // trap::OnHeartbeat event
            if (!osrs_tra_oh())
            {
                return;
            }

            // trap::OnHeartbeat post-event
            osrs_tra_oh_post();

            break;



    }
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.