SRL Archive - OSR Help

which walking method?


imscaredtolosemymain

2012-02-29 11:13:20

Hi,

very nooby at this, just trying to do a first script to learn how to do stuff.

I am trying to do a jadinko tracker, which has to go from the start burrow, through the various search bushes, to attack the final bush, in order to get the vine drops for making potions. (More to learn than to get the stuff, as i have already spent hours more than it would take to simply go out and do it. )

So far i have:

program jadinkotracker;
/////////////////////WRITTEN BY Imscaredtolosemymain////////////////////////

/////templates and ideas borrowed from ryguys ape atoll//////

////////////////////////////VERSION 1.00////////////////////////////////
{$DEFINE SMART}
{$DEFINE SRL5}
{$i SRL/srl.simba}

var
x, y, Lightpatch1, Jungleplant1, dungeonarrow, hole, lightpatch2, jungleplant2,
lightpatch3, bush, startburrow, timebegan, startingxp: integer;

aFound: extended;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active:=True;
end;

////////////////////DO NOT TOUCH BELOW THIS LINE/////////////////////////



procedure SetDTMs;
begin
lightpatch1 := DTMFromString('mlwAAAHicY2dgYChiguB4IM4E4kIgbgDiSUAcAZR3AeI8kDogzgHiOCAOAOKtm+oZDJOkwPjSmRUM7ZMWwDE/UB4XZsSDoQAAGYoQ/A==');
JunglePlant1 := DTMFromString('mlwAAAHicY2dgYHBnZGDwAGJfIHYEYmcgDgRifyC+BpQ/BcS3GCDsy1D6ChAHlAoyBFUKMYTVCTH4FQsyxHWKgHFSvygDP1AeF2bEg6EAAIn7DrM=');
DungeonArrow := DTMFromString('mlwAAAHicY2dgYDBjYmCwB2IbILYCYhMgNoLiIqB8DhAXAHE5FMPE/rpKA0lGFBwDJMV4ORn4gTQuzIgHQwEA3BYHDA==');
hole := DTMFromString('mlwAAAHicY2dgYJAAYh4gFgRiDSDWBGJJqPhJIL4ExHuh+CoQXwTifUDs46LE4OeuzJAQrs3QPjGIoXNSMIOtKSeDpjIbAz9QHhdmxIOhAACY6gyZ');
Lightpatch2 := DTMFromString('mwQAAAHic42RgYJjAxMDQxQShpwHxDCieBMR9QNwBxF5AdS5A7AzFnkDsB8RBUOwNxCeOFzKs3hXCsGiFD8Pa1X4MZ491MqxdXgKmV64sZJg1P4qBH6iOEGYkAsMBAG2ZGKk=');
JunglePlant2 := DTMFromString('mKgEAAHic42NgYNBhhGBjIDYAYiMg1gViDSBWgYprQ8VAbH0gVgLiJqDeOiBuAeJ2IO6B4m4g7gDiLiCuguI+KG4G4pTJogypU0QZ4ntEGJImijAEVQoy+BULMHjnCzB45fIzzF7ozuCeyQ/GEU1CDKG1QgzpM0QZ+IF6ycGMZGJUAAAo7RgH');
Lightpatch3 := DTMFromString('mrAAAAHic42BgYChiYmCoAeJqIC4D4mIgLoDiUiDWAarRAGJdIDYCYjMg1gNiTah4w2RnhvIWbYbGfn2Gqm57hoJ2O4ZKoFjlDCOGRiDmB6rBhxkJYBgAAIvlD7k=');
Bush := DTMFromString('m6wAAAHic42ZgYNjFyMCwCYi3MULYe4F4BxDvAeLDQHwEiI8C8QEg7gGq7wLiNijuAOJmIG6FsicA8TQgng2SnxzK4OynyGDtIs9gZCXFoG4gyGBoKcVg46LKYGAhwWBkLcFg4SjLYO4oxcAPVE8sZiQBIwEAQyUV3Q==');
StartBurrow := DTMFromString('mwQAAAHic42RgYPBkZGDwgWIQ2wWIbYDYA4iDoNiYAYLNoNgOiPWAWAeIDYDYAoh5eXlRcE+1H0NvuT/DxIZAhtJ0R4aWEi8GfqA6QpiRCAwHAH0LDBA=');
end;



procedure FreeDTMs;
begin
FreeDTM(lightpatch1);
FreeDTM(JunglePlant1);
FreeDTM(DungeonArrow);
FreeDTM(hole);
FreeDTM(Lightpatch2);
FreeDTM(Jungleplant2);
FreeDTM(Lightpatch3);
FreeDTM(Bush);
FreeDTM(StartBurrow);
end;



procedure Report;
var
Exp, ExpHr, TimeRan: integer;
begin
TimeRan := (1+((GetSystemTime - TimeBegan) / 1000));
Exp := (GetXPBarTotal - StartingXP);
ExpHr := Round((Exp * 3600) / (TimeRan));
WriteLn('Time: ' + TimeRunning);
WriteLn('We have gained ' + IntToStr(Exp) + ' Hunter Experience!');
WriteLn('We are gaining ' + IntToStr(ExpHr) + ' Hunter Experience per Hour!');
end;




Function Antiban: Boolean;
var
i: Integer;
begin
if not LoggedIn then Exit;
//AreaCheck;
i := Random(150);
case i of
1:
begin
RandomRClick;
Result := True;
end;
2:
begin
RandomMovement;
Result := True;
end;
3:
begin
HoverSkill('Hunter', False);
Result := True;
end;
end;

Wait(RandomRange(250,350));
end;



procedure Findstartburrow;
begin
if FindDTM(startburrow, x, y, MSX1, MSY1, MSX2, MSY2)then
Mouse(x, y, 5, 5, True);
Wait(2000 + random(100));
end;


procedure movetofirstplant;
begin
if FindDTMRotated(lightpatch1, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound)then
//if FindDTM(lightpatch1, x, y, MSX1, MSY1, MSX2, MSY2)then
Mouse(x, y, 5, 5, True);
Wait(2000 + random(100));
end;


procedure clickonfirstplant;
begin
if FindDTM(jungleplant1, x, y, MSX1, MSY1, MSX2, MSY2)then
Mouse(x, y, 5, 5, True);
Wait(2000 + random(100));
end;


procedure clickonarrow;
begin
if FindDTMRotated(dungeonarrow, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound)then
Mouse(x, y, 5, 5, True);
Wait(2000 + random(100));
end;


procedure clickonhole;
begin
if FindDTM(hole, x, y, MSX1, MSY1, MSX2, MSY2)then
Mouse(x, y, 5, 5, True);
Wait(2000 + random(100));
end;


procedure clickonlightpatch2;
begin
if FindDTM(lightpatch2, x, y, MSX1, MSY1, MSX2, MSY2)then
Mouse(x, y, 5, 5, True);
Wait(2000 + random(100));
end;


procedure clickonsecondplant;
begin
if FindDTM(jungleplant2, x, y, MSX1, MSY1, MSX2, MSY2)then
Mouse(x, y, 5, 5, True);
Wait(2000 + random(100));
end;


procedure clickonlightpatch3;
begin
if FindDTM(lightpatch3, x, y, MSX1, MSY1, MSX2, MSY2)then
Mouse(x, y, 5, 5, True);
Wait(2000 + random(100));
end;


procedure clickonbush; //needs rightclick
begin
if FindDTM(bush, x, y, MSX1, MSY1, MSX2, MSY2)then
MMouse(x, y, 5, 5);
Wait(200 + random(100));
if IsUpText('arch')then
begin
Mouse(x,y,3,3,False);
Wait(750);
ChooseOption('tack');
AntiBan;
end;
end;

Procedure movetostart;
begin
if FindDTM(lightpatch1, x, y, MSX1, MSY1, MSX2, MSY2)then
Mouse(x, y, 5, 5, True);
Wait(2000 + random(100));
end;




procedure doestuff;
begin
findstartburrow;
Writeln('looking to move to first plant');
movetofirstplant;

clickonfirstplant;
WriteLn('trying to find arrow');
clickonarrow;
clickonhole;
clickonlightpatch2;
clickonsecondplant;
clickonlightpatch3;
clickonbush;
movetostart;

// Logout;
// TerminateScript;
End;



begin
Smart_Server := 86;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;

SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
TimeBegan := GetSystemTime;
ToggleXPBar(True);
StartingXP := (GetXPBarTotal);

// repeat
SetAngle(SRL_ANGLE_HIGH);

MakeCompass('N');
SetDTMs;



doestuff;

// FindNormalRandoms; removed as caused it to look for music tab all the time

// LevelUpEx(True, False);

FreeDTMs;

// until(AllPlayersInactive);
end.

(note - i know antiban/progress etc is not called, wait times are arbritrary and no repeat on yet)

From previous playing with agility, lunar mage and hunter kit openers, i can get dtms working so/so - and i was attempting to use this to walk, by finding points on the minimap. This doesnt seem to work well with either finddtm or finddtmrotated. (this despite it finding the points in dtm editor)

Doing the research there are lots of walking methods out there, but i am unsure which is best for which scenario - also i dont understand how the RS updates etc affect the colour - what breaks dtms?

SO
1) when do you choose one walking option over another
2) what are the strengths and weaknesses of each option?
3) what breaks these things? (colours, dtms etc)

I know this is a pretty broad set of questions but would appreciate the help before i spend hours playing with one option only to find another is better :)

cheers

xtrapsp

2012-02-29 16:45:59

You could look into paths and Radial walking? Or a mixture?

Try looking into Radial walking and make it so that when it finds a DTM or Colorspiral it moves onto the next radial path etc.

Helpful threads (Research into them, They aren't all guides):

http://villavu.com/forum/showthread.php?t=75862
http://villavu.com/forum/showthread.php?t=74878
http://villavu.com/forum/showthread.php?t=24303
http://villavu.com/forum/showthread.php?t=62071

imscaredtolosemymain

2012-03-02 08:54:41

Ok, been running my updated script, with DTM walking with no real problems. Its pretty easy when you work out the differrence between MSX1 and MMx1 co-ords….

So, my first working script :)

Gets about 20k hunter per hour but more importantly about 40 vines per hour.

program jadinkotracker;
/////////////////////WRITTEN BY Imscaredtolosemymain////////////////////////

/////templates and ideas borrowed from ryguys ape atoll//////

////////////////////////////VERSION 1.01////////////////////////////////
{$DEFINE SMART}
{$DEFINE SRL5}
{$i SRL/srl.simba}

var
x, y, Lightpatch1, Jungleplant1, dungeonarrow, hole, lightpatch2, jungleplant2,
lightpatch3, lightpatch4, bush, startburrow, timebegan, startingxp: integer;

aFound: extended;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active:=True;
end;

////////////////////DO NOT TOUCH BELOW THIS LINE/////////////////////////



procedure SetDTMs;
begin
lightpatch1 := DTMFromString('mggAAAHicY2NgYKhhYmAogeIJQNwExGVAnAOUSwLidCDOA+IKKH3t3CIGvxIThjY/DobuKbPAeNPqNgZ+oBw2zIgDQwAAykcPVQ==');
JunglePlant1 := DTMFromString('mlwAAAHicY2dgYHBnZGDwAGJfIHYEYmcgDgRifyC+BpQ/BcS3GCDsy1D6ChAHlAoyBFUKMYTVCTH4FQsyxHWKgHFSvygDP1AeF2bEg6EAAIn7DrM=');
DungeonArrow := DTMFromString('mlwAAAHicY2dgYDBjYmCwB2IbILYCYhMgNoLiIqB8DhAXAHE5FMPE/rpKA0lGFBwDJMV4ORn4gTQuzIgHQwEA3BYHDA==');
hole := DTMFromString('mlwAAAHicY2dgYJAAYh4gFgRiDSDWBGJJqPhJIL4ExHuh+CoQXwTifUDs46LE4OeuzJAQrs3QPjGIoXNSMIOtKSeDpjIbAz9QHhdmxIOhAACY6gyZ');
Lightpatch2 := DTMFromString('mwQAAAHic42RgYJjAxMDQxQShpwHxDCieBMR9QNwBxF5AdS5A7AzFnkDsB8RBUOwNxCeOFzKs3hXCsGiFD8Pa1X4MZ491MqxdXgKmV64sZJg1P4qBH6iOEGYkAsMBAG2ZGKk=');
JunglePlant2 := DTMFromString('mKgEAAHic42NgYNBhhGBjIDYAYiMg1gViDSBWgYprQ8VAbH0gVgLiJqDeOiBuAeJ2IO6B4m4g7gDiLiCuguI+KG4G4pTJogypU0QZ4ntEGJImijAEVQoy+BULMHjnCzB45fIzzF7ozuCeyQ/GEU1CDKG1QgzpM0QZ+IF6ycGMZGJUAAAo7RgH');
Lightpatch3 := DTMFromString('mbQAAAHicY2VgYChiYmAoAOIKIE5ggvCjgeIRQBwLxTlAXNNjzdA0VYfBPkmSoQpIV3VZM/ADxdExIxYMBgC0Zwof');
Bush := DTMFromString('m6wAAAHic42ZgYNjFyMCwCYi3MULYe4F4BxDvAeLDQHwEiI8C8QEg7gGq7wLiNijuAOJmIG6FsicA8TQgng2SnxzK4OynyGDtIs9gZCXFoG4gyGBoKcVg46LKYGAhwWBkLcFg4SjLYO4oxcAPVE8sZiQBIwEAQyUV3Q==');
StartBurrow := DTMFromString('mwQAAAHic42RgYPBkZGDwgWIQ2wWIbYDYA4iDoNiYAYLNoNgOiPWAWAeIDYDYAoh5eXlRcE+1H0NvuT/DxIZAhtJ0R4aWEi8GfqA6QpiRCAwHAH0LDBA=');
Lightpatch4 := DTMFromString('mggAAAHicY2NgYJjGxMAwC4jnAXE/E4Q/EYjDgHKhSDgNiL1A6mcFM+gnCTPYJ0mC6XVrSxi6FoQx8APlsGFGHBgCAC8HDNA=');

end;



procedure FreeDTMs;
begin
FreeDTM(lightpatch1);
FreeDTM(JunglePlant1);
FreeDTM(DungeonArrow);
FreeDTM(hole);
FreeDTM(Lightpatch2);
FreeDTM(Jungleplant2);
FreeDTM(Lightpatch3);
FreeDTM(lightpatch4);
FreeDTM(Bush);
FreeDTM(StartBurrow);
end;



procedure Report;
var
Exp, ExpHr, TimeRan: integer;
begin
TimeRan := (1+((GetSystemTime - TimeBegan) / 1000));
Exp := (GetXPBarTotal - StartingXP);
ExpHr := Round((Exp * 3600) / (TimeRan));
WriteLn('Time: ' + TimeRunning);
WriteLn('We have gained ' + IntToStr(Exp) + ' Hunter Experience!');
WriteLn('We are gaining ' + IntToStr(ExpHr) + ' Hunter Experience per Hour!');
end;




Function Antiban: Boolean;
var
i: Integer;
begin
if not LoggedIn then Exit;
//AreaCheck;
i := Random(150);
case i of
1:
begin
RandomRClick;
Result := True;
end;
2:
begin
RandomMovement;
Result := True;
end;
3:
begin
HoverSkill('Hunter', False);
Result := True;
end;
end;

Wait(RandomRange(250,350));
end;



procedure Findstartburrow;
begin
if FindDTM(startburrow, x, y, MSX1, MSY1, MSX2, MSY2)then
Mouse(x, y, 5, 5, True);
Wait(4500 + random(550));
end;


procedure movetofirstplant;
begin
if FindDTMRotated(lightpatch1, x, y, MMX1, MMY1, MMX2, MMY2, -Pi, Pi, Pi/30, aFound)then
Mouse(x, y, 5, 5, True);
Wait(6000 + random(1000));
end;


procedure clickonfirstplant;
begin
if FindDTM(jungleplant1, x, y, 133, 124, 355, 227)then //trying x,y co-ords
// if FindDTM(jungleplant1, x, y, MSX1, MSY1, MSX2, MSY2)then
Mouse(x, y, 5, 5, True);
Wait(3000 + random(500));
end;


procedure clickonarrow;
begin
if FindDTMRotated(dungeonarrow, x, y, MMX1, MMY1, MMX2, MMY2, -Pi, Pi, Pi/30, aFound)then
Mouse(x, y, 5, 5, True);
Wait(5000 + random(300));
end;


procedure clickonhole;
begin
if FindDTM(hole, x, y, MSX1, MSY1, MSX2, MSY2)then
Mouse(x, y, 5, 5, True);
Wait(5000 + random(400));
end;


procedure clickonlightpatch2;
begin
if FindDTM(lightpatch2, x, y, MMX1, MMY1, MMX2, MMY2)then
Mouse(x, y, 5, 5, True);
Wait(5000 + random(500));
end;


procedure clickonsecondplant;
begin
// if FindDTM(jungleplant2, x, y, 50, 50, 357, 240)then
if FindDTM(jungleplant2, x, y, MSX1, MSY1, MSX2, MSY2)then
Mouse(x, y, 5, 5, True);
Wait(3000 + random(500));
end;


procedure clickonlightpatch3;
begin
if FindDTM(lightpatch3, x, y, MMX1, MMY1, MMX2, MMY2)then
Mouse(x, y, 5, 5, True);
Wait(6000 + random(100));
end;


procedure clickonbush; //needs rightclick
begin
// if FindDTM(bush, x, y, MSX1, MSY1, MSX2, MSY2)then
if FindDTM(bush, x, y, 142, 58, 390, 280)then
MMouse(x, y, 5, 5);
Wait(200 + random(100));
if IsUpText('arch')then
begin
Mouse(x,y,3,3,False);
Wait(750);
ChooseOption('tack');
AntiBan;
Wait(5000 + random(500));
end;
end;

Procedure movetostart;
begin
if FindDTM(lightpatch4, x, y, MMX1, MMY1, MMX2, MMY2)then
Mouse(x, y, 5, 5, True);
Wait(4000 + random(1000));
end;




procedure doestuff;
begin
findstartburrow;
Writeln('looking to move to first plant');
movetofirstplant;

clickonfirstplant;
WriteLn('trying to find arrow');
clickonlightpatch2;
clickonarrow;
clickonhole;
antiban;
clickonlightpatch2;
clickonsecondplant;
clickonlightpatch3;
clickonbush;
movetostart;
antiban;

// Logout;
// TerminateScript;
End;



begin
Smart_Server := 86;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;

SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
TimeBegan := GetSystemTime;
ToggleXPBar(True);
StartingXP := (GetXPBarTotal);

repeat
SetAngle(SRL_ANGLE_HIGH);

MakeCompass('N');
SetDTMs;

doestuff;

report;
freedtms;
until(AllPlayersInactive);


end.

Only occasionally it doesnt find a dtm, then loops through the entire script going to all the other bushes in the loop, then comes back and recovers.


So, next is failsafes - how can i check if it has found a dtm, then if it doesnt, how can i make it pause and look again?

For clicking on the items, can i check for it bringing up the animal footprint tracks?

For map walking, can anything be done if it doesnt find the dtmrotated?