SRL Archive - SRL Suggestions

(Mining.Simba) Couple things


NCDS

2010-09-08 18:54:01

Current FindPickHeadColor;

{*******************************************************************************
function FindPickHeadColor: Boolean;
By: WT-Fakawi fixed by NaumanAkhlaQ
Description: Finds PickHead colors. Returns hc1, 2, 3, 4 & 5 for PickHead
finding of False when No Pick is in either GameTab(tab_Inv) or GameTab(5).
Sets Global variable NoPick.
*******************************************************************************}
function FindPickHeadColor: Boolean;
var
Pick, ix, iy: Integer;
curTab: Byte;

begin
Result := False;
if (not LoggedIn) then exit;

Pick := DTMFromString('78DA63FCC2C4C0F09C910115302291409A899' +
'981E1310135FF8830870368CE4B026A78816A5EE3570300F6B206' +
'B0');

NoPick := True;
curTab := GetCurrentTab;

GameTab(tab_Inv);
if (FindDTM(Pick, ix, iy, MIX1, MIY1, MIX2, MIY2)) then
begin
NoPick := False;
Wielding := False;
EquipPick := False;
end else
begin
GameTab(tab_Equip);
if (FindDTM(Pick, ix, iy, MIX1, MIY1, MIX2, MIY2)) then
begin
NoPick := False;
Wielding := True;
EquipPick := False;
end;
end;

if (not NoPick) then
begin
Wait(100 + Random(100));
MMouse(ix, iy, 0, 0);
Hc1 := GetColor(ix + 1, iy);
Hc2 := GetColor(ix + 2, iy - 1);
Hc3 := GetColor(ix + 6, iy - 1);
Hc4 := GetColor(ix + 12, iy + 1);
Hc5 := GetColor(ix + 16, iy);
srl_Warn('FindPickHeadColor', 'PickColors = [' + IntToStr(hc1) + ', ' + IntToStr(hc2) + ', '
+ IntToStr(hc3) + ', ' + IntToStr(hc4) + ', ' + IntToStr(hc5)+'];', warn_Debug);
Result := True;
end;

FreeDTM(Pick);
GameTab(curTab);
end;

After my updates:

function FindPickHeadColor: Boolean;
var
Pick, ix, iy, i, curTab : Integer;
begin
Result := False;
if (not LoggedIn) then exit;

Pick := DTMFromString('78DA63646065604861628001462076894E63F' +
'80F65FF0702461EA09A74841A086082AB87D040350904D47C6241' +
'B10BA73959F8D50000AE40092D');

i := 0;
NoPick := True;
curTab := GetCurrentTab;

repeat
case GetCurrentTab of
tab_Inv:
if (FindDTM(Pick, ix, iy, MIX1, MIY1, MIX2, MIY2)) then
begin
NoPick := False;
Wielding := False;
EquipPick := False;
Break;
end else
begin
GameTab(tab_Equip);
Inc(i);
end;

tab_Equip:
if (FindDTM(Pick, ix, iy, MIX1, MIY1, MIX2, MIY2)) then
begin
NoPick := False;
Wielding := True;
EquipPick := False;
Break;
end else
Inc(i);

else
Gametab(tab_Inv);

end;
until(not (NoPick)) or (i > 1);

if (not NoPick) then
begin
Wait(100 + Random(100));
MMouse(ix, iy, 0, 0);
Hc1 := GetColor(ix + 1, iy);
Hc2 := GetColor(ix + 2, iy - 1);
Hc3 := GetColor(ix + 6, iy);
Hc4 := GetColor(ix, iy - 1);
Hc5 := GetColor(ix + 3, iy - 1);
srl_Warn('FindPickHeadColor', 'PickColors = [' + IntToStr(hc1) + ', ' + IntToStr(hc2) + ', '
+ IntToStr(hc3) + ', ' + IntToStr(hc4) + ', ' + IntToStr(hc5)+'];', warn_Debug);
Result := True;
end;

FreeDTM(Pick);
GameTab(curTab);
end;
Tested and work's: (Yes, all the points are on the PickHead.)

Compiled succesfully in 593 ms.
SRL Compiled in 16 msec
** Warning in FindPickHeadColor: PickColors = [7892048, 11574902, 7103571, 11903865, 8024414];**
Successfully executed.
What I changed:
  • Updated the DTM
  • Changed Hc[1..5] to work accordingly with the new DTM
  • Updated the tab handling to be more human-like.

Also, MSI uses one record for each type of rock. What is the purpose for SRL having so many? Is there a reason why/is anyone opposed having a single record made to work for each type of rock?

Wanted

2010-09-08 18:57:21

I don't think axe heads fly off anymore, this function was used to find the axe head laying on the ground after it would randomly fall off after excessive mining. I believe they removed that from happening along with evilchicken, zombie, ent, etc…

NCDS

2010-09-08 18:59:31

From: IceFire908
I don't think axe heads fly off anymore, this function was used to find the axe head laying on the ground after it would randomly fall off after excessive mining. I believe they removed that from happening along with evilchicken, zombie, ent, etc…


I see, I figured it was used to get the PickHeadColors like it say's, as it returns them all to global var's, which should probably be an array honestly.

It could still be useful for that I guess..

Nava2

2010-09-09 12:09:48

I think they are still useful.

I mean, its not like he wrote functions to find them on the ground lol

Wanted

2010-09-09 15:58:57

The only reason this function is in SRL is so you can store the colors and then use them later when your axe head falls off in a function to find it on the ground. It's never been used for anything else, nor can I think of a use for it. So I'll have to disagree there.

Markus

2010-09-09 16:40:06

Trash it over the hills and far away, if possible to The Vault or even further ;)

NCDS

2010-09-09 19:31:08

The only use I can think of would be to use it to acquire colors of your pickaxe, or maybe edit it to a FindAndGetColorPickAxe function? That could return Inv: Boolean and a slot number.

So, if that's useful, cool. Otherwise, what Markus said I guess..