SRL Archive - MSI Updates & Announcements

March 10th, 2011


Coh3n

2011-03-10 22:39:50

All the updates made today. :)

$ git shortlog 235669b5e7c11fcf8121..3300a48172d9b424108f|cat
Cohen Adair (6):
Some cleaning up: added a CloseWindow to MSI_ClickInvTab; renamed MSI_GetItemExperiences; removed a couple unused functions; moved SumTIA to Manipulation.simba.
Documentation for Locations.simba.
Just a small bit of organization.
Merge branch 'master' of github.com:PxlBuzzard/MSI
Merged with IPwns + a few changes.

PxlBuzzard (6):
Added (untested) a fix for having more than 2 points in a LOC (it used to loop back and forth between the first two points instead of going between all points available). To do that I also added CurrentPoint as a global variable, this method is temporary and should it be stored per-user instead.
Relocate is still incomplete, but I've moved CurrentPoint into Globals.simba and stored it per player. I also have an incomplete countdown loop to cycle back through the points once it reaches the last point in the array.
Moved my code from Relocate.simba (depreciated) to Walking.simba and simplified from 2 loops into 1.
Updated Walking.simba again with TPA inversion if the player is at the last point in the cycle.
Walking between more than 2 points in an autoing loop works properly now, and I began working on adding an animating failsafe check to Fishing.
Reverted my inverted walking in Draynor Yews (I flipped it around as a test and accidentally committed)
Complete history - https://github.com/SRL/MSI/commits/master

NCDS

2011-03-10 22:55:24

One thing; "and I began working on adding an animating failsafe check to Fishing.". Fishing already checks for animation. It just calls PixelShift instead of IsAnimating.

Just something that stuck out to me right away. Everything else looks good at a glance though. :)

IPwnz

2011-03-10 23:26:16

From: NCDS
One thing; "and I began working on adding an animating failsafe check to Fishing.". Fishing already checks for animation. It just calls PixelShift instead of IsAnimating.

Just something that stuck out to me right away. Everything else looks good at a glance though. :)


PixelShift wasn't working for me at Catherby NCDS, so I just figured an animation check would just be one more backup. :)

NCDS

2011-03-10 23:46:58

From: IPwnz
PixelShift wasn't working for me at Catherby NCDS, so I just figured an animation check would just be one more backup. :)


PixelShift is used in IsAnimating, and we don't use Reflection for Objects, so unless you had another way?

I didn't look at what you did, but messing with the TCounts in WaitWhileFishing might help.

Coh3n

2011-03-10 23:58:56

You may just be able to call IsAnimating (or whatever the color function is in Animations.scar).

NCDS

2011-03-11 00:04:27

From: Coh3n
You may just be able to call IsAnimating (or whatever the color function is in Animations.scar).

From: NCDS
PixelShift is used in IsAnimating



{*******************************************************************************
function PixelShiftMulti(B: TBoxArray; T: Integer): TIntegerArray;
By: marpis
Description: Calculates how many pixels change in boxes B during time T.
Date: Nov. 29, 2009
*******************************************************************************}
function PixelShiftMulti(B: TBoxArray; T: Integer): TIntegerArray;
Var
L, I{$ifdef SCAR}, X, Y{$ENDIF}: Integer;
BMP, BMP2: TIntegerArray;
begin
L := Length(B);
SetLength(BMP, L);
SetLength(BMP2, L);
SetLength(Result, L);
{$IFDEF Simba}
for I := 0 to (L - 1) do
BMP[I] := BitmapFromClient(B[i].x1,B[i].y1,B[i].x2,B[i].y2);
Wait(T);
for I := 0 to (L - 1) do
BMP2[I] := BitmapFromClient(B[i].x1,B[i].y1,B[i].x2,B[i].y2);
for i := 0 to (L - 1) do
result[i] := CalculatePixelShift(BMP[i],BMP2[i],IntToBox(0,0,(b[i].x2 - b[i].x1),(b[i].y2-b[i].y1)));
{$ELSE}
for I := 0 to (L - 1) do
begin
BMP[I] := BitmapFromString((B[I].X2 - B[I].X1), (B[I].Y2 - B[I].Y1), '');
BMP2[I] := BitmapFromString((B[I].X2 - B[I].X1), (B[I].Y2 - B[I].Y1), '');
SafeCopyCanvas(GetClientCanvas, GetBitmapCanvas(BMP[I]), B[I].X1, B[I].Y1, B[I].X2, B[I].Y2, 0, 0, (B[I].X2 - B[I].X1), (B[I].Y2 - B[I].Y1));
end;
Wait(T);
for I := 0 to (L - 1) do
SafeCopyCanvas(GetClientCanvas, GetBitmapCanvas(BMP2[I]), B[I].X1, B[I].Y1, B[I].X2, B[I].Y2, 0, 0, (B[I].X2 - B[I].X1), (B[I].Y2 - B[I].Y1));
for I := 0 to (L - 1) do
for X := 0 to (B[I].X2 - B[I].X1) do
for Y := 0 to (B[I].Y2 - B[I].Y1) do
if (FastGetPixel(BMP[I], X, Y) <> FastGetPixel(BMP2[I], X, Y)) then
Inc(Result[I]);
{$ENDIF}
for I := 0 to (L - 1) do
begin
FreeBitmap(BMP[I]);
FreeBitmap(BMP2[I]);
end;
end;

{*******************************************************************************
function PixelShift(B: TBox; Time: Integer): Integer;
By: marpis
Description: Calculates how many pixels change in box B during time T.
Date: Nov. 29, 2009
*******************************************************************************}
function PixelShift(B: TBox; Time: Integer): Integer;
var
TIA: TIntegerArray;
begin
TIA := PixelShiftMulti([B], Time);
Result := TIA[0];
end;

{*******************************************************************************
function AnimatingMulti(B: TBoxArray; Time, MinCount: Integer): TBooleanArray;
By: marpis
Description: Finds constant animation in boxes B during time T. If PixelShift
in box is smaller than MinCount, it's considered not animating.
Date: Nov. 29, 2009
*******************************************************************************}
function AnimatingMulti(B: TBoxArray; Time, MinCount: Integer): TBooleanArray;
var
Shifts: TIntegerArray;
TT, I, H: Integer;
begin
TT := GetSystemTime + Time;
H := High(B);
SetLength(Result, H + 1);
for I := 0 to H do
Result[I] := True;
while (GetSystemTime < TT) do
begin
Shifts := PixelShiftMulti(B, 50);
for I := 0 to H do
if (Shifts[I] <= MinCount) then
Result[I] := False;
end;
end;

{*******************************************************************************
function Animating(B: TBox; Time, MinCount: Integer): Boolean;
By: marpis
Description: Finds constant animation in box B during time T. If PixelShift
in box B is smaller than MinCount, it's considered not animating.
Date: Nov. 29, 2009
*******************************************************************************}
function Animating(B: TBox; Time, MinCount: Integer): Boolean;
var
TBA: TBooleanArray;
begin
TBA := AnimatingMulti([B], Time, MinCount);
Result := TBA[0];
end;
They all really accomplish the same thing, have a look. :redface:

Coh3n

2011-03-11 00:06:42

I know..

I'm saying that instead of making a specific MSI animation for fishing, IsAnimating may work just fine. Maybe not, though since the fishing animation is kind of weird.

NCDS

2011-03-11 00:14:05

Ahh yeah, that might work. Might as well try it out at least.

My bad, I didn't get what you meant before, I wasn't trying to act smarter than you or anything like that. :redface:

Coh3n

2011-03-11 00:20:46

From: NCDS
Ahh yeah, that might work. Might as well try it out at least.

My bad, I didn't get what you meant before, I wasn't trying to act smarter than you or anything like that. :redface:

Lol I know. :p I probably just didn't explain well enough.

Also I think the part IPwnz was referring to to begin with is that it breaks out of the loop after 30 seconds no matter what. That can easily be changed from the one line. Just change the 30000 to 60000 or whatever is necessary. Regardless, WaitWhileFishing needs to be improved.

NCDS

2011-03-11 00:29:26

From: Coh3n
Lol I know. :p I probably just didn't explain well enough.

Also I think the part IPwnz was referring to to begin with is that it breaks out of the loop after 30 seconds no matter what. That can easily be changed from the one line. Just change the 30000 to 60000 or whatever is necessary. Regardless, WaitWhileFishing needs to be improved.


Yeah YoHoJo was just talking to me about it on MSN. If IPwnz doesn't do it by the time I'm done with cooking I'll do it. (I should be done (hopefully) by early tomorrow.

IPwnz

2011-03-12 23:04:31

From: NCDS
Yeah YoHoJo was just talking to me about it on MSN. If IPwnz doesn't do it by the time I'm done with cooking I'll do it. (I should be done (hopefully) by early tomorrow.


I'm still trying to get WaitWhileFishing in ship-shape order over here, it's slowly improving. :)

Coh3n

2011-03-13 03:55:07

From: IPwnz
I'm still trying to get WaitWhileFishing in ship-shape order over here, it's slowly improving. :)

Awesome! I'm glad someone's finally tweaking it. :)