SRL Archive - Research & Development Lounge

2 "new" AutoColor Functions


Pure1993

2008-02-18 11:39:38

Well, while I was woking on my new guild miner, I needed an auto-color, first for the buildings in fally, and second for the rocks in the mining guild, for the existing function never picked the right rock, so I decided to quickly code my own. It is very reliable as far as I tested it (20/20 so far), and it is simple enough for others to understand. Now, the chances of this one going astray if you are in a wrong place are quite high, but my walking simply doesn't fail, so there is no need for me to change anything, but feel free, if you use this, to adjust it to your own needs. Well, without further ado, here is my Fally building color finder (on the minimap):

Function FindFallyBuildingColor: Integer;
var
FallyBuilding: Integer;
Begin
FallyBuilding := BitmapFromString(14, 12, 'beNpb27Fx7SgaeQg' +
'ApXY/AA==');
Begin
Result := AutoColorThis(FallyBuilding,50,mmx1,mmy1,mmx2,mmy2);
Writeln('FallyBuildingColor = ' +IntToStr(result));
End;
End;

That one was also pretty safe, the only problem is if you stand somewhere other than fally, because it has quite a big tolerance, but once again, my walking is never wrong. :)

Now, here is my mining guild mining rock finder:


var
x,y,MiningRockColor: Integer;
MineRockMDTM, MRDTMTol, MRDTMArea:Integer;
MineRockMP: TDTMPointDef;
MineRockSP: array[0..3] of TDTMPointDef;
MineRockDTMSkel: TDTM;

Procedure MiningRockPoints;
Begin
MineRockMP.x:= 657;
MineRockMP.y:= 86;
MineRockMP.areasize:= 1;
MineRockMP.areashape:= 0;
MineRockMP.color:= 6511200;
MineRockMP.tolerance:= 70;

MineRockSP[0].x:= 657;
MineRockSP[0].y:= 90;
MineRockSP[0].areasize:= 1;
MineRockSP[0].areashape:= 0;
MineRockSP[0].color:= 3089708;
MineRockSP[0].tolerance:= 70;

MineRockSP[1].x:= 654;
MineRockSP[1].y:= 85;
MineRockSP[1].areasize:= 1;
MineRockSP[1].areashape:= 0;
MineRockSP[1].color:= 4405568;
MineRockSP[1].tolerance:= 70;

MineRockSP[2].x:= 657;
MineRockSP[2].y:= 83;
MineRockSP[2].areasize:= 1;
MineRockSP[2].areashape:= 0;
MineRockSP[2].color:= 5063241;
MineRockSP[2].tolerance:= 70;

MineRockSP[3].x:= 660;
MineRockSP[3].y:= 86;
MineRockSP[3].areasize:= 1;
MineRockSP[3].areashape:= 0;
MineRockSP[3].color:= 6511200;
MineRockSP[3].tolerance:= 70;

MineRockDTMSkel.MainPoint:=MineRockMP;
MineRockDTMSkel.SubPoints:=MineRockSP;
MineRockMDTM:=AddDTM(MineRockDTMSkel);
End;

Function FindMiningRockColor: Integer;
Begin
For Z:=1 To 5 Do
Begin
MRDTMTol := MRDTMTol+3;
MRDTMArea := MRDTMArea+2;
if (DTMRotated(MineRockMDTM,x, y,MMX1,MMY1,MMX2,MMY2)) Then
begin
Result := GetColor(x,y);
Writeln('MiningRockColor = ' +IntToStr(Result));
Exit;
End;
End;
Writeln('Nothing Found');
Result := 0;
End;

Now, I might have forgotten to add a variable or two, because I copied this out of my script and edited the other stuff out to make this easier to understand, and to not reveal my little members or junior members script. :D

BTW: These might have already been created, and if so, then I am sorry, but I couldn't find working ones in the srl manual, so I just made some myself. I put them up here mainly for others to learn how DDTMs could be used, and to also gain a little experience myself in making Auto coloring functions. :)

EDIT: I just remembered, I need to credit Yoho, because wihtout his tut, I would never have gotten this far with DDTMs, sorry for only adding that now…

gerauchert

2008-02-18 11:48:01

looks nice :)

good work dude

Pure1993

2008-02-18 11:48:56

Thanks! *feels like it was worth the effort* :D

Wizzup?

2008-02-18 11:52:59

From: Stur Pure
Thanks! *feels like it was worth the effort* :D


Every experience is worth the effort.
Looks fine. :)

Pure1993

2008-02-18 12:05:00

Man I'm glad that that this is actually gaining some approval, I thought it would get some Medium comments, and then after three or four of those comments, this thread would be history. :D

Harry

2008-02-18 21:48:58

Ha, nice :)

bullzeye95

2008-02-18 23:08:51

The rock one looks good :)

About the Fally building color one… large areas like roads, building colors, etc. can be flawlessly autocolored using Tarajunky's method, which you can find in the autocoloring part of SRL. It's a pretty nice method… could be sped up a little, but it works perfectly. You might want to base yours off of his methods ;)

Pure1993

2008-02-19 09:58:46

Just plain typical! Here I thought my autocoloring works perfekt, now it starts to locate the red rock on the minimap in the fally mine, even though it should have a completely different tolerance in order to find it… I'll redo the different points, and maybe add something else, too, in order to make it safer. This is just plain messing with my script. :mad:
EDIT: The fally building still works perfectly, never had anything wrong up to this point… :D

stampede10343

2008-02-29 22:07:56

i think your Tolerance and area size for to do doesnt do anything, but im not exactly sure??
Function FindMiningRockColor: Integer;
Begin
For Z:=1 To 5 Do
Begin
MRDTMTol := MRDTMTol+3;//I dont see these variables used anywhere so
MRDTMArea := MRDTMArea+2;//idk if they work or not??
if (DTMRotated(MineRockMDTM,x, y,MMX1,MMY1,MMX2,MMY2)) Then
begin
Result := GetColor(x,y);
Writeln('MiningRockColor = ' +IntToStr(Result));
Exit;
End;
End;
Writeln('Nothing Found');
Result := 0;
End;

but anyways good job i could never get AutoColorThis to work well

NiCbaZ

2008-03-01 01:08:50

interesting functions i mite use with your credits if thats ok

Pure1993

2008-03-01 09:29:18

Sure, I wouldn't post this in the public test corner if you couldn't (of course only if you credit :D)

Naum

2008-03-01 11:54:35

Hey Stur Pure does this work in the fally guild mine?

Pure1993

2008-03-01 12:21:02

That is the place this was created for. dunno if it works anywhere else, or if it still works, because Runescape had quite a lot of updates in the laast couple of days, but yes, it should.
If it does not work, please leave a messsage, then I will update it as soon as I have time.