SRL Archive - MSI Suggestions

[Blog] Walking.scar


marpis

2009-10-19 11:47:31

Hi.

This is a Walking.scar proggress blog.

None of these have been tested yet, so they will still need fixing.
  • 19.10.2009
    • MSI_IsMoving: Boolean;
    • MSI_Flag(Distance: Integer);
    • MSI_WalkToTile(P: TPoint; Randomness, FlagD: Integer): Boolean;
    • MSI_WalkPath(P: TPointArray; Randomness: Integer): Boolean;
  • 20.10.2009
    • LoadWalk(StartLocation, EndLocation: Integer): TWalk; Structure ready
    • FormWalk(City, Loc: Integer; Path: TPointArray): TWalk;
  • 23.10.2009
    • LoadPath(StartLocation, EndLocation: Integer): TPointArray;
    • FixPosition(Location: Integer): Boolean;
  • 1.12.2009
    • First colorwalking function: FindMMLocation!
    • Uses both symbol, DTM and color finding! The color calculating is fascinating, check it out! :)

Coh3n

2009-10-21 20:23:03

You should post the code here for convenience. :)

Cazax

2009-10-29 17:48:13

For walking detection, if we are using reflection, why don't we check whether the player moves or not? IIRC it was like GetSelf.Position then you see if the values have changed. Or combine color with reflection. The rest looks fine :)

marpis

2009-10-30 01:37:06

From: Cazax
For walking detection, if we are using reflection, why don't we check whether the player moves or not? IIRC it was like GetSelf.Position then you see if the values have changed. Or combine color with reflection. The rest looks fine :)


Hmm true, I'll add {$IFDEF REFLECTION} ReflectionFlagThing; Exit {$ENDIF}

marpis

2009-11-15 13:21:36

Rev #29 Added debugging, and tested compiling it.

Sir R. M8gic1an

2009-11-15 13:24:33

MSIDebug('FUNCTION NAME ', 'Starting', Debug_Functions);

at the top of all functions ;)

~RM

Nava2

2009-11-15 17:38:27

Your pixel shift procedure will not always work based on the fact that what about dots moving and dots changing there position. A lot of people in one area will do that as well.

marpis

2009-11-15 18:01:16

From: Nava2
Your pixel shift procedure will not always work based on the fact that what about dots moving and dots changing there position. A lot of people in one area will do that as well.


Now I found the other version of PixelShift here, I need to check if that works well…

Cazax

2009-11-25 15:26:23

So what's left? We could get the paths for every location but I think that SRL members can do that once we release… Also, has this been commited?

Coh3n

2009-11-25 16:06:11

From: Cazax
So what's left? We could get the paths for every location but I think that SRL members can do that once we release… Also, has this been commited?

Yes it's been committed.

We may as well let the other members gather the paths, but I don't see the point right now as reflection still isn't working. We may have to start off the beta as a power script, or just in areas where we can make efficient color walking without too much trouble.

marpis

2009-11-30 17:10:07

Colorwalking development started!


{ Type TMMLocation
Description: Stores all needed colorwalking information. }
TMMLocation = Record
Symbol : String;
DTM : Integer;
W, H : Integer;
Colors : TIntegerArray;
Tolerances : TIntegerArray;
Counts : TIntegerArray;
End;

ยจ{******************************************************************************}
{ Function FindMMLocation(Var X, Y: Integer; Location: TMMLocation): Boolean; }
{ By: marpis }
{ Rev: 35 }
{ Date: 30 Nov 09 }
{ Description: Finds a location in minimap. First tries to find symbol, then }
{ DTM, and if still not found it will find it by calculating }
{ colors. }
{******************************************************************************}
Function FindMMLocation(Var X, Y: Integer; Location: TMMLocation): Boolean;

How to use this?
[PHP]
Function EnterVWB: Boolean;
Var
MyLocation: TMMLocation;
X, Y: Integer
Begin
With MyLocation Do
Begin
Symbol := 'bank';
DTM := DTMFromString('dfjikdajid2389n89xu'); // <- just made this up
Colors := [60909, 4879485];
Tolerances := [10, 10];
Counts := [50, 500];
W := 65;
H := 30;
End;

If FindMMLocation(X, Y, MyLocation) Then
Begin
Result := True;
MouseFlag(X, Y, 0, 0, 0);
End;
End;
[/PHP]

What are the properties of TMMLocation?
  • Varrock West Bank has colors [60909, 4879485], which are the bankers and the floor.
  • We want to find both of these colors with tolerance of 10, thus Tolerances := [10, 10];
  • We want to find an area which has at least 50 yellow pixels (bankers) and at least 500 pixels of bank floor color, thus Counts := [50, 500];
  • Varrock West Bank is ~65 pixels wide and ~30 pixels high
  • If you don't want to use symbol or DTM finding, set Symbol := '' and DTM := -1

Note that the finding only works in approximately the same compass angle as in which the data was observed!

Naum

2009-11-30 17:13:24

Good work, I'll add some stuff about this in the BIG Post :).

For data collection, I would recommend setting the angle to perfect north (using the RS compass). That way everything is relative to one another.
Any other rules, marpis, that people should follow when adding/amending?

P.S Join! - http://www.villavu.com/forum/group.php?groupid=35

marpis

2009-11-30 17:15:49

From: Naum
Good work, I'll add some stuff about this in the BIG Post :).

For data collection, I would recommend setting the angle to perfect north (using the RS compass). That way everything is relative to one another.
Any other rules, marpis, that people should follow when adding/amending?

P.S Join! - http://www.villavu.com/forum/group.php?groupid=35


Hmm, not really. Except for 100 brightness of course.
Good that you pointed this out! :)

Coh3n

2009-12-01 15:22:25

I like it! :smile:

Do you want to have a separate function for each bank, or would it be better to have one function that loads a certain bank, and then another that walks to it? Just throwing an idea out there, let me know what you think.

Thanks,

Coh3n

marpis

2009-12-02 07:29:31

From: Coh3n
I like it! :smile:

Do you want to have a separate function for each bank, or would it be better to have one function that loads a certain bank, and then another that walks to it? Just throwing an idea out there, let me know what you think.

Thanks,

Coh3n


Function EnterBank(Bank: Integer): Boolean;

Loc_VEBank = 0;
Loc_VWBank = 1;
Loc_GEBank = 2;

The constants are found in Walking.SCAR

E: Oh, I may have misunderstood your question. The properties "With TMMLocation Do" will not be preloaded, but loaded every time EnterBank() is called, if that's what you meant? :p

Coh3n

2009-12-02 09:45:22

From: marpis
Function EnterBank(Bank: Integer): Boolean;

Loc_VEBank = 0;
Loc_VWBank = 1;
Loc_GEBank = 2;

The constants are found in Walking.SCAR

E: Oh, I may have misunderstood your question. The properties "With TMMLocation Do" will not be preloaded, but loaded every time EnterBank() is called, if that's what you meant? :p

Yes, that's what I meant. :smile: