SRL Archive - OSR Help

Potting with dtms


shiningwhite

2012-05-17 10:09:49

this is meant to be embedded into a fighter eventually, but this is what I have so far:


program New;
{$DEFINE SMART}
{$i srl/srl.simba}

Const
StrToPot = 27; //Enter Str level at which to pot
Potdownlog = True;
Sworld= 7;

Procedure DeclarePlayers;
begin

HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

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

end;

procedure PotUp;
var potone, pottwo, potthree, potfour, x, y: integer;
begin
if StrToPot > 0 then
begin;

potone := DTMFromString('mbQAAAHicY2VgYGADYh4gZgdiXgYIEILS4kDMBcTcQLx1Sx2QZELDmIARCwYDAJ/KAl4=');
pottwo := DTMFromString('mbQAAAHicY2VgYGADYh4gZgdiXgYIEILS4kDMBcTcQLx1Sx2QZELDmIARCwYDAJ/KAl4=');
potthree := DTMFromString('mrAAAAHic42BgYOACYhYGCGAGYh4gFgZiISDmg4oxQ9UJALEgEPMCMQdUz+o15UCSCQ/GDxgJYBgAABXNAoM=');
potfour := DTMFromstring('mwQAAAHic42RgYOAEYl4gFgRiASBmZ0AAViBmhooxQdWC1AgBMT8Qc0HVsQDxlk0WUFW4MRMDYcBIBIYDACfXAlo=');
if GetSkillInfo('Strength', True) < (StrToPot+1) then
begin
writeln('Potting UP!');
if ExistsItemDTM(potone, x, y) then
begin
writeln('...Found 1dose POT!');
wait (500+random(500));
mouse(x, y, 2, 2, true);
end else
if ExistsItemDTM(pottwo, x, y) then
begin
writeln('...Found 2dose POT!');
wait (500+random(500));
mouse(x, y, 2, 2, true);
end else
if ExistsItemDTM(potthree, x, y) then
begin
writeln('...Found 3dose POT!');
wait (500+random(500));
mouse(x, y, 2, 2, true);
end else
if ExistsItemDTM(potfour, x, y) then
begin
writeln('...Found 4dose POT!');
wait (500+random(500));
mouse(x, y, 2, 2, true);
end else
begin
writeln('no pots!')
if Potdownlog = True then
begin
writeln('LOGGING OUT!');
logout;
TerminateScript;
end;
end;
end else
begin
wait(20000+random(5000));
end;
freedtm(Potone);
freedtm(Pottwo);
freedtm(Potthree);
freedtm(Potfour);

end;
end;

begin
Smart_Server := SWorld;
Smart_Members:= true;
Smart_Signed := true;
Smart_SuperDetail := false;
SetUpSRL;
ActivateClient;
ClearDebug;
DeclarePlayers;
LoginPlayer;
wait(5000 +random(600));
while(true) do
begin
PotUp;
end;
end.

This is my updated code. One problem is that no matter how many times I redo the DTM's, it always overlooks 1 dose pots in favor of 4 doses. Is there an easy fix for this?

Rich

2012-05-17 10:13:29

When you say it wouldn't work, what was going wrong? Was it giving an error or just not doing anything?

shiningwhite

2012-05-17 10:18:45

It loaded the client correctly, logged in, then instantly crashed. I added the wait function afterwards. Now it wont Log in at all.

shiningwhite

2012-05-17 10:30:12

Actually, i got it to work now.. My DTM's seem to be incorrect because it cant find any pots.

Rich

2012-05-17 10:41:56

Ah OK. Checked out my guide if you're struggling to get the DTMs working for you. It's quite old, but still relevant.

shiningwhite

2012-05-17 10:46:54

That's really helpful, thank you for all your help. NOW just to piggyback off a fighter script and test this thing out!

Rich

2012-05-17 10:54:33

No problem. The guide is actually for SCAR, but the concept is exactly the same. I might actually update my guides come to think of it…

shiningwhite

2012-05-17 11:19:53

I can't seem to get it to consistently find some of my dtms.

Abu

2012-05-17 11:33:30

From: shiningwhite
I can't seem to get it to consistently find some of my dtms.


Then you need to make more accurate DTM's. I have some which I got from scripts that are years old - but they still work like a charm.

Rich

2012-05-17 12:05:09

Problem fixed over PM. Tolerance need to be raised.