Sir R. M8gic1an
2010-04-14 13:26:29
{******************************************************************************}
{ function MSI_BestTool: Integer; }
{ By: Coh3n }
{ Description: Determines the best tool for the job at hand. }
{******************************************************************************}
function MSI_BestTool: Integer;
var
skillsArr: TStringArray;
currSkill, currLevel: Integer;
begin
if (not LoggedIn) then
Exit;
{ In order for this to work properly, the skillsArr indexes must correspond
to the skills constants in SRL's Players.scar }
skillsArr := [ 'attack', 'strength', 'defence', 'range', 'prayer', 'magic',
'runecrafting', 'hitpoints', 'agility', 'herblore', 'thieving',
'crafting', 'fletching', 'slayer', 'mining', 'smithing',
'fishing', 'cooking', 'firemaking', 'woodcutting', 'farming',
'construction', 'hunting', 'summoning' ];
{ Get the current level of the chosen skill, and then look for the required
tool, starting with the best one for that player's skill level. }
currSkill := PlayerSkills[CurrentPlayer][CurrentSkill] - 1;
currLevel := GetSkillLevel(skillsArr[currSkill]);
..
SRL has skill_SkillName in Players.scar, and GetSkillLevel takes integers. Why are we doing all this? Would it not be easier to just do
CurrLevel := GetSkillLevel(currSkill); ?
Also, Zeph just recently changed it so the skill array starts from 1 instead of 0.
Function MSI_GetItem(ID : Integer) : Boolean;
Begin
Case ID Of
//Test item xP
{
CAVADA_BERRIES :
With MSI_Item[CAVADA_BERRIES] Do
Begin
Name := 'Cadava Berries';
UpText := ['dava ber'];
ItemP := Point(0, 0);
Colors := [10033858, 8984493, 7804054, 6558079, 12001255, 9705915];
Stackable := True;
DTM := DTMFromString('78DA63CC616260E0606440066EBA9C0C22401A26CA980554C386A6C6'+
'C118554D0EA61A902C86391C04D4E401D570A1AA392A3D07D32E2EFC6E0600B439067C');
BMP := BitmapFromString(7, 7, 'beNoTrfVwMPGwM3G2NmRgYHTT5XTRASE3B2MIAgraa3A'+
'ASYggUDGEbaTABmEASSAyV2YH6oWwgYxpIuUdQjlAtoc+F5B8pbDzkfzmWsHkqSJlEAXXZFcdlZ6zVbI/lz8Mogto1G7JKWvFO+cCACNQHR0=');
End;
The With..Do statements should be indented.
Same for MSI_GetObject.
in MSI_IsMoving the comment have to be taken out.
{$IFDEF REFLECTION} should just simply be left there at all times. We just simply don't define ref. That's why it's done this way. IsMoving is in ColorWalking.scar
In Banking.scar Symbol accuracy and bitmap tol should use constants.
And that's all that I could see. I'd change it around myself, but still have a quite a few things to type out and i'm short on time.
~RM