SRL Archive - SRL Archives

f2p Walker Project


Flyboy

2006-10-21 00:59:02

I want to see basic map walking implimented into srl. Since we can now teleport to Lumbridge castle we need to make walking scripts that can get you from Lumbridge to all the main points in the f2p land (p2p can come later) like
Lumpy –> Draynor Bank
Lumpy –> Al Kharid Bank
Lumpy –> Varock East Bank
Lumpy –> Varock West Bank
Lumpy –> Fally East Bank
Lumpy –> Fally West Bank
Lumpy –> Edgeville Bank
Lumpy –> Barbarian Village Mine
Lumpy –> Rimmington Courtyard

Lumpy –> NewSpotHere
Lumpy –> NewSpotHere
Lumpy –> NewSpotHere
Lumpy –> NewSpotHere

Please tell me other main spots we should add.

Since there are lots of scripts out there that have awsome proven walking already… lets not recreate the wheel and use that which is existing. :) So please ether post your proven working scripts that have walking in them, or if it's a private script please pm it to me and let me know not to share it.

Even if your script only has walking which does not come from Lumpy… its ok as we can piece the different sections together to make a bomb proof walker.

Yes this is a huge project and it is a lot bigger than I could ever do (or have time to do) so please everyone step up to the plate and contribute. We will need scripters, testers etc. so don't be shy :)

Edit:
Need help writing Map Walking Procedures? I posted my Map Walking Assistant here.



Current Version:
0.02 - added Lumby –> Varrock East Bank

history:
0.01 - Added Lumby –> Fally East Bank
LumbyWalker0.02.scar (14.1 KB, 4 views)

Flyboy

2006-10-21 00:59:30

Here is the progress Section.
Check here to see what still needs to be done:

[B]Locations:[/B]
[B][U] From To Source Status [/U][/B]
Lumpy --> Draynor Bank ChArMz Waiting for source code
Lumpy --> Al Kharid Bank YourNameHere NotStartedYet
Lumpy --> Varock East Bank Flyboy Posted below: Needs testing
Lumpy --> Varock West Bank [URL="http://www.villu-reborn.com/member.php?u=911"][COLOR=#006633]1337_macro[/COLOR][/URL] NotStartedYet
Lumpy --> Fally East Bank Flyboy Posted below: Needs testing
Lumpy --> Fally West Bank YourNameHere NotStartedYet
Lumpy --> Edgeville Bank YourNameHere NotStartedYet
Lumpy --> Barbarian Village Mine YourNameHere NotStartedYet
Lumpy --> Rimmington Courtyard YourNameHere NotStartedYet
[B]
AutoColorFinders:
[/B][B][U]procedure / function name Source Status [/U][/B]
function AutoPavedRoadColorFinder(ACPavedRoad: Integer): Boolean; YourNameHere NotStartedYet
function AutoGravelRoadColorFinder(ACGravelRoad: Integer): Boolean; YourNameHere NotStartedYet
function AutoRockColorFinder(ACRock: Integer): Boolean; YourNameHere NotStartedYet
function AutoWaterColorFinder(ACWater: Integer): Boolean; YourNameHere NotStartedYet


SoupyBastrd

2006-10-21 08:52:46

Sounds Like an Awesomely Harddd Project But Would be VERY helpful if someone wrote these….

_ChArMz

2006-10-21 08:57:01

Good Idea, I have walkers, that walk to draynor bank, and fally east already, I have had them a while now, maybe ill test and them pm them to you

SoupyBastrd

2006-10-21 09:05:30

Charmz How Bout You Post them in a this thread?

WT-Fakawi

2006-10-21 09:19:48

All my walkers need Water & Rock color.

Lumbridge to Falador Gate


//----------------------------------------------------------------------------//

Procedure LumbytoFallyGaty;
var DX, DY, RX, RY, LocalMark:integer;
begin

PerfectNorth;
// lets get out of lumbridge.
LinearRoadWalk(RoadColor, 90, 80, -1, 0);
Flag;
RadialRoadWalk(RoadColor, 370, 220, 72, 0, 1);
RadialRoadWalk(RoadColor, 370, 220, 60, 0, 1);

// walk until first Rock (in cabbage field).
MarkTime(LocalMark);
Repeat
if not(Loggedin) then break;
if(TimeFromMark(LocalMark) > 60000) then begin Logout; Exit; end;
RadialRoadWalk(RoadColor, 260, 380, 40, 1, -1);
FindRandoms;
Until FindColor(RX, RY, RockColor, MMX1+10, MMY1+10, MMX2-10, MMY2-10);

// get the rock out of the screen.
RadialRoadWalk(RoadColor, 200, 300, 60, -1, 1);
RadialRoadWalk(RoadColor, 200, 300, 60, -1, 1);

// walk until second Rock (at bifurcation).
MarkTime(LocalMark);
Repeat
if not(Loggedin) then break;
if(TimeFromMark(LocalMark) > 90000) then begin Logout; Exit; end;
RadialRoadWalk(RoadColor, 200, 350, 40, 1, -1);
FindRandoms;
Until FindColor(RX, RY, RockColor, MMX1+30, MMY1+30, MMX2-30, MMY2-30);

// One more extra step over bifurcation.
RadialRoadWalk(RoadColor, 200, 350, 60, 1, -1);

// Walk in small steps until rock at centre of screen.
MarkTime(LocalMark);
repeat
if not(Loggedin) then break;
if(TimeFromMark(LocalMark) > 120000) then begin Logout; Exit; end;
LinearRoadWalk(RoadColor, 265, 30, -1, 0);
FindRandoms;
until(FindColor(DX, DY, RockColor, MMCX-10, MMCY-10, MMCX+10, MMCY+10));

// Wild Step.
RadialRoadWalk(RoadColor, 180, 270, 70, -1, 0);

// Walk until behind Little Lake.
MarkTime(LocalMark);
Repeat
if not(Loggedin) then break;
if(TimeFromMark(LocalMark) > 60000) then begin Logout; Exit; end;
LinearRoadWalk(RoadColor, 270, 50, 1, 0);
FindRandoms;
until(FindColor(DX, DY, WaterColor, MMCX, MMY1, MMX2, MMCY));

RadialRoadWalk(RoadColor, 260, 280, 40, 1, 1);

// Walk up until Rare Tree symbol.
MarkTime(LocalMark);
Repeat
if not(Loggedin) then break;
if(TimeFromMark(LocalMark) > 60000) then begin Logout; Exit; end;
RadialRoadWalk(RoadColor, 400, 320, 60, -1, 0);
FindRandoms;
until(FindSymbol(x, y, 'tree'));

// Walk up until Lake appears at left of MiniMap.
MarkTime(LocalMark);
Repeat
if not(Loggedin) then break;
if(TimeFromMark(LocalMark) > 60000) then begin Logout; Exit; end;
RadialRoadWalk(RoadColor, 400, 320, 35, -1, 0);
FindRandoms;
until(FindColor(DX, DY, WaterColor, 578, 57, 592, 80));

Players[CurrentPlayer].Loc := 'Falador';
end;


Lumbridge to DraynorBank

//----------------------------------------------------------------------------//

Procedure LumbytoDrayny;
var RX,RY:integer;
begin

PerfectNorth;
RadialRoadWalk(RoadColor,85,95,60,1,1);
MarkTime(Mark);
repeat
if (not (Loggedin)) then Break;
FindRandoms;
RadialRoadWalk(RoadColor,400,270,60,0,1);
until ((TimeFromMark(Mark)>120000) or(FindSymbol(x,y,'furnace')));


MarkTime(Mark);
Repeat
if (not (Loggedin)) then Break;
RadialRoadWalk(RoadColor,260,380,40,1,-1);
FindRandoms;
Until ((FindColor(RX,RY,RockColor,MMX1+10,MMY1+10,MMX2-10,MMY2-10)) or (TimeFromMark(Mark)>120000));
FFlag(10);

RadialRoadWalk(RoadColor,200,300,60,-1,1);
RadialRoadWalk(RoadColor,200,300,60,-1,1);


MarkTime(Mark);
Repeat
if (not (Loggedin)) then Break;
RadialRoadWalk(RoadColor,200,350,40,1,-1);
FindRandoms;
Until ((FindColor(RX,RY,RockColor,MMX1+30,MMY1+30,MMX2-30,MMY2-30)) or (TimeFromMark(Mark)>120000));

MarkTime(Mark);
Repeat
if (not (Loggedin)) then Break;
FindRandoms;
RadialRoadWalk(RoadColor,150,320,30,1,-1);
Until((FindColor(x,y,BankColor,MMX1,MMY1,MMX2,MMY2)) or (TimeFromMark(Mark)>120000));
Mouse(X,Y,0,0,True);


MarkTime(Mark);
Repeat
if (not (Loggedin)) then Break;
Wait(1000);
Until ((DTM3Flag(DB1,DB2,DB3,True)) or (TimeFromMark(Mark)>120000));
if FawkiDebug then writeln('Bankers Found');
FFlag(10);
Players[CurrentPlayer].Loc:='Draynor';
end;


Flyboy

2006-10-21 14:10:44

Please keep an eye on the 2nd post as it will be updated giving the current status of the project.

Thanks guys for your contributions:
From: SoupyBastrd
Sounds Like an Awesomely Harddd Project But Would be VERY helpful if someone wrote these….

yes… thats what we are doing.
From: _ChArMz
Good Idea, I have walkers, that walk to draynor bank, and fally east already, I have had them a while now, maybe ill test and them pm them to you

That would be awsome!!! Thanks for that!!!
From: SoupyBastrd
Charmz How Bout You Post them in a this thread?

Lots of people spend hours on perfecting thier scripts for their own use. it often happens that if one releases their own script so many people use them that they are a sure ticket to banning… so please respect people if they want to only pass scripts privately.
From: WT-Fakawi
All my walkers need Water & Rock color.

those colors sure would make it simpler! I guess we will need auto color finding as well then :D

1337_macro

2006-10-21 14:17:09

Ill take the varrocks since i dont have much else to do

Pyro

2006-10-21 21:03:49

Ahhh one question. Do we have to use radial? *Waits for hate mail to appear*

bobert5696

2006-10-21 21:05:38

ill definately help, ill see what i can do

Ruroken

2006-10-21 21:40:02

i was working on one of these…..i'll see what i can do

Flyboy

2006-10-21 22:04:41

From: Pyro
Ahhh one question. Do we have to use radial? *Waits for hate mail to appear*

lol, personaly I think radials use too much math…. <*ducks from people swinging at him*> but they easy and convinent… with them anyone can make killer walking scirpts. in short, do whatever it takes to 'float your boat'

Mad Cow

2006-10-22 01:35:23

I could probarbly do the auto-colour finders. Could we make it a function like:

function AutoRoadColorFinder(RoadType : String; TheRoadColor : Integer) : Integer;

That would make it alot more compact but thats just my idea.

Flyboy

2006-10-22 03:53:59

From: Mad Cow
I could probarbly do the auto-colour finders. Could we make it a function like:

function AutoRoadColorFinder(RoadType : String; TheRoadColor : Integer) : Integer;

That would make it alot more compact but thats just my idea.


you rock!… I was just going to use something basic like this (untested). Still needs good bitmaps that will work on all worlds / color pallets that can be thrown at us.

//*****************************************************************************
// Returns true if found. Returns color via ACColor: Integer
// set FindWhat to:
// PavedRoad, GravelRoad, Water, Rock
//*****************************************************************************
function AutoColor(var ACColor: Integer; FindWhat: String): Boolean;
var
xx, yy, d, bmpObject: Integer;
begin
if( not LoggedIn )then Exit;

case Lowercase( FindWhat[1] )of
'p' : bmpObject := BitmapFromString(4, 4, 'z78DA333332753275' +
'32A31909000ABC1561');
'g' : ;
'w' : bmpObject := BitmapFromString(5, 5, 'z78DA3377B3347272' +
'341F64240074132374');
'r' : ;
end; //end of case

while (D < 85) do
begin
D := D + 5;
If FindBitMapToleranceIn( bmpObject, xx, yy, 580, 50, 600, 80, D )then
begin
ACColor := GetColor(xx, yy);
result := True;
break;
end;
end;
FreeBitmap( bmpObject );
end;

Wizzup?

2006-10-22 05:30:03

RadialRoadWalk is simply the best way to go when moving around the RS world. :)
No really any maths involved.. unless you are going to write one yourself? :confused:

Plain degrees aren't maths. :)

Flyboy

2006-10-22 16:29:42

From: Wizzup?
RadialRoadWalk is simply the best way to go when moving around the RS world. :)
No really any maths involved.. unless you are going to write one yourself? :confused:

Plain degrees aren't maths. :)

yes RRW is the best way to go. No math involved for the programer. The math I was refering to was the computer having to calculate a curved line for each pixel checked, vs looking along a straight line. Now that I have a 'modern' computer it does not matter much, but my old laptoop was crippled by the extra cpu work load. (yes my computer sucked ;))

Mad Cow

2006-10-23 03:46:00

From: Flyboy
yes RRW is the best way to go. No math involved for the programer. The math I was refering to was the computer having to calculate a curved line for each pixel checked, vs looking along a straight line. Now that I have a 'modern' computer it does not matter much, but my old laptoop was crippled by the extra cpu work load. (yes my computer sucked ;))


You're last PM didn't seem to come through :( could you send it again please

-Mad Cow

Flyboy

2006-10-25 04:51:30

Ok, thanks everyone for you contributions… here is a walker I wrote for Lumbridge –> Fally East Bank.

Features:
-Auto Color

This is still very rough and needs people to test it a little.

{
This is a draft version, so all debug lines are still in and it does not
look very pretty. Please run this and give feedback what happended. and how
you think it can be impoved.

Thanks.

Start on/near Lumbridge Castle steps
Start logged in or logged out... does not matter
set to Very Bright
use 32bit color
Set lines 17 - 19
}
program LumbyToDraynor;
{.include srl/srl.scar}

Const DebugMode= 2; //you can change this if you like...
Const CharFile = 'FlyboysChars'; //Set to file where your Players Data is stored

Boreas

2006-10-25 08:41:18

I'll test it.

Edit: got Line 349: [Error] (14643:46): Invalid number of parameters in script C:\DOCUME~1\Craig\LOCALS~1\Temp\LumbyWalker.scar

Line 349 and 350: StartPlayers(false, '');

My version just wants the boolean.

And I don't know what the file with player data is.

Flyboy

2006-10-25 18:01:37

From: Boreas
I'll test it.

Edit: got Line 349: [Error] (14643:46): Invalid number of parameters in script C:\DOCUME~1\Craig\LOCALS~1\Temp\LumbyWalker.scar

Line 349 and 350: StartPlayers(false, '');

My version just wants the boolean.

And I don't know what the file with player data is.

Thanks for trying to test… I guess it will only work with SRL 3.5 or 3.6 (not sure what number we are up to). If it does not work for you… it is because it is set up for the next release of SRL… this means developers who have the latest update will be able to run…. sorry for inconvinece but once you see the new player manager, you will know its worth waiting for!

Boreas

2006-10-25 23:28:00

I'll try again now that 3.5 is out.

Flyboy

2006-10-26 01:56:42

From: Boreas
I'll try again now that 3.5 is out.

sweet. look forward to hearing how it works for you

Mad Cow

2006-10-26 03:45:11

How about putting this in xMapWalk? Looks good though and it works well.

Mad Cow

Flyboy

2006-10-26 04:24:49

From: Mad Cow
How about putting this in xMapWalk? Looks good though and it works well.

Mad Cow

Thanks for feed back. Yes, xMapWalk would be appropriate. I did not want to start commiting anything till the new release was out and stable, as this is going to be a long process to get it all working right :D

I just finished the Lumbridge –> VEB :spot:

bullzeye95

2006-10-26 21:01:55

I just tested them both and I have to say they ROCK! Though a mousespeed of 3 is too fast. Oh and I made all the flag procedures humanflag(random(10)). It seems to be more like what a human would do.

Roberty Bob

2006-10-26 21:22:08

these are the challenges I like to code. Pity I have zero time for it these days. :(

Still when I get a moment, I think this is what I will be doing.
won't commit to particular walking route though, maybe work on some autocolors.
I've already got auto colors for anyone starting anywhere near fally east bank, might have to update it though.

I always thought an auto road color should be possible based on the skinny and continuous shape it takes up on the minimap… ie. it usually has a maximum thickness. There has to be an algorith to convince SCAR it has found the road, then just a color grab. At very least, it is a patch of uniform color unlike most things on the minimap which experience slight color flucuations

tarajunky

2006-10-26 22:21:17

Making the autoroadcolor should be pretty easy. I have one that I use, and it works okay. In order to optimize it one would need to know the range of possible roadcolor, and start with the median value.

For instance, let's say there are 255 possible colors, but the roadcolor would only be 126-172. So, if you could have a genericroadcolor of 149 with a tolerance of 23, it would match the roadcolor every time and exclude any color outside that range.

The way mine works is to scan the minimap left to right, top to bottom for a valid color within the range, then search for the exact same color at certain distances from that point. So you findcolor X, then check colors A, B, C, D. If you do this as if then if then if then, you will only do one calculation to exclude the vast majority of points. theoretically, if you're doing if…then if…then, you could increase the number of target points quite a bit (8? 10?) without increasing the computational overhead too much, since most incorrect pixels are eliminated during the first or second if…then statement anyway.


A           B

X

C D

Anyway, I'll just post what -I- use, and y'all can completely ignore it or attack it or laugh at it or whatever. :) (Remember, the color and tolerance are not optimized). This is really just a first try, and it works pretty well!

Program FindTheRoadColor;
{.include SRL\SRL.scar}
Function FindRoadColor:boolean;
var a,b,GenericRoadColor,TestColor:integer;
var found:boolean;
begin
a:=MMX1+25;
b:=MMY1+25;
GenericRoadColor:=5592411;
repeat
b:=b+1;
repeat
a:=a+1;
TestColor:=0;
if FindColorTolerance(x,y,GenericRoadColor,a,b,MMX2-5,MMY2-5,60) then
begin
a:=x;
TestColor:=GetColor(x,y);
if not(GetColor(x-5,y-5)=TestColor) then Found:=false else
if not(GetColor(x+5,y-5)=TestColor) then Found:=false else
if not(GetColor(x-5,y+5)=TestColor) then Found:=false else
if not(GetColor(x+5,y+5)=TestColor) then Found:=false else
begin
found:=true;
Result:=true;
RoadColor:=GetColor(x,y);
Writeln('Roadcolor = '+IntToStr(RoadColor)+' at '+inttostr(x)+','+inttostr(y));
exit;
end;
end else a:=MMX2-25;
Until a>=MMX2-25;
a:=MMX1+25;
Until b>=MMY2-25;
Writeln('Could not find RoadColor!');
Result:=false;
end;
begin
MarkTime(Mark);
FindRoadColor;
Writeln(inttostr(TimeFromMark(Mark)));
end.

Boreas

2006-10-26 23:08:18

Check out the color splitter attached here.

Use that to get you the red green and blue values of some road colors. Put those 3 ranges in the script attached to this post. It will display the range of colors. If that looks about right get the 3 medians and put them together with the rgb2color in the attached script. Hope it helps.

Roberty Bob

2006-10-26 23:42:15

thats good Tara, pretty much what I was going to try…

tarajunky

2006-10-27 04:21:29

Well, I took all the RoadColors posted in another thread here (like 50 total) and cruched all the numbers.

Red Range: 97-125 Median: 114 Average: 113
Green Range: 89-118 Median: 107 Average: 105
Blue Range: 89-117 Median: 107 Average: 105

114,107,107 gives a Color of 7039858, so that may be a good Generic color to use as a starting point.

The "minimum" colors of the group were…

5855841 97 90 89
5921121 97 89 90

The "maximum" color was…

7632509 125 118 116

I'm gonna try to figure out the max tolerance necessary next, :)

tarajunky

2006-10-27 04:39:00

Okay, so when I plugged some of those values into a simple program to test the minimum tolerance, I got some interesting results.


startcolor LowColorTol HiColorTol
7039858 31 18
6974066 29 20
6842479 25 24

So, the first color was the closest to the median. The minimum tolerance to recognize the lowest colors was 31, and to see the highest color was 18. The second color is the average. Again this is slightly skewed toward the higher color.

The color that most closely minimized the tolerance for both the high and low maximum colors was 6842479, which is 111,104,104 in RGB-speak.

So, I think using 6842479 as the generic color and a tolerance of 30 should work nicely. Do some testing people! LOL

tarajunky

2006-10-27 05:19:00

Well, my first attempt with the above color and tolerance did not work. The very first roadcolor that Runescape spit at me was 5263449, which is 89,80,80.

The very next color was 6908273, or 113,105,105. After that I recorded every color change after mapwalking, and then going upstairs and downstairs over and over again (accomplishes the same thing).

I noticed that under no circumstances would any R, G, or B value change by more than 3 units upon a color change. I think what's happening is that they take the current RoadColor R,G,B and simply add +/- random(3) to that value (they can also add Zero to any given component, leaving it the same).

Of course, there is still the issue of the original color it spit out. I used to use ScarScape for all my scripts, which fixed all the colors, including the RoadColor. There was a time when the roadcolor never changed in ScarScape. It was ALWAYS 5592411. Then about 8(?) months ago, there was an update that changed the roadcolors, or so I thought. Actually, what was happening was that when you logged in, the roadcolor was now ALWAYS 3816000. And then as soon as you went upstairs or had the minimap refresh, it automatically reverted back to 5592411. I think the same thing is happening here. When you first login, it will spit out a dark roadcolor, like 89,80,80. Then after the first refresh it will return to the normal color range, which is higher, like 100+ for all values.

So, if you want an autocolor procedure to detect the roadcolor, you will have to take this into account.

tarajunky

2006-10-27 05:49:17

Here's one more interesting tidbit that may be VERY helpful in finding roadcolors.

For any given value of R, G will ALWAYS be in the range R-5 to R-10. And for any given R, B will ALWAYS be in the range of R-6 to R-10;

So far, that relationship holds for ~100 data points.

If you click on random non-road colors pretty much anywhere else on screen this relationship falls flat on its face. This relationship ALSO holds true for the initial roadcolors when you first log in!!!

I think a simple way to check for Roadcolors would be to scan the minimap in a grid every 8 pixels or so (whatever the minimum width of most roads is). Then use this handy little color breaking function to see if each test color falls into the correct R-G-B relationship. If so, put the picked color into an array. Then do a secondary scan for a small box like I was using above for those colors in the array to make sure they are in contiguous chunks. I believe this strategy will give flawless roadcolor finding every time!!!

I'm not very good with arrays, but I'm sure some of the powers that be could bang something like this out in quick order.

BTW, here is the data I'm looking at. About 2/3 of these colors were posted by other people in a different thread, While the other 1/3 were picked by myself, which makes me confident that this relationship will hold.


RoadColor R G B
5855841 97 90 89
5921121 97 89 90
5987170 98 91 91
5987427 99 92 91
6052707 99 91 92
6118757 101 93 93
6119013 101 94 93
6184293 101 93 94
6184293 101 93 94
6315879 103 95 96
6381929 105 97 97
6447465 105 97 98
6513515 107 99 99
6644587 107 99 101
6710893 109 102 102
6711149 109 103 102
6776429 109 102 103
6842479 111 104 104
6842735 111 105 104
6842991 111 106 104
6908015 111 104 105
6974066 114 106 106
6974322 114 107 106
7039602 114 106 107
7039858 114 107 107
7105394 114 107 108
7105653 117 108 108
7105909 117 109 108
7171189 117 108 109
7171445 117 109 109
7171701 117 110 109
7171703 119 110 109
7171959 119 111 109
7236981 117 109 110
7236983 119 109 110
7237751 119 112 110
7302519 119 109 111
7303545 121 113 111
7303801 121 114 111
7368311 119 110 112
7434105 121 111 113
7434361 121 112 113
7500667 123 115 114
7500667 123 115 114
7500923 123 116 114
7565947 123 114 115
7565947 123 114 115
7632253 125 117 116
7632509 125 118 116
7697533 125 116 117
6908273 113 105 105
6908529 113 106 105
7040116 116 108 107
6776942 110 104 103
6776686 110 103 103
7039860 116 107 107
7105910 118 109 108
7106166 118 110 108
7238008 120 113 110
7434874 122 114 113
7566460 124 116 115
7434874 122 114 113
7566716 124 117 115
7434874 122 114 113
7237752 120 112 110
7238008 120 113 110
7435130 122 115 113
7566460 124 116 115
7566716 124 117 115
7434874 122 114 113
7238008 120 113 110
7434874 122 114 113
7237752 120 112 110
7434874 122 114 113
7237752 120 112 110


FIRST LOGIN COLORS
5263449 89 80 80
4145479 71 65 63
5065811 83 76 77
4605774 78 71 70
5461341 93 85 83
4211016 72 65 64
4277065 73 67 65

tarajunky

2006-10-27 06:39:14

Ok, last post tonite.

Here's a test version of the program I had in mind, minus the arrays. Apparently they are not necessary. :)

program New;
{.include SRL/SRL.scar}
type rgbcolor =record
red,green,blue:integer;
end;
var
color2:rgbcolor;


function color2rgb(color:integer):rgbcolor;
begin
result.red:=(color mod 256);
result.green:=((color/256) mod 256);
result.blue:=((color/256) / 256);
end;

function FindRoadColor:integer;
var TestColor,a,b,GenericRoadColor:integer;
var found:boolean;
begin
GenericRoadColor:=6842479;
Flag;
found:=false;
a:=MMX1;
b:=MMY1;
repeat
b:=b+6;
repeat;
a:=a+2;
If FindColorTolerance(x,y,GenericRoadColor,a,b,MMX2,MMY2,80) then
begin
TestColor:=GetColor(x,y);
Color2:=Color2rgb(Testcolor);
if (Color2.green<=Color2.Red-5) then if Color2.green>=(Color2.Red-10)
then if Color2.blue<=(Color2.Red-5) then if Color2.blue>=(Color2.Red-10) then
begin
if not(GetColor(a-1,b-1)=TestColor) then found:=false else
if not(GetColor(a-1,b+1)=TestColor) then found:=false else
if not(GetColor(a+1,b-1)=TestColor) then found:=false else
if not(GetColor(a+1,b+1)=TestColor) then found:=false else
if not(GetColor(a+1,b)=TestColor) then found:=false else
if not(GetColor(a,b+1)=TestColor) then found:=false else
if not(GetColor(a-1,b)=TestColor) then found:=false else
if (GetColor(a,b-1)=TestColor) then
begin
result:=TestColor;
RoadColor:=TestColor;
Writeln('RoadColor = '+IntToStr(RoadColor));
exit;
end;
end;
end else a:=MMX2;
until a>=MMX2;
a:=MMX1;
until b>=MMY2;
Writeln('Could not find Road Color!');
result:=0;
end;


begin
MarkTime(Mark);
FindRoadColor;
Writeln(IntToStr(TimeFromMark(Mark)));
end.

Works like a champ. Very quick, and hasn't missed yet. Perhaps the code could use a little polish tho, lol.

Boreas

2006-10-27 12:11:28

Great work. I have a really good feeling about this.

Yakman

2006-10-28 13:04:02

im making a walk from lumbridge to Al-Karid bank, iv almost finished it

i needed to copy RadialWalkEx and have it use tolerance, i also wrote a AutoWaterColor finder for lumbridge

so no-one else do Al-karid, im going it. :D

Flyboy

2006-10-28 13:59:45

Good job guys on the Autocolor… Do we have a stable version yet?

From: Yakman
im making a walk from lumbridge to Al-Karid bank, iv almost finished it

i needed to copy RadialWalkEx and have it use tolerance, i also wrote a AutoWaterColor finder for lumbridge

so no-one else do Al-karid, im going it. :D


Nice Yakman… it is yours :D

I just tested moving an army of 22 from all over the place (teleported to lumbridge) and then walked them to VEB. 100% success!!!!. I am posting the updated version which has a simple Army walk procedure setup.

I am also going to repost my WalkingScriptAssistant. I added a feature which will switch to the next player. I found it very helpful to use as I needed to bank stuff and get each player ready to auto in Varrock. I also added a feature which suppose to set all players with Location=XXXX to Active := true. For some reason it doesn't work :( so any brains out there who have done much with the new user forms please fix :)

Boreas

2006-10-28 14:22:58

From: Flyboy
Good job guys on the Autocolor… Do we have a stable version yet?


Here's what I have so far. It works fairly well for rock finding, however 1 time it got the road. So it will need to ignore the road color that is found first. Also it starts at the beginning of each range. If the ranges have a bell curve distribution I'll make it start in the middle and work its way out.

Is it worth making a separate autocolor project thread?

Flyboy

2006-10-28 14:49:05

for those who struggle to read scripts that have no formating standards :)
program New;
{.include srl\srl.scar}
type
rgbcolor =record
red,green,blue:integer;
end;
var
color,time1,time2,a,b,xr,yr,zr,i:integer;
{waitforme:boolean; }
color1:rgbcolor;
//---------SETUP------------
const
//should I wait for you to press ctrl
//after showing the number of colors
//before displaying them?
waitformetotal=true;
//Should I wait for you to press ctrl
//before displaying each color?
waitforme=false;
x1=62;{red min} x2=100;{red max}
y1=69;{green min} y2=98;{green max}
z1=59;{blue min} z2=97;{blue max}

function rgb2color(rgb:rgbcolor):integer;
begin
result:=(((rgb.blue*256)+rgb.green)*256)+rgb.red
end;





begin

{waitforme:=false;

x1:=63; //red start
y1:=75; //green start
z1:=61; //blue start
x2:=97; //red end
y2:=81; //green end
z2:=83; //blue end
}
xr:=x1-1;
yr:=y1-1;
zr:=z1-1;
writeln('there will be '+inttostr((x2-(x1-1))*(y2-(y1-1))*(z2-(z1-1)))+' colors');
if waitformetotal then
begin
repeat
wait(10);
until isfunctionkeydown(1);
end;
//cleardebug;
time1:=getsystemtime;
repeat
xr:=xr+1;
yr:=y1;
repeat
yr:=yr+1;
zr:=z1;
repeat
zr:=zr+1;
i:=i+1;
//writeln(inttostr(x)+' '+inttostr(y)+' '+inttostr(z));
color1.red:=xr;
color1.green:=yr;
color1.blue:=zr;
color:=rgb2color(color1);
//writeln(inttostr(color)+' '+inttostr(x)+' '+inttostr(y)+' '+inttostr(z)+' '+inttostr(i));

//status('Color = '+inttostr(color))
if waitforme then
begin
repeat
wait(10);
until isfunctionkeydown(1);
end;
until ((zr=z2) or (findcolor(a,b,(rgb2color(color1)),598,29,693,125)));
until ((yr=y2) or ((findcolor(a,b,(rgb2color(color1)),598,29,693,125))));
until ((xr=x2) or (findcolor(a,b,(rgb2color(color1)),598,29,693,125)));
mmouse(a,b,0,0);
time2:=getsystemtime;
writeln(inttostr(color)+' '+inttostr(xr)+' '+inttostr(yr)+' '+inttostr(zr)+' '+inttostr(i)+' '+inttostr(a)+' '+inttostr(b));
writeln(inttostr(time2-time1));
end.

tarajunky

2006-10-29 01:55:52

From: Flyboy
Good job guys on the Autocolor… Do we have a stable version yet?


The above version works flawlessly. I cleaned up the code a bit, fixed a couple of glaring bugs, and made one slight change by putting the Color2RGB functionality within the FindRoadColor function itself, so that it is pretty much self-contained. You do still need to declare the type… record stuff in the program header.

Here is the 'final' version…

program FindTheRoadColor;
{.include SRL/SRL.scar}
type rgbcolor =record
red,green,blue:integer;
end;

function FindRoadColor:integer; // By Tarajunky
var color2:rgbcolor;
var TestColor,a,b,GenericRoadColor:integer;
begin
GenericRoadColor:=6842479;
Flag;
a:=MMX1;
b:=MMY1;
repeat
b:=b+1;
repeat;
a:=a+1;
If FindColorTolerance(x,y,GenericRoadColor,a,b,MMX2,MMY2,80) then
begin
a:=x;
b:=y;
TestColor:=GetColor(x,y);
Color2.red:=(TestColor mod 256);
Color2.green:=((TestColor/256) mod 256);
Color2.blue:=((TestColor/256) / 256);
if (Color2.green<=Color2.Red-5) then if Color2.green>=(Color2.Red-10)
then if Color2.blue<=(Color2.Red-5) then if Color2.blue>=(Color2.Red-10) then
begin
if GetColor(a+2,b+2)=TestColor then
if GetColor(a+1,b+1)=TestColor then
if GetColor(a,b+2)=TestColor then
if GetColor(a+2,b)=TestColor then
if GetColor(a+2,b+1)=TestColor then
if GetColor(a+1,b+2)=TestColor then
if GetColor(a,b+1)=TestColor then
if GetColor(a+1,b)=TestColor then
begin
result:=TestColor;
RoadColor:=TestColor;
Writeln('RoadColor = '+IntToStr(RoadColor));
exit;
end;
end;
end else a:=MMX2;
until a>=MMX2;
a:=MMX1;
until b>=MMY2;
Writeln('Could not find Road Color!');
result:=0;
end;


begin
MarkTime(Mark);
FindRoadColor;
Writeln(IntToStr(TimeFromMark(Mark)));
end.

The only other tweak that you might be interested in is the search interval. Right now it's +1,+1. This will make it as accurate and reliable as possible. This does add a slight amount of lag, so if it is taking too long for your purposes then you could increase either of the two values. The original was +6,+2 and worked well.

Boreas

2006-10-31 08:51:33

Flyboy I tried testing lumby to VEB. The player data, form and setup worked well. It got lost though. Got lost by al karid gate, north of goblin south of chicken, couple other places I don't remember. The furthest it got was trying to go to the digsite. However Dankness's walk to chicken thing wasn't working either, so it's probably me. I'll try again when I get time.

Yakman

2006-10-31 11:52:09

iv finished my Lumbridge to alkarid bank walker. iv tested it a fair few times, it seems to work quite well.

i used the roadcolor finder from WT-Fakawi's Goblin Scheduler, i wrote the WaterColor finder myself.
to use it, stand where you have the bridge in the top right corner,

if the script fails, it WILL NOT LOGOUT, it will only exit and result false, the scripter can decide what to do, they could teleport back and try again, or just NextPlayer(False)

i copyed the function "RadialWalkEx" and added tolerance, "RadialWalkTolEx", im about to change it in SRL, so Flyboy, before you commit this project, replace every "RadialWalkTolEx" with "RadialWalkEx"

tarajunky

2006-10-31 20:28:07

From: Yakman
i copyed the function "RadialWalkEx" and added tolerance, "RadialWalkTolEx", im about to change it in SRL, so Flyboy, before you commit this project, replace every "RadialWalkTolEx" with "RadialWalkEx"


I posted a flawless roadcolor finder. Why would you ignore that and instead make roadwalking LESS color specific?

I'm writing a varrock east iron banker and the walking is just about perfect. I use radialroadwalk, but I also check the roadcolors myself since FindRoadColor is more reliable than the one in RRW. So, a typical 'step' looks like this to account for the colorchanges…

If not(FindMMColor(x,y,RoadColor) then FindRoadColor;
RRW(blah, blah,blah);

Ah well. Nobody appreciates my code. -sigh-

Flyboy

2006-11-01 01:53:00

Sorry guys, I have not abandoned the project, I am just very busy at the moment with work. Hope you all understand. Keep the code coming as there are still several locations that need walkers to.

Please make your walker return true only if you reached your destination otherwise just have it return false. We can leave it up to the scripter to decide how to handle a failure. And make sure all loops have a failsafe timer in them… so if any leg of the trip fails we don't have players stuck at dead ends clicking endlessly for hours…

tarajunky

2006-11-01 04:00:45

I use a recursive style walking procedure that seems to be pretty good.

In my case I want it to go from the mine to the bank via 2 way points.

Mine–>Clothes–>CrossRoad–>Bank

So, I use a recursive procedure as follows…

Procedure MineToBank;
begin
if not(LoggedIn) then exit;
if Players[CurrentPlayer].Loc='Bank' then exit else
begin
if Players[CurrentPlayer].Loc='CrossRoad' then
CrossRoadToBank else
begin
if Players[CurrentPlayer].Loc='Clothes' then
begin
ClothesToCrossRoad;
MineToBank;
end else
begin
if Players[CurrentPlayer].Loc='Mine' then
begin
MineToClothes;
MineToBank;
end else
if TryToFindMyself then MineToBank else
begin
repeat;
FTWait(4);
FindNormalRandoms
until not(LoggedIn);
end;
end;
end;
end;
end;

As you can see, rather than calling the walking procedures in order, I call them backwards. This way, you can verify where you are at for every position before walking, and if you get lost, it calls a function that will check your position against a variety of waypoints. If you find yourself then it starts right back where you left off, simply by calling the main procedure again and going through all the checks until it reaches your current position. I'm probably the only one that does it this way, so I thought I'd share just so others can see some different ideas.

Yakman

2006-11-01 06:26:42

From: tarajunky
I posted a flawless roadcolor finder. Why would you ignore that and instead make roadwalking LESS color specific?


i still used RadialRoadWalk for walking roads, i just used RadialWalkTolEx for walking aside the white minimap color which represents walls

EDIT: im making a walk to edgevill, its convinient that theres a river running from lumbridge to edgevill

Yakman

2006-11-09 17:51:44

made Walk to Edgevill

you need the dev version of SRL because i couldnt be bothered to copy RadialWalkEx again (yes i walk white walls again)

if you want to use it then go into MapWalk.scar and change RadialWalkEx so it has the tolerance parimeter, and change the FindColors into FindColorTolerances

PS. C'mon people, lets be more active, this is a great project! am I the only one who's working on it?!

tarajunky

2006-11-09 19:35:34

From: Yakman
C'mon people, lets be more active, this is a great project! am I the only one who's working on it?!


I'm working on some more autocolor routines. So far I have FindRoadColor, FindWaterColor, FindFallyRoadColor, FindLadderColor, and I'm going to work on FindBridgeColor and FindRockColor next. The various roadcolors keep changing, but the bridge, water, ladder, and rock all stay the same so you would only have to autodetect them once.

That should be plenty to navigate by. :)

WT-Fakawi

2006-11-10 07:01:53

One of the HouseColors is stable too

m0u53m4t

2006-11-24 12:28:06

Great. Im using the version of this for my bone picker that walks back to the chicken coop when it dies. Its fully modded and works great!

m0u53m4t

2006-11-24 13:47:28

I'll help. Ill work on whatever you guys need.