SRL Archive - First Scripts

Chicken Killer


nagrom1700

2009-11-11 16:50:01

Well here is my first script after 5 days of scripting it seems presentable so I decided to post it. I am still going to be improving it but I am posting for feedback on what I can do better to improve the weak points in my script.

Mainly looking for feedback and ways to improve.

Instructions:
Just fill in the player info and press run.

JPHamlett

2009-11-11 17:10:22

very nice first script inly thing i saw at a glance was


function InCombat: boolean;
var
centerX, centerY : Integer;
AllHPBars : TBoxArray;
begin
if not LoggedIn then Exit;
centerX := MSCX;
centerY := MSCY;
AllHpBars := FindAllHPBars(centerX, centerY, MSCX-40, MSCY-40, MSCX+40, MSCY+40);
if not High(AllHpBars) < 0 then
begin
Result := True;
InCombatVar := True;
end else
begin
InCombatVar := False;
end;
end;

could be


function InCombat: boolean;
var
centerX, centerY : Integer;
AllHPBars : TBoxArray;
begin
if not LoggedIn then Exit;

AllHpBars := FindAllHPBars(mscX, mscY, MSCX-40, MSCY-40, MSCX+40, MSCY+40);
if not High(AllHpBars) < 0 then
begin
Result := True;
InCombatVar := True;
end else
begin
InCombatVar := False;
end;
end;

to save lines of code but very nice im expecting alot from you

benjaa

2009-12-29 22:15:54

i found a possible error

case Lowercase(Players[currentplayer].Strings[0]) of
'Attack': SetFightMode(1);
'Strength':SetFightMode(2);
'Defence':SetFightMode(4);
'even':SetFightMode(3);
end;

I'm not quite sure, but shouldnt it be
'attack': SetFightMode(1);
and so on

because

lowercase("Attack") <> "Attack"

Floor66

2009-12-30 11:17:55

Yeah… Lowercase('Floor66'); is 'floor66', it will never be 'Floor66'.