From: okokokok
Hello guys,
I am trying to figure out how to make the script detect trees faster and the hatchet support doesnt work.
For the matter of the better tree detection: I was thinking about adding something like (MSX1,MSY1,MSX2,MSY2) somewhere, so it will only search the main screen. I dont really have an idea how to implement that. Some advice would be helpfull :)
The hatchetsupport: I have picked this hatchetsupport out of srl/srl/skill/woodcutting.scar. But it doesnt work properly, because even though i have wielded a hatchet the script will say "No axe found". I have looked all over the hatchetsupport and i think it has something to do with the bitmaps. Im not really sure, but if u could help me with it, id really appreciate it :)
Greetz okokokok
The problem with the hatchet detection is that you use
case GetCurrentTab of
wrongly
Change this part:
repeat
case GetCurrentTab of
tab_Equip: begin
for WieldAxe := 0 to 8 do
if FindTransparentBitmapTolerance(srl_GetBitmap(54-WieldAxe + Integer(WieldAxe = 8) * 64),Ix, Iy, clBlack, 566, 285, 606, 327, 10) then
Break;
if I = 0 then
if not GameTab(tab_Inv) then exit;
Inc(I);
end;
tab_Inv: begin
for InvAxe := 0 to 8 do
if FindTransparentBitmapTolerance(srl_GetBitmap(54 - InvAxe + Integer(InvAxe = 8) * 64), Ix, Iy, clBlack, MIX1, MIY1, MIX2, MIY2, 10) then
Break;
if I = 0 then
if not GameTab(tab_Equip) then exit;
Inc(I);
end;
else
if not GameTab(tab_Equip) then exit;
end;
until I = 2;
to this:
GameTab(tab_Equip);
for WieldAxe := 0 to 8 do
if FindTransparentBitmapTolerance(srl_GetBitmap(54-WieldAxe + Integer(WieldAxe = 8) * 64),Ix, Iy, clBlack, 566, 285, 606, 327, 10) then
Break;
GameTab(tab_Inv);
for InvAxe := 0 to 8 do
if FindTransparentBitmapTolerance(srl_GetBitmap(54 - InvAxe + Integer(InvAxe = 8) * 64), Ix, Iy, clBlack, MIX1, MIY1, MIX2, MIY2, 10) then
Break;
you can look at how to use case statements
here