SRL Archive - OSR Help

ObjDTM walking


jman1208

2012-07-29 20:20:48

I've been using ObjDtm walking for my script and it seems to work well everywhere else but when its used in this certain area (LLeyta) it always either works,sometimes fails or clicks in the wrong spot. A lot of the time, it won't find the areas or find 1 then go through all the other ones and not click (Because of the WriteLN it will say point 1 point 2 point 3 then retry again because of a check i have elsewhere). Am i doing something wrong or is there a better way?


 procedure WalkToPassTree;
var
cx, cy: Integer;
begin



ObjDTM_Walk('12:74:5:1:7:107:41:1:7:116:53:1:7:108:66:1:7:43:117:1:7:85:146:3:19:70:19:82:3:71', 2, 100, 5, True);
writeLN('Starting our walk to PassTree Point 1');
flag;


ObjDTM_Walk('19:84:5:2:7:51:77:2:7:43:89:2:7:39:97:2:7:91:125:2:7:111:144:5:8:76:34:76:38:89:13:88:3:87', 2, 100, 5, True);
writeLN('Found Point 2');
flag;


ObjDTM_Walk('51:22:7:1:7:70:27:1:7:70:43:1:7:72:119:1:7:44:128:1:7:28:116:1:7:27:68:1:7:30:44:3:46:29:60:27:47:9', 2, 100, 5, True);
writeLN('Found Point 3');
flag;


ObjDTM_Walk('69:43:5:2:7:99:57:2:7:99:22:2:7:65:74:1:7:58:54:1:7:46:92:4:65:38:76:39:74:63:63:62', 2, 100, 5, True);
SetAngle(SRL_Angle_High);
MakeCompass('w');
writeLN('Found Point 4');
flag;
end;

Yes i know its ugly

P1ng

2012-07-29 20:29:06

Well, first of all it is going to WriteLn point 1 .. point 3 regardless of whether or not it finds the area.
Try making it
if ObjDTM_Walk(...) then
WriteLn(..);

putonajonny

2012-07-29 20:33:07

ObjDTM_Walk is a function, so use that to know whether it works:

procedure WalkToPassTree;
var
cx, cy: Integer;
begin
if (ObjDTM_Walk('12:74:5:1:7:107:41:1:7:116:53:1:7:108:66:1:7:43:117:1:7:85:146:3:19:70:19:82:3:71', 2, 100, 5, True)) then
writeLN('Starting our walk to PassTree Point 1');
flag;
if (ObjDTM_Walk('19:84:5:2:7:51:77:2:7:43:89:2:7:39:97:2:7:91:125:2:7:111:144:5:8:76:34:76:38:89:13:88:3:87', 2, 100, 5, True)) then
writeLN('Found Point 2');
flag;
if (ObjDTM_Walk('51:22:7:1:7:70:27:1:7:70:43:1:7:72:119:1:7:44:128:1:7:28:116:1:7:27:68:1:7:30:44:3:46:29:60:27:47:9', 2, 100, 5, True)) then
writeLN('Found Point 3');
flag;
if (ObjDTM_Walk('69:43:5:2:7:99:57:2:7:99:22:2:7:65:74:1:7:58:54:1:7:46:92:4:65:38:76:39:74:63:63:62', 2, 100, 5, True)) then
begin
SetAngle(SRL_Angle_High);
MakeCompass('w');
writeLN('Found Point 4');
end;
flag;
end;
Now it will only do the WriteLn if it works

jman1208

2012-07-29 20:39:25

Oh wow i'm so stupid i can't believe i forgot that ^^ Thanks