SRL Archive - OSR Help

help with backup DTM failsafe


westkevin12

2013-04-27 10:49:13

ok so i made some DTMs to walk from the yanil bank to the iron mining pit but sometimes it doesn't find them so i made backup DTMs to each of my DTM. now i need to know how to make simba use the backup DTM if it can't find the main DTM. please don't just "fix my script" i just want to know the order and how to make it go to a backup only if it couldn't find the main and i want to be able to do it on my own in the future. thankyou!



procedure WalkToPit;
var
aFound: Extended;
begin
if
FindDTMRotatedAlternating(gate, x, y, 560, 12, 720, 156, -15, 15, 2, aFound)
then

begin
writeln('walking to the pit')
mmouse(x,y,2,2);
clickmouse2(MOUSE_LEFT);
wait(8000);
writeln('25% there')
end;
if
FindDTMRotatedAlternating(betweentrees, x, y, 560, 12, 720, 156, -15, 15, 2, aFound)
then
begin
mmouse(x,y,2,2);
clickmouse2(MOUSE_LEFT);
wait(7000);
writeln('50% there')
end;
if
FindDTMRotatedAlternating(nearpit, x, y, 560, 12, 720, 156, -15, 15, 2, aFound)
then
begin
mmouse(x,y,2,2);
clickmouse2(MOUSE_LEFT);
wait(7000);
writeln('75% there')
end;
if
FindDTMRotatedAlternating(inpit, x, y, 560, 12, 720, 156, -15, 15, 2, aFound)
then
begin
mmouse(x,y,2,2);
clickmouse2(MOUSE_LEFT);
wait(7000);
writeln('100% we made it to the pit!')
end;
end;

rj

2013-04-27 11:38:09

Like this?

if not FindDTMRotatedAlternating(gate, x, y, 560, 12, 720, 156, -15, 15, 2, aFound) then
begin
// backup DTM
end;

westkevin12

2013-04-27 11:40:57

thanks i'll try it out! writing it like this will it click if it does find the main dtm?

rj

2013-04-27 11:45:19

From: westkevin12
thanks i'll try it out! writing it like this will it click if it does find the main dtm?


if it can't find the gate dtm then you should make it find another such as:

if not FindDTMRotatedAlternating(gate, x, y, 560, 12, 720, 156, -15, 15, 2, aFound) then
begin
if FindDTMRotatedAlternating(gate2, x, y, 560, 12, 720, 156, -15, 15, 2, aFound) then
begin
mmouse(x,y,2,2);
clickmouse2(MOUSE_LEFT);
while (isMoving) do
wait(100);
end;
end;

the Ismoving procedure is better, it detects if your moving instead of using static waits

westkevin12

2013-04-27 12:06:13

oh cool thanks for the ismoving command

Sk1nyNerd

2013-04-27 13:01:23

if FindDTM(Main) or FindDTM(Backup) then
begin
things
end;

perhaps this?

westkevin12

2013-04-27 13:28:15

From: ibot_dung11
if FindDTM(Main) or FindDTM(Backup) then
begin
things
end;

perhaps this?

I'll try this, atm with if not then if it is just compleatly skipping the clicking the DTMs but i think it is finding them because i am getting my debug messages

Sk1nyNerd

2013-04-27 13:57:35

if ur searching the mainscreen or minimap try using the MSX1, MSY1, MSX2, MSY2 or MMX1, MMY1, MMX2 MMY2 for your searching parameters. those are built in and might make your search better if you messed up on your searching from to points but as you said it seems to be finding them.do you need ; after writeln functions??