SRL Archive - Test corner

Function FindDaVarrockRoadColor(MaxTol:Integer):Integer;


Pentti

2007-06-04 12:27:33

Function FindDaVarrockRoadColor(MaxTol:Integer):Integer;

Testers will be needed!
Hey, due to new Varrock Road Color I made a new function that will get the new road color. This will be in next update of my Multi City Miner & Banker if it works for most of people and most of the time.

This should find Varrock road color from 20 to 150 milliseconds.

I need people to test this so I can be sure it works if Im going to add it in next update of my script.

So please test this in Varrock, and tell me if it will find the road color!
(Also you can post the times how long it takes not to find it)

Settings:
  • Runescape brigntess set to maxium:
  • Screen set to 32bits
program New;
{.include srl/srl.scar}
var
VRoad:array[0..3]of array[0..2] of Integer;
VRoadColor:Integer;

Time,Average,Times:Integer;

procedure VRoadBMP;
begin
VRoad[0][0] := BitmapFromString(14, 4, 'z78DA3330A01530B73037357' +
'3A39CA4B599D40500DD144429');
VRoad[0][1] := BitmapFromString(8, 7, 'z78DA33302007985B989B9AB9' +
'E12787937AE20100B58F4573');
VRoad[0][2] := BitmapFromString(4, 9, 'z78DA3330C007CC2DCC4DCDDC' +
'20E46016C7040070AA2B83');

VRoad[1][0] := BitmapFromString(14, 4, 'z78DA3330A015B070B6B0B03' +
'0A29CA4B599D40500C39443F9');
VRoad[1][1] := BitmapFromString(8, 7, 'z78DA3330200758385B585818' +
'E12787937AE2010095AF4537');
VRoad[1][2] := BitmapFromString(4, 9, 'z78DA3330C0072C9C2D2C2C8C' +
'20E46016C70400685A2B67');

VRoad[2][0] := BitmapFromString(14, 4, 'z78DA3330A01530753235373' +
'5A29CA4B599D40500154C42F1');
VRoad[2][1] := BitmapFromString(8, 7, 'z78DA33302007983A999A9B1A' +
'E12787937AE20100BBC643ED');
VRoad[2][2] := BitmapFromString(4, 9, 'z78DA3330C0074C9D4CCD4D8D' +
'20E46016C7040026C82ACD');

VRoad[3][0] := BitmapFromString(14, 4, 'z78DA3330A0153073337331' +
'33A19CA4B599D4050070834501');
VRoad[3][1] := BitmapFromString(8, 7, 'z78DA3330200798B999B9989' +
'9E02787937AE201006DD64681');
VRoad[3][2] := BitmapFromString(4, 9, 'z78DA3330C007CCDCCC5CCC4' +
'C20E46016C70400A91A2C01');
end;

Function FindDaVarrockRoadColor(MaxTol:Integer):Integer;
var
TI,i1,i2,lTol,Ax,Ay,TempColor: Integer;
begin
if(Not(LoggedIn))then
Exit;
for i2:= 0 to 2 do
begin
repeat
for i1:= 0 to 3 do
begin
TI:=GetSystemTime;
if(FindBitmapToleranceIn(VRoad[i1][i2],Ax,Ay,MMX1+22,MMY1,MMX2,MMY2,lTol)) then
begin
TempColor:=GetColor(Ax+1, Ay+1);
MoveMouse(Ax+1,Ay+1)
if(TempColor>5000000)and(TempColor<9000000)then
begin
Result:=TempColor
Writeln('Varrock Road Color = '+inttostr(Result))
Exit;
end;
end;
Writeln('VRoad['+inttostr(i1)+']['+inttostr(i2)+'] - Tol: '+inttostr(lTol)+' - '+inttostr(GetSystemTime-TI)+'ms')
lTol := lTol + 2;
end;
until (lTol >= MaxTol);
lTol:=0
end;
Writeln('Varrock Road Color was not found.')
end;

begin
SetUpSRL;
VRoadBMP;
repeat
ClearDebug;
Time:=GetsystemTime;
VRoadColor:=FindDaVarrockRoadColor(16)
Times:=Times+1
Average:=GetSystemTime-Time+(Average/Times)
Writeln('Find: '+Inttostr(GetSystemTime-Time)+'ms')
Writeln('Average time: '+inttostr(Average)+'ms')
wait(1000)
until(IsFKeyDown(5))
end.


Thanks, I apperciate if you will test this!!!

JAD

2007-06-04 14:45:24

Hmm… Wizzup?'s works perfectly fine ;)

nielsie95

2007-06-04 15:03:57

This works for me. Avarage around 60ms :)

Pentti

2007-06-04 15:06:10

From: JAD
Hmm… Wizzup?'s works perfectly fine ;)

Man, Wizzup's one sometimes gets the brown roadcolor, I need the grey one. :D
And mine works faster I think. :D
From: nielsie95
This works for me. Avarage around 60ms :)

Cool! Thanks for testing it man! :D

JAD

2007-06-04 18:38:59

Pentti. I'm going to use your Road bitmaps in my varrock road color finding function for my new script if that's ok with you? I'm to lazy to make my own.. And your BMPs seem to work good! :)

YoHoJo

2007-06-05 00:00:47

Wtf JAD?
Your personality just uber changed from the last post…

Pentti

2007-06-05 02:50:27

From: JAD
Pentti. I'm going to use your Road bitmaps in my varrock road color finding function for my new script if that's ok with you? I'm to lazy to make my own.. And your BMPs seem to work good! :)

Alright, It's ok for me.
From: YoHoJo
Wtf JAD?
Your personality just uber changed from the last post…

Lol, now he probably tested it and saw how it worked. :D

Wizzup?

2007-06-05 03:02:29

Nice,
However JAD, after I made the VarrockEastRoadColor, Nielsie discovered it works
anywere, in draynor, in falador, etc. :p

SKy Scripter

2007-06-05 03:13:40

well, instead of all these road color finders… make your own by…

KYAB :p

Say like you start in a bank, well all you have to do is get the Pos
Where the road is then Hah! you got the Color :p


But! i like… Very nice :)

Pentti

2007-06-05 03:14:09

From: Wizzup?
Nice,
However JAD, after I made the VarrockEastRoadColor, Nielsie discovered it works
anywere, in draynor, in falador, etc. :p

Thanks!
Thats why I need this function for my script because yours sometimes gets the brown road color. :D

Also, I tried this in Lumbridge, I raised tolerance and it found the "normal"-roadcolor too (And pretty fast). :D

From: SKy Scripter
well, instead of all these road color finders… make your own by…

KYAB :p

Say like you start in a bank, well all you have to do is get the Pos
Where the road is then Hah! you got the Color :p


But! i like… Very nice :)

Thanks!
But how about non-SRL members? They don't have KYAB! :D

JAD

2007-06-05 10:10:47

Lol. I didn't even test Wizzup?'s before, I just thought that if Wizzup? (The almighty god of scripting :p) made a FindVarrockRoadColor, that there didn't need to be another one made :p

I did test this one though and it works pretty good! You should REALLY REALLY Learng standards though Pentti so other people can read your scripts :p

Anyways, mine works good to with your bitmaps, so thanks Pentti. And my attitude didn't change at all.. I just thought that Wizzup?'s would work perfectly fine, (which it does, but on all roads) so I thought that this one wasn't going to be used much.

Anyways, thanks for the bitmaps Pentti :)

Wizzup?

2007-06-05 13:00:17

From: JAD
Lol. I didn't even test Wizzup?'s before, I just thought that if Wizzup? (The almighty god of scripting :p) made a FindVarrockRoadColor, that there didn't need to be another one made :p

I did test this one though and it works pretty good! You should REALLY REALLY Learng standards though Pentti so other people can read your scripts :p

Anyways, mine works good to with your bitmaps, so thanks Pentti. And my attitude didn't change at all.. I just thought that Wizzup?'s would work perfectly fine, (which it does, but on all roads) so I thought that this one wasn't going to be used much.

Anyways, thanks for the bitmaps Pentti :)


BTW: It works perfectly for the Varrock Roads too.. I use it in VEM…

JAD

2007-06-05 13:10:09

From: Wizzup?
BTW: It works perfectly for the Varrock Roads too.. I use it in VEM…


Oh it does? OK :p I may use that then if mine doesn't work out to good.

Pentti

2007-06-05 13:23:31

From: JAD
Lol. I didn't even test Wizzup?'s before, I just thought that if Wizzup? (The almighty god of scripting :p) made a FindVarrockRoadColor, that there didn't need to be another one made :p

I did test this one though and it works pretty good! You should REALLY REALLY Learng standards though Pentti so other people can read your scripts :p

Anyways, mine works good to with your bitmaps, so thanks Pentti. And my attitude didn't change at all.. I just thought that Wizzup?'s would work perfectly fine, (which it does, but on all roads) so I thought that this one wasn't going to be used much.

Anyways, thanks for the bitmaps Pentti :)

Alright.

And what's wrong with my standards?! Or maybe there's something wrong in your eyes, so maybe you should get glasses on your eyes or something? :D

Sumilion

2007-06-05 13:24:54

From: Pentti
Alright.

And what's wrong with my standards?! Or maybe there's something wrong in your eyes, so maybe you should get glasses on your eyes or something? :D


If your going by the 'official' kait standards, then somethings wrong with them .. ;)

Pentti

2007-06-05 13:29:06

From: Sumilion
If your going by the 'official' kait standards, then somethings wrong with them .. ;)

Umm… Alright. But I'm doing it by my way, i like it that way. :D

JAD

2007-06-05 13:34:30

Wow!!! Pentti! After indenting your code properly, I just figured out; you actually know how to script scar! lol :p :


Function FindDaVarrockRoadColor(MaxTol:Integer):Integer;
var
TI,i1,i2,lTol,Ax,Ay,TempColor: Integer;
begin
if(Not(LoggedIn))then
Exit;
for i2:= 0 to 2 do
begin
repeat
for i1:= 0 to 3 do
begin
TI:=GetSystemTime;
if(FindBitmapToleranceIn(VRoad[i1][i2],Ax,Ay,MMX1+22,MMY1,MMX2,MMY2,lTol)) then
begin
TempColor:=GetColor(Ax+1, Ay+1);
MoveMouse(Ax+1,Ay+1)
if(TempColor>5000000)and(TempColor<9000000)then
begin
Result:=TempColor
Writeln('Varrock Road Color = '+inttostr(Result))
Exit;
end;
end;
Writeln('VRoad['+inttostr(i1)+']['+inttostr(i2)+'] - Tol: '+inttostr(lTol)+' - '+inttostr(GetSystemTime-TI)+'ms')
lTol := lTol + 2;
end;
until (lTol >= MaxTol);
lTol:=0
end;
Writeln('Varrock Road Color was not found.')
end;

begin
SetUpSRL;
VRoadBMP;
repeat
ClearDebug;
Time:=GetsystemTime;
VRoadColor:=FindDaVarrockRoadColor(16)
Times:=Times+1
Average:=GetSystemTime-Time+(Average/Times)
Writeln('Find: '+Inttostr(GetSystemTime-Time)+'ms')
Writeln('Average time: '+inttostr(Average)+'ms')
wait(1000)
until(IsFKeyDown(5))
end.

Now isn't that easier on the eyes? Lol, I know, I have no life :p

Pentti

2007-06-05 13:39:26

From: JAD
Wow!!! Pentti! After indenting your code properly, I just figured out; you actually know how to script scar! lol :p :


Function FindDaVarrockRoadColor(MaxTol:Integer):Integer;
var
TI,i1,i2,lTol,Ax,Ay,TempColor: Integer;
begin
if(Not(LoggedIn))then
Exit;
for i2:= 0 to 2 do
begin
repeat
for i1:= 0 to 3 do
begin
TI:=GetSystemTime;
if(FindBitmapToleranceIn(VRoad[i1][i2],Ax,Ay,MMX1+22,MMY1,MMX2,MMY2,lTol)) then
begin
TempColor:=GetColor(Ax+1, Ay+1);
MoveMouse(Ax+1,Ay+1)
if(TempColor>5000000)and(TempColor<9000000)then
begin
Result:=TempColor
Writeln('Varrock Road Color = '+inttostr(Result))
Exit;
end;
end;
Writeln('VRoad['+inttostr(i1)+']['+inttostr(i2)+'] - Tol: '+inttostr(lTol)+' - '+inttostr(GetSystemTime-TI)+'ms')
lTol := lTol + 2;
end;
until (lTol >= MaxTol);
lTol:=0
end;
Writeln('Varrock Road Color was not found.')
end;

begin
SetUpSRL;
VRoadBMP;
repeat
ClearDebug;
Time:=GetsystemTime;
VRoadColor:=FindDaVarrockRoadColor(16)
Times:=Times+1
Average:=GetSystemTime-Time+(Average/Times)
Writeln('Find: '+Inttostr(GetSystemTime-Time)+'ms')
Writeln('Average time: '+inttostr(Average)+'ms')
wait(1000)
until(IsFKeyDown(5))
end.

Now isn't that easier on the eyes? Lol, I know, I have no life :p

Umm… What you did is you added one space in every line. Hmmh…

Sumilion

2007-06-05 13:42:43

From: JAD
Wow!!! Pentti! After indenting your code properly, I just figured out; you actually know how to script scar! lol :p :


Function FindDaVarrockRoadColor(MaxTol:Integer):Integer;
var
TI,i1,i2,lTol,Ax,Ay,TempColor: Integer;
begin
if(Not(LoggedIn))then
Exit;
for i2:= 0 to 2 do
begin
repeat
for i1:= 0 to 3 do
begin
TI:=GetSystemTime;
if(FindBitmapToleranceIn(VRoad[i1][i2],Ax,Ay,MMX1+22,MMY1,MMX2,MMY2,lTol)) then
begin
TempColor:=GetColor(Ax+1, Ay+1);
MoveMouse(Ax+1,Ay+1)
if(TempColor>5000000)and(TempColor<9000000)then
begin
Result:=TempColor
Writeln('Varrock Road Color = '+inttostr(Result))
Exit;
end;
end;
Writeln('VRoad['+inttostr(i1)+']['+inttostr(i2)+'] - Tol: '+inttostr(lTol)+' - '+inttostr(GetSystemTime-TI)+'ms')
lTol := lTol + 2;
end;
until (lTol >= MaxTol);
lTol:=0
end;
Writeln('Varrock Road Color was not found.')
end;

begin
SetUpSRL;
VRoadBMP;
repeat
ClearDebug;
Time:=GetsystemTime;
VRoadColor:=FindDaVarrockRoadColor(16)
Times:=Times+1
Average:=GetSystemTime-Time+(Average/Times)
Writeln('Find: '+Inttostr(GetSystemTime-Time)+'ms')
Writeln('Average time: '+inttostr(Average)+'ms')
wait(1000)
until(IsFKeyDown(5))
end.

Now isn't that easier on the eyes? Lol, I know, I have no life :p


Yes but you left function with a capital =\

JAD

2007-06-05 13:43:10

From: Pentti
Umm… What you did is you added one space in every line. Hmmh…


No. I just put 2 spaces after begins/repeats, 2 spaces back for untils/ends and 2 spaces after a then without a begin after it. :p


Edit: Summillion. I thought because Wizzup? does capital bold words, its ok :p

I don't do capitals on those, I just indented his code properly. I find indenting the only really important part of standards though.

neG

2007-06-06 09:36:52

If Wizzup? stuck bananas up his nose, would that make it ok to do so JAD? :P

back on topic, it worked perfect for me pentii.
Found it 100% and <70ms each time.

JAD

2007-06-06 09:45:52

From: neG
If Wizzup? stuck bananas up his nose, would that make it ok to do so JAD? :P

back on topic, it worked perfect for me pentii.
Found it 100% and <70ms each time.


I don't see anything wrong with sticking bananas up your nose as long as Wizzup? does it.. :p

Pentti

2007-06-06 10:11:22

From: neG
back on topic, it worked perfect for me pentii.
Found it 100% and <70ms each time.

Alright, cool. Thanks for tesing it!

JAD

2007-06-06 10:17:51

From: Pentti
Alright, cool. Thanks for tesing it!


Well Pentti, I'm going to be the first one to use it in a script! :) Works great for me, so I'm using it in my new super duper top secret, under cover, on the low key script :p