Tails111
08-11-2007, 11:03 PM
Introduction
Hello, I am tails111, I am somewhat of a new scripter. I do have experience with VB 6 and 2005(8). I mainly script in RS for my little brother although I do enjoy the intellectual challenge. I have decided to make this tutorial about FindObjMulti because I have found it to be one of the most reliable ways to find a rock, or a tree, or even an NPC. It has never failed for me
Chapter 1: How it Works
FindObjMuti works by looking for 1 name or the text that appears at the top left corner of the RS screen, and looks for 3 colors with a tolerance. Unlike FindObj which uses 1 name and 1 color and I think a tolerance it won't store the X and Y coords. This is fixed by GetMousePos(x, y) and then using the Mouse function.
Chapter 2: How to Use it
FindObjMulti(Name, Color1, Color2, Color3, Tol) is the outline of it. This code is pretty self explanatory. I generally set the Name and Colors in the const section of my scripts. Here is a WORKING(as of 8/11/07) example on how it can be used in Runescape 2. This is in my Oak Chopper Script and a Snippet I made for finding the monks of etrana and taking the boat.
program LumbChopeSell;
{.include srl/SRL.scar}
const
Oak1 = 3694181; Oak2 = 2976862; Oak3 = 4023663; Tree = 'ak';
var FoundTree, tx, ty: Integer;
procedure ChopOaks;
Begin
FoundTree := 0; //This is my way of saying False for the FoundTree which is used to end the repeat
WriteLn('Attempting to Chop Oaks!');
repeat
If(FindObjMulti(Tree, Oak1, Oak2, Oak3, 10)) then // This is our FindObjMulti
begin
getmousepos(tx, ty); //Here is the GetMousePos
Mouse(tx, ty, 1, 1, True);
FoundTree := 1; // This is the True to the FoundTree which will tell the Repeat to stop
wait(2000 + Random(4000));
end;
until Not FoundTree = 1; // This actually ends the loop
end;
Begin
SetupSRL;
ActivateClient;
Repeat
ChopOaks;
Until(false);
end.
This is an extravagantly amazingly accurate way to find the tree and it won't stop until it does. Most people Frown upon it but it is rather simple to add a fail safe. Plus if you have your colors right you are pretty much okay. I have a FindDTM function to end the repeat in the main loop but I decided to leave this out just for tutorial sake.
Here is the other example using an NPC.
program Monk;
{.include srl/SRL.scar}
const Monk = 'onk'; Monk1 = 5419742; Monk2 = 8103123; Monk3 = 5532541; // Monk colors, their beards and name
var FoundMonk, tx, ty, TakeBoat: Integer; // I use tx, ty, you may use what ever x and y you want though.
procedure DeclareBMP; // It is the Take-Boat option when you right click the monk.
begin
TakeBoat := BitmapFromString2(False, 'aEBB6078DAA590510E03' +
'210844AF045B10FDD4DD7AFF23AD6393761343C3B6F3311A7 9104' +
'62262661ADAFB302979B8CA137E54784EC37907F22838126F 6F26' +
'29F82D0B5E1455EDE01310D282F764986FDC706F0A7E56654 2A6F' +
'DC334F0560BCAADEAA122D6BF8AA63C922E7A312BE94D58BB 28A0' +
'F87C6FCFBBBDD70DE33FB6A68BFB6FE9EEFEBC97D1CBF27FA EF88' +
'627CBF');
end;
procedure ClickMonk;
Begin
FoundMonk := 0; // I don’t use true and false, I use 1 and 0, 0 being false 1 being true.
Status('Attempting to find Monk!!');
repeat //This will make it repeat until it finds the monk
If(FindObjMulti(Monk, Monk1, Monk2, Monk3, 7)) then
begin
getmousepos(tx, ty);
Mouse(tx, ty, 1, 1, False);
FoundMonk := 1; //This is my way of saying found monk
wait(500 + Random(750));
end;
until FoundMonk = 1; // Will keep repeating until find's FoundMonk = 1
end;
procedure GoOnBoat;
begin
If(FindBitmap(TakeBoat, tx, ty)) Then
wait(1000 + Random(350));
Mouse(tx, ty, 4, 4, True);
end;
begin
SetupSRL;
ActivateClient;
DeclareBMP;
ClickMonk; //There is a way to merge the ClickMonk and GoOnBoat procedures, but I find it to not be as reliable.
GoOnBoat;
end.
This will find the Monks of Etrana on the dock at Port Sarim, obviously it is members only and it uses FindBitMap(much like FindObj but uses a small picture instead, that is for a later tutorial).
Chapter 3: Why Use it?
You should use FindObjMulti over FindObj because it checks for 3 colors not just 1, thus making it much more reliable, actually 300% more reliable :P.
Chapter 4: Common Misconceptions
Many people believe that FindObj and FindObjMulti and all the other FindObj commands look for 2D preset images.
I have also seen people believe that FindObj doesn't use colors.
Chapter 5: Conclusion
As I have said I love FindObj and Bitmaps, these are SRL functions but they still can be used after major updates! Maybe a little bit of modifying to colors. The world of programming or Scripting is endless. If you have any questions about this tutorial or any other ways of using FindObjMulti then reply to this thread. I wish to thank the community for helping me with some bugs I had while I was working on a script and the Developers of SRL for such a great peace of work, and last but not least, I wish to thank www.srl-forums.com for helping Scar and SRL stay running.
Hello, I am tails111, I am somewhat of a new scripter. I do have experience with VB 6 and 2005(8). I mainly script in RS for my little brother although I do enjoy the intellectual challenge. I have decided to make this tutorial about FindObjMulti because I have found it to be one of the most reliable ways to find a rock, or a tree, or even an NPC. It has never failed for me
Chapter 1: How it Works
FindObjMuti works by looking for 1 name or the text that appears at the top left corner of the RS screen, and looks for 3 colors with a tolerance. Unlike FindObj which uses 1 name and 1 color and I think a tolerance it won't store the X and Y coords. This is fixed by GetMousePos(x, y) and then using the Mouse function.
Chapter 2: How to Use it
FindObjMulti(Name, Color1, Color2, Color3, Tol) is the outline of it. This code is pretty self explanatory. I generally set the Name and Colors in the const section of my scripts. Here is a WORKING(as of 8/11/07) example on how it can be used in Runescape 2. This is in my Oak Chopper Script and a Snippet I made for finding the monks of etrana and taking the boat.
program LumbChopeSell;
{.include srl/SRL.scar}
const
Oak1 = 3694181; Oak2 = 2976862; Oak3 = 4023663; Tree = 'ak';
var FoundTree, tx, ty: Integer;
procedure ChopOaks;
Begin
FoundTree := 0; //This is my way of saying False for the FoundTree which is used to end the repeat
WriteLn('Attempting to Chop Oaks!');
repeat
If(FindObjMulti(Tree, Oak1, Oak2, Oak3, 10)) then // This is our FindObjMulti
begin
getmousepos(tx, ty); //Here is the GetMousePos
Mouse(tx, ty, 1, 1, True);
FoundTree := 1; // This is the True to the FoundTree which will tell the Repeat to stop
wait(2000 + Random(4000));
end;
until Not FoundTree = 1; // This actually ends the loop
end;
Begin
SetupSRL;
ActivateClient;
Repeat
ChopOaks;
Until(false);
end.
This is an extravagantly amazingly accurate way to find the tree and it won't stop until it does. Most people Frown upon it but it is rather simple to add a fail safe. Plus if you have your colors right you are pretty much okay. I have a FindDTM function to end the repeat in the main loop but I decided to leave this out just for tutorial sake.
Here is the other example using an NPC.
program Monk;
{.include srl/SRL.scar}
const Monk = 'onk'; Monk1 = 5419742; Monk2 = 8103123; Monk3 = 5532541; // Monk colors, their beards and name
var FoundMonk, tx, ty, TakeBoat: Integer; // I use tx, ty, you may use what ever x and y you want though.
procedure DeclareBMP; // It is the Take-Boat option when you right click the monk.
begin
TakeBoat := BitmapFromString2(False, 'aEBB6078DAA590510E03' +
'210844AF045B10FDD4DD7AFF23AD6393761343C3B6F3311A7 9104' +
'62262661ADAFB302979B8CA137E54784EC37907F22838126F 6F26' +
'29F82D0B5E1455EDE01310D282F764986FDC706F0A7E56654 2A6F' +
'DC334F0560BCAADEAA122D6BF8AA63C922E7A312BE94D58BB 28A0' +
'F87C6FCFBBBDD70DE33FB6A68BFB6FE9EEFEBC97D1CBF27FA EF88' +
'627CBF');
end;
procedure ClickMonk;
Begin
FoundMonk := 0; // I don’t use true and false, I use 1 and 0, 0 being false 1 being true.
Status('Attempting to find Monk!!');
repeat //This will make it repeat until it finds the monk
If(FindObjMulti(Monk, Monk1, Monk2, Monk3, 7)) then
begin
getmousepos(tx, ty);
Mouse(tx, ty, 1, 1, False);
FoundMonk := 1; //This is my way of saying found monk
wait(500 + Random(750));
end;
until FoundMonk = 1; // Will keep repeating until find's FoundMonk = 1
end;
procedure GoOnBoat;
begin
If(FindBitmap(TakeBoat, tx, ty)) Then
wait(1000 + Random(350));
Mouse(tx, ty, 4, 4, True);
end;
begin
SetupSRL;
ActivateClient;
DeclareBMP;
ClickMonk; //There is a way to merge the ClickMonk and GoOnBoat procedures, but I find it to not be as reliable.
GoOnBoat;
end.
This will find the Monks of Etrana on the dock at Port Sarim, obviously it is members only and it uses FindBitMap(much like FindObj but uses a small picture instead, that is for a later tutorial).
Chapter 3: Why Use it?
You should use FindObjMulti over FindObj because it checks for 3 colors not just 1, thus making it much more reliable, actually 300% more reliable :P.
Chapter 4: Common Misconceptions
Many people believe that FindObj and FindObjMulti and all the other FindObj commands look for 2D preset images.
I have also seen people believe that FindObj doesn't use colors.
Chapter 5: Conclusion
As I have said I love FindObj and Bitmaps, these are SRL functions but they still can be used after major updates! Maybe a little bit of modifying to colors. The world of programming or Scripting is endless. If you have any questions about this tutorial or any other ways of using FindObjMulti then reply to this thread. I wish to thank the community for helping me with some bugs I had while I was working on a script and the Developers of SRL for such a great peace of work, and last but not least, I wish to thank www.srl-forums.com for helping Scar and SRL stay running.