Le Jingle
03-30-2013, 08:16 PM
Hi all, I know Randoms are top priority at the moment for releasing OSR includes ASAP. However, I noticed a few people ask about magic spells, so I created a spell clicking function for users:
const
// Teleports:
LUMBRIDGE_HOME_TELEPORT = 0;
VARROCK_TELEPORT = 15;
LUMBRIDGE_TELEPORT = 18;
FALADOR_TELEPORT = 21;
TELEPORT_TO_HOUSE = 23;
CAMELOT_TELEPORT = 26;
ARDOUGNE_TELEPORT = 32;
WATCHTOWER_TELEPORT = 37;
TROLLHEIM_TELEPORT = 44;
TELEPORT_TO_APE_ATOLL = 47;
// Teleother's:
TELEOTHER_LUMBRIDGE = 54;
TELEOTHER_FALADOR = 59;
TELEOTHER_CAMELOT = 62;
// TeleBlock:
TELE_BLOCK = 60;
// Combat Elements:
WIND_STRIKE = 1;
WATER_STRIKE = 4;
EARTH_STRIKE = 6;
FIRE_STRIKE = 8;
WIND_BOLT = 10;
WATER_BOLT = 14;
EARTH_BOLT = 17;
FIRE_BOLT = 20;
WIND_BLAST = 24;
WATER_BLAST = 27;
EARTH_BLAST = 33;
FIRE_BLAST = 38;
WIND_WAVE = 45;
WATER_WAVE = 48;
EARTH_WAVE = 52;
FIRE_WAVE = 55;
// Combat Misc:
CRUMBLE_UNDEAD = 22;
IBAN_BLAST = 29;
MAGIC_DART = 31;
SARADOMIN_STRIKE = 41;
CLAWS_OF_GUTHIX = 42;
FLAMES_OF_ZAMORAK = 43;
// Skill:
ENCHANT_CROSSBOW_BOLT = 3;
LVL_1_ENCHANT = 5;
LOW_LEVEL_ALCHEMY = 13;
LVL_2_ENCHANT = 16;
SUPERHEAT_ITEM = 25;
LVL_3_ENCHANT = 28;
HIGH_LEVEL_ALCHEMY = 34;
CHARGE_WATER_ORB = 35;
LVL_4_ENCHANT = 36;
CHARGE_EARTH_ORB = 39;
CHARGE_FIRE_ORB = 46;
CHARGE_AIR_ORB = 49;
LVL_5_ENCHANT = 51;
LVL_6_ENCHANT = 61;
// Other:
CONFUSE = 2;
WEAKEN = 7;
BONES_TO_BANANAS = 9;
CURSE = 11;
BIND = 12;
TELEKINETIC_GRAB = 19;
SNARE = 30;
BONES_TO_PEACHES = 40;
VULNERABILITY = 50;
ENFEEBLE = 53;
ENTANGLE = 56;
STUN = 57;
CHARGE = 58;
(*
CastSpell
~~~~~~~~~~~
.. code-block:: pascal
procedure CastSpell(NAME: Integer);
Casts the constant name skill spell. Only valid to use constant mage spells with
a value from 0 to 62. See Constant values above for more information.
.. note::
Author: Le Jingle (Mar. 30th, 2013)
Last Modified: Never
Example:
.. code-block:: pascal
CastSpell(HIGH_LEVEL_ALCHEMY);
*)
procedure CastSpell(NAME: Integer);
begin
if (not inRange(name, 0, 62)) and (not GameTab(Tab_Magic)) then
Exit;
Mouse((570 + (name mod 7) * 24), (238 + (name div 7) * 24), 6, 6, Mouse_Left);
end;
I did have MouseOval in there instead of Mouse, but I figured it won't make much difference since the center of the spell still should allow for plenty randomness using Mouse.
On a side note, I don't have direct access to OSR, but I think I will look over the recent activity for the randoms include for OSR, seeing as I haven't much else to contribute (suggestions welcome here too ;] )
Cheers,
Lj
Edit: Didn't post in SRL-Snippets, as this is OSR related, no?
const
// Teleports:
LUMBRIDGE_HOME_TELEPORT = 0;
VARROCK_TELEPORT = 15;
LUMBRIDGE_TELEPORT = 18;
FALADOR_TELEPORT = 21;
TELEPORT_TO_HOUSE = 23;
CAMELOT_TELEPORT = 26;
ARDOUGNE_TELEPORT = 32;
WATCHTOWER_TELEPORT = 37;
TROLLHEIM_TELEPORT = 44;
TELEPORT_TO_APE_ATOLL = 47;
// Teleother's:
TELEOTHER_LUMBRIDGE = 54;
TELEOTHER_FALADOR = 59;
TELEOTHER_CAMELOT = 62;
// TeleBlock:
TELE_BLOCK = 60;
// Combat Elements:
WIND_STRIKE = 1;
WATER_STRIKE = 4;
EARTH_STRIKE = 6;
FIRE_STRIKE = 8;
WIND_BOLT = 10;
WATER_BOLT = 14;
EARTH_BOLT = 17;
FIRE_BOLT = 20;
WIND_BLAST = 24;
WATER_BLAST = 27;
EARTH_BLAST = 33;
FIRE_BLAST = 38;
WIND_WAVE = 45;
WATER_WAVE = 48;
EARTH_WAVE = 52;
FIRE_WAVE = 55;
// Combat Misc:
CRUMBLE_UNDEAD = 22;
IBAN_BLAST = 29;
MAGIC_DART = 31;
SARADOMIN_STRIKE = 41;
CLAWS_OF_GUTHIX = 42;
FLAMES_OF_ZAMORAK = 43;
// Skill:
ENCHANT_CROSSBOW_BOLT = 3;
LVL_1_ENCHANT = 5;
LOW_LEVEL_ALCHEMY = 13;
LVL_2_ENCHANT = 16;
SUPERHEAT_ITEM = 25;
LVL_3_ENCHANT = 28;
HIGH_LEVEL_ALCHEMY = 34;
CHARGE_WATER_ORB = 35;
LVL_4_ENCHANT = 36;
CHARGE_EARTH_ORB = 39;
CHARGE_FIRE_ORB = 46;
CHARGE_AIR_ORB = 49;
LVL_5_ENCHANT = 51;
LVL_6_ENCHANT = 61;
// Other:
CONFUSE = 2;
WEAKEN = 7;
BONES_TO_BANANAS = 9;
CURSE = 11;
BIND = 12;
TELEKINETIC_GRAB = 19;
SNARE = 30;
BONES_TO_PEACHES = 40;
VULNERABILITY = 50;
ENFEEBLE = 53;
ENTANGLE = 56;
STUN = 57;
CHARGE = 58;
(*
CastSpell
~~~~~~~~~~~
.. code-block:: pascal
procedure CastSpell(NAME: Integer);
Casts the constant name skill spell. Only valid to use constant mage spells with
a value from 0 to 62. See Constant values above for more information.
.. note::
Author: Le Jingle (Mar. 30th, 2013)
Last Modified: Never
Example:
.. code-block:: pascal
CastSpell(HIGH_LEVEL_ALCHEMY);
*)
procedure CastSpell(NAME: Integer);
begin
if (not inRange(name, 0, 62)) and (not GameTab(Tab_Magic)) then
Exit;
Mouse((570 + (name mod 7) * 24), (238 + (name div 7) * 24), 6, 6, Mouse_Left);
end;
I did have MouseOval in there instead of Mouse, but I figured it won't make much difference since the center of the spell still should allow for plenty randomness using Mouse.
On a side note, I don't have direct access to OSR, but I think I will look over the recent activity for the randoms include for OSR, seeing as I haven't much else to contribute (suggestions welcome here too ;] )
Cheers,
Lj
Edit: Didn't post in SRL-Snippets, as this is OSR related, no?