function CalculateCasts: Integer;
var
i, h: Integer;
Rune_Names: Array of String;
Runes_Needed: Array of Integer;
begin
SetArrayLength(Rune_Names, RUNE_TYPES_F2P);
Rune_Names := ['air', 'water', 'earth', 'mind', 'body', 'chaos', 'death', 'cosmic',
'nature', 'law'];
h := High(Rune_Names);
for i := 0 to h do
Runes_Needed[i] := RuneAmount('inv', Rune_Names[i]);
for i:= RUNE_LOW to RUNE_HIGH do
if Runes_Needed[i] > 0 then
begin
TheThing[i] := round(RuneCount[i] / Runes_Needed[i]);
Result := min(Result, TheThing[i]);
end;
end;
function GetStaff(): String;
var
x, y, i, h:integer;
Staff_Equiped: Array of String;
Staff_Int_Arr: Array of Integer;
begin
SetArrayLength(Staff_Equiped, NUMBER_OF_STAFFS);
SetArrayLength(Staff_Int_Arr, NUMBER_OF_STAFFS);
Staff_Int_Arr := [STAFF_AIR, STAFF_WATER, STAFF_EARTH, STAFF_FIRE];
Staff_Equiped := ['Staff of Air', 'Staff of Water', 'Staff of Earth', 'Staff of Fire'];
GameTab(tab_Equip);
h := High(Staff_Int_Arr);
for i := 0 to h do
MSI_FindTool[Staff_Equiped[i]] := RuneAmount('inv', i);
begin
Result := Staff_Int_Arr[i];
writeln(Staff_Equiped[i]+' equiped.');
Exit;
end else
Result := '';
writeln('Could not find staff in Inventory');
Exit;
end;
function SpellToStr(Spell: integer; out Required_Runes :Integer): string;
var
Spell_Arr: Array of Integer;
String_Arr: Array of String;
begin
SetArrayLength(Spell_Arr, NUMBER_OF_SPELLS);
SetArrayLength(String_Arr, NUMBER_OF_SPELLS)
Spell_Arr := [SPELL_WIND_STRIKE , SPELL_WIND_BOLT, SPELL_WIND_BLAST, SPELL_WIND_WAVE, SPELL_WATER_STRIKE,
SPELL_WATER_BOLT, SPELL_WATER_BLAST, SPELL_WATER_WAVE, SPELL_EARTH_STRIKE, SPELL_EARTH_BOLT,
SPELL_EARTH_BLAST, SPELL_EARTH_WAVE, SPELL_FIRE_STRIKE, SPELL_FIRE_BOLT, SPELL_FIRE_BLAST,
SPELL_FIRE_WAVE, SPELL_STATE_CONFUSE, SPELL_STATE_WEAKEN, SPELL_STATE_CURSE, SPELL_STATE_BIND,
SPELL_TELE_HOME, SPELL_TELE_VARROCK, SPELL_TELE_LUMBY, SPELL_TELE_FALLY, SPELL_ALCH_LOW,
SPELL_ALCH_HIGH, SPELL_TELEGRAB, SPELL_SUPERHEAT];
String_Arr := ['wind strike', 'wind bolt', 'wind blast', 'wind wave', 'water strike', 'water bolt',
'water blast', 'water wave', 'earth strike', 'earth bolt', 'earth blast', 'earth wave',
'fire strike', 'fire bolt', 'fire blast', 'fire wave', 'confuse', 'weaken', 'curse',
'bind', 'lumbridge home teleport', 'varrock teleport', 'lumbridge teleport', 'falador teleport',
'low level alchemy', 'high level alchemy', 'telekinetic grab', 'superheat item'];
if (not InIntArray(Spell_Arr, Spell)) then
Writeln('Invalid spell. Check /msi/skill/magic.simba for a list.');
Result := String_Arr[Spell];
//Required_Runes := Load_Spell(Result); // need to make this
end;
function MSI_ItemToSpellSlot(spell: integer): boolean;
var
i, h: Integer;
Spell_Arr, Inv_Slot_Arr : Array of Integer;
begin
SetArrayLength(Spell_Arr, NUMBER_OF_NAT_SPELLS);
SetArrayLength(Inv_Slot_Arr, NUMBER_OF_NAT_SPELLS);
Spell_Arr := [SPELL_ALCH_LOW, SPELL_ALCH_HIGH, SPELL_SUPERHEAT];
Inv_Slot_Arr := [6, 15, 13];
h := High(Spell_Arr);
for i:= 0 to h do
if (i = Spell) then
Result := MSI_DragItem(STAFF_FIRE, Inv_Slot_Arr[i]) // wouldnt that move the fire staff??
end;
]
thats what i have thought of so far, im still thinking of a way of calculate how many cast a player can do