SRL Archive - OSR Help

Hey, having a few problems with RadialWalking


mxtrix

2012-02-03 06:06:40

Hey, in the progress of making a rock crab killer which collects charms which will be located here: http://i.imgur.com/g9up8.png I have looked up several Radial Walking tuts and have the following points (Start from the left dungeon icon)

Code:
1. RadialWalk(4148298, 308, 321, 50, 1, 1);
2. RadialWalk(4410447, 274, 286, 63, 1, 1);
3. RadialWalk(4673876, 254, 274, 39, 1, 1);

I am just wondering how to implement this into a script (I have tried the methods the tuts demonstrate but they do not seem to work. I have completed the attacking, looting and fail-safes for the script (The reason needed for the walk is that the crabs become non aggressive after ~8mins so walking away and back will reset that.

Cheers, Mxtrix it should be complete soon and will be released to the public

YoHoJo

2012-02-03 06:08:51

Instead of just using colors like you are now.
Use ACA to autocolor whatever color you wish, MM colors change A LOT.
http://www.youtube.com/watch?v=98wVrr6GwyU

Heavenzeyez1

2012-02-03 06:12:45

I suggest using RadialWalkTolerance.
if RadialWalkTolerance(9144715, 200, 260, 68, 0, 0, 30) then
begin
DoSomeThing;
end
else
begin
BackUpYourRWT;
end;
RadialWalkTolerance works really well. ;)
~Eerik.

mxtrix

2012-02-03 06:33:12

I have done that and edited that into the script however I am still getting an error relating to the walking (Thanks for your help btw :P) The script is below:

program CRABS;
{$i SRL/SRL.simba}
{$DEFINE SMART}

function STEP1: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.89, 1.37);

if not (FindColorsTolerance(arP, 3555393, MMX1, MMY1, MMX2, MMY2, 3)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
end;

function STEP2: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.00, 0.13);

if not (FindColorsTolerance(arP, 4213580, MMX1, MMY1, MMX2, MMY2, 1)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
Result := arC;
Writeln('AutoColor = ' + IntToStr(arC));
Break;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

function STEP3: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.55, 0.21);

if not (FindColorsTolerance(arP, 4805975, MMX1, MMY1, MMX2, MMY2, 2)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
Result := arC;
Writeln('AutoColor = ' + IntToStr(arC));
Break;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

procedure WalkToCrabs;
begin
Setrun(true); //this turns run on
for i:- 1 to 3
case RadialWalking of
1: RadialWalkTolerance(STEP1, 308, 321, 50, 5, 5, 20);
2: RadialWalkTolerance(STEP2, 274, 286, 63, 5, 5, 20);
3: RadialWalkTolerance(STEP3, 254, 274, 39, 5, 5, 20);
end;

begin
WalkToCrabs
end.


The error is as following: [Error] (100:7): Unknown identifier 'i' at line 99
Compiling failed.

BTW the code above is solely relating to walking to the crabs, I think I can make it do the opposite to walk away (The reason for this is to reset them)

EDIT: Implemented the colour tolerance (Hopefully it helps :P)

Daniel

2012-02-03 06:49:18

Don't forget to initialise the variable, I.

Also, your for..loop should be an equals (=), not a minus (-). ;)

mxtrix

2012-02-03 06:56:32

EDIT 3: Fixed most of it, now getting the error [Error] (109:5): Invalid number of parameters at line 108 Compiling failed. Here is the lastest version of the walking: http://pastebin.com/LuZqu4i8 . Hopefully now it is just something simple which is wrong

Cheers, Mxtrix looking at it now to see if I can figure out what is wrong