SRL Archive - MSI Suggestions

MSI_FindObject released in Objects.SCAR!


marpis

2009-12-12 14:49:52

How to use MSI_FindObject?

You need a variable "MyObject: TMSObject" and fill in all required information on it.

Var
MyObject: TMSObject;

With MyObject Do
Begin
UpText := 'hicken';
Option := 'ttack';
Colors := [123123, 321321];
Tol := 10;
Hue := 0.42;
Sat := 1.33;
FindAllColors := False;
W := 10;
H := 10;
Accuracy := 8;
ExcludeSelf := True;
LeftOnly := True;
Tries := 2;
Anim := True;
WaitToMove := True;
BadColors := [456456, 654654];
BadColorsTolerance := 15;
End;

The unusual properties of TMSObject

FindAllColors: Boolean;
Results True only if every color in MyObject.Colors was found on the object.

ExcludeSelf: Boolean;
Skip points in the box your character is (approximately) in. I will make the box as constants at some point :rolleyes:

Tries: Integer;
How many ATPAs will it go through searching for the right uptext max? If searching an object that moves a lot, this should be 1 or 2. If a static object that doesn't change place, can be 5+.

Accuracy: Integer;
How many pixels at least have to be found to return True?

WaitToMove: Boolean;
Wait until we have stopped moving after clicking the object?

Anim: Boolean;
Only accept objects that are constantly animating?


Parameters

MSI_FindObject(Obj: TMSObject; Action: fnct_ActionOptions): Boolean;

What is the latter parameter?
These are the values fnct_ActionOptions can get:
  • ClickLeft - Either clicks left or clicks right and chooses option, depending on MyObject.RightClickOnly
  • ClickRight - Obviously clicks right
  • Move - Move mouse on the object
  • Nothing - Just result True if found, no mouse movement
So if you want to find and in this case attack MyObject, call it like

If MSI_FindObject(MyObject, ClickLeft) Then
...

Now start writing the freaking skill functions already! :)

E:

How to set the info on TMSObject


I made a function MSI_GetObject in Object.SCAR, all MS object info will be loaded from there, so they're all nicely in the same place. It doesn't really take more than a minute to find the right settings for an object.