SRL Archive - OSR Help

Could not Find dtm in Bank


VastlySuperior

2012-07-25 07:24:28

Hi

I keep getting this error when doing a WithDrawItem from the bank using a dtm.

When I test the dtm string it pics the dtm correctly. What am I dong wrong.

Here is the code.

procedure WithDrawItems;
var
Temp:Integer;
Begin
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
DTM_SoftClay := DTMFromString('mlwAAAHicY2dgYGgF4gogrgPibiCeAsRdQFwDxCyMDAwcQMwPxYxA/Aso/heIQ+14gCQTDowbMOLBUAAA/WYGgQ==');
DTM_Clay := DTMFromString('mggAAAHicY2NgYGBnBBKMEJoXiIWAmAuIHYDYBYjdgdgZiG2A2AKIazJcgRqYsGDsgBEHhgAACIsDBQ==');
OpenbankFast('db');
Wait(500 + random(400));
// Withdraw Soft Clay From Bank
While (not(InvFull)) do
Begin
If WithDrawItem(DTM_SoftClay, 'dtm', 28, 'ft cl', []) then // WithDraw item From Bank
Begin
WriteLn('Success');
// Wait(1500 + random(400));
CloseBank;
FreeDTM(DTM_SoftClay);
FreeDTM(DTM_Clay);
End;
End;
End;


I know uptext is a issue at the moment but I bypassed it by using Wizzup`s suggestion made to me here and included this function at the top.

function rs_GetUpText: String; {$IFDEF LAPE}override;{$ENDIF}
begin
result := rs_GetUpTextAtEx(7, 7, True);
WriteLn(result);
end;

This allows me to get the correct uptext when the code is run, but the moment I try to use withdrawitem I receive the above mentioned error.

** Warning in WithdrawItem: Could not Find dtm in Bank. [Uptext: ft cl] **

Any ideas or thoughts on what to do and why this is happening.

Thanks

P1ng

2012-07-25 08:20:16

You have 0 tolerance on your main-point (the brown one). Increase the tolerance by a little bit to account for minor changes in colour on RS and you should be fine.

VastlySuperior

2012-07-25 09:11:47

Ok, I have added a tolerance of 4, if I go higher it starts to find the money also as a possible match, but when I run it with this dtm it still gives the same error.

Here is the new dtm string:
mlwAAAHicY2dgYOBlgAA2IBYGYhkgFgJiFiDmAmI+IBaFYnaoWmYgDrXjAZJMWDELVA02zIgHQwEAlCYBdA==

P1ng

2012-07-25 09:14:23

Remove the tolerance of 3 from all of your black points, they can and should remain at 0tol. and make more points to get a really accurate DTM with a higher tolerance on your middle point. Maybe ~50 but you will need several points on your black outline to make sure you don't recieve false positives (i.e. on your gold)

Footy

2012-07-25 10:04:44

It says your uptext is ft cl. Ive never used withdrawDTM, but that looks like it could be an issue.

P1ng

2012-07-25 10:35:50

That UpText is perfectly fine as 'ft cl' is just the area between Soft clay. It contains no capitals and spaces are generally not an issue.

Getdropped

2012-07-25 17:05:30

From: P1ng
That UpText is perfectly fine as 'ft cl' is just the area between Soft clay. It contains no capitals and spaces are generally not an issue.


It might just be the withdrawitem function try using something like:

      if FindDTMRotated(ClayDTM, x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
MMouse(x, y, 3, 3);
//if you want you can search for uptext here but honestly what other dtms match hopefully nothing ;)
getmousepos(x,y);
Mouse(x, y, 0, 0, false);
WaitOptionMulti(['All'], 200);//or 27 if you only want 27 XD
Freedtm(ClayDTM);
Wait(600);
end;

VastlySuperior

2012-07-27 11:41:20

Hi

I have tried increasing the dtm`s, also went with the code getdropped gave but then I get this Error

[Error] C:\Simba\Scripts\TestBed.simba(187:85): Unknown identifier 'aFound' at line 186
Compiling failed.

if FindDTMRotated(DTM_SoftClay, x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, aFound) then

Code in question on line 186.

Guys I would really like to know why this don`t work.

Thanks a lot

Footy

2012-07-27 12:57:08

that means you didnt define afound.

VastlySuperior

2012-07-27 13:01:10

I know, but what does afound mean?

There is no sample codes for this function to see what it looks for.

Footy

2012-07-27 13:02:37

ooh, i see what you mean now. I personly wouldnt use DTM rotated, theres no need in a banking procedure. Just load your DTM, use findDTM, then free it.

VastlySuperior

2012-07-27 13:28:05

Can Anyone Run this procedure and tell me why it is not finding the dtm for the softclay.

I really need some help here as well as some advice.

procedure WithDrawItems;
var
Temp, x, y:Integer;
Begin
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
DTM_SoftClay := DTMFromString('mAAEAAHic42FgYOABYhYg5gNiMSCWBmIJIBYFYmGoPBsQMzNAABdUPQgwQeVAaoSgemBYCGpmhAMvVCVx2IiBNMBIIkYGAI2tAj0=');
DTM_Clay := DTMFromString('mFQEAAHicnc05CoBAEETRanFBcUm8jBMo7oGH8RLeW78wieFY8KiCDrqSlJl00xEdI0WBEg1a1Mj93TBixooNu+8FE3o4dH4PuM7j/RIkUXjsh08eBisGRg==');
OpenbankFast('db');
Wait(500 + random(400));
// Withdraw Soft Clay From Bank
While (not(InvFull)) do
Begin
If WithDrawItem(DTM_SoftClay, 'dtm', 28, 'oft', []) then // WithDraw item From Bank
Begin
WriteLn('Success');
Wait(400 + random(200));
CloseBank;
FreeDTM(DTM_SoftClay);
FreeDTM(DTM_Clay);
End;
End;
End;


You can change OpenbankFast('db'); to any bank, all you will need is soft clay.

I would really appreciate it.
Thanks

Footy

2012-07-27 18:24:29

While..do loop repeats if the argument is positive. Youve said repeat if not(invfull) is positive, that should be while invfull do instead. Try this out. Sorry, the standards arent great, I just threw it together.
procedure WithDrawItems;
var
Temp, x, y:Integer;
Begin
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
DTM_SoftClay := DTMFromString('mAAEAAHic42FgYOABYhYg5gNiMSCWBmIJIBYFYmGoPBsQMzNAABdUPQgwQeVAaoSgemBYCGpmhAMvVCVx2IiBNMBIIkYGAI2tAj0=');
DTM_Clay := DTMFromString('mFQEAAHicnc05CoBAEETRanFBcUm8jBMo7oGH8RLeW78wieFY8KiCDrqSlJl00xEdI0WBEg1a1Mj93TBixooNu+8FE3o4dH4PuM7j/RIkUXjsh08eBisGRg==');
OpenbankFast('db');
Wait(500 + random(400));
// Withdraw Soft Clay From Bank
if InvFull then
Begin
If FindDTM(DTM_SoftClay, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(x, y, 3, 3, mouse_right);
WaitOption('ll', 600);
wait(randomrange(300, 800));
Closebank;
end else
begin
writeln('We couldnt find the Soft clay! Check your DTM, or make sure the clay is visible');
Terminatescript;
end;
End else
begin
writeln('The inventory isnt full yet.');
Exit;
end;
End;
Let me know how it works!

Getdropped

2012-07-27 18:37:21

From: VastlySuperior
Can Anyone Run this procedure and tell me why it is not finding the dtm for the softclay.

I really need some help here as well as some advice.

procedure WithDrawItems;
var
Temp, x, y:Integer;
Begin
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
DTM_SoftClay := DTMFromString('mAAEAAHic42FgYOABYhYg5gNiMSCWBmIJIBYFYmGoPBsQMzNAABdUPQgwQeVAaoSgemBYCGpmhAMvVCVx2IiBNMBIIkYGAI2tAj0=');
DTM_Clay := DTMFromString('mFQEAAHicnc05CoBAEETRanFBcUm8jBMo7oGH8RLeW78wieFY8KiCDrqSlJl00xEdI0WBEg1a1Mj93TBixooNu+8FE3o4dH4PuM7j/RIkUXjsh08eBisGRg==');
OpenbankFast('db');
Wait(500 + random(400));
// Withdraw Soft Clay From Bank
While (not(InvFull)) do
Begin
If WithDrawItem(DTM_SoftClay, 'dtm', 28, 'oft', []) then // WithDraw item From Bank
Begin
WriteLn('Success');
Wait(400 + random(200));
CloseBank;
FreeDTM(DTM_SoftClay);
FreeDTM(DTM_Clay);
End;
End;
End;


You can change OpenbankFast('db'); to any bank, all you will need is soft clay.

I would really appreciate it.
Thanks


So assuming your DTM is correct here is what I would do:



procedure WithDrawItems;
var
x, y, DTM_SoftClay : Integer;
aFound : Extended;
begin
repeat
SetAngle(SRL_ANGLE_HIGH);
MakeCompass('N');
OpenBankNPC;//assuming it is a npc banker you can change to a chest if you want
until BankScreen or PinScreen;

{if PinScreen then //use this if you declare a pin
begin
repeat
InPin(Players[0].Pin);
until BankScreen or not (LoggedIn);
end;}
if not(InvFull) then
begin
DTM_SoftClay := DTMFromString('mAAEAAHic42FgYOABYhYg5gNiMSCWBmIJIBYFYmGoP'+
'BsQMzNAABdUPQgwQeVAaoSgemBYCGpmhAMvVCVx2IiBNMBIIkYGAI2tAj0=');
{DTM_Clay := DTMFromString('mFQEAAHicnc05CoBAEETRanFBcUm8jBMo7oGH8RLeW78wieFY'+
'8KiCDrqSlJl00xEdI0WBEg1a1Mj93TBixooNu+8FE3o4dH4PuM7j/RIkUXjsh08eBisGRg==');}
// you arnt using regualr clay...
if FindDTMRotated(DTM_SoftClay, x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4,
Pi/60, aFound) then
begin
MMouse(x, y, 5, 5);
if (IsUpText('oft')) then
begin
GetMousePos(x,y);
Mouse(x, y, 0, 0, false);//right clicks dtm
WaitOptionMulti(['All'], 200);
end;
Wait(600);
end;
Freedtm(DTM_SoftClay);
end;
end;

Does that work for you?

Olly

2012-07-27 21:19:17

Bank dtms are weird… they change alot, try using a bitmap if its possible.

Getdropped

2012-07-27 21:56:27

From: Ollybest
Bank dtms are weird… they change alot, try using a bitmap if its possible.


They are just the same as invy dtms… just sometimes they can deformon the upleft side… you just have to make smart dtms and you shouldnt have any troubles….. or atleast i don't :p

VastlySuperior

2012-07-28 01:46:48

Guys, thanks for the response, I was asleep during the time you responded, I won`t be able to look at it now as I have some rlf stuff to take care this morning, but I will let you know later on during the day what I have found.

Thanks for everyone who has helped me.

E.

Ok, I have tested the Procedure getdropped69 has provided, with the same results as my own code. Also Your Procedure Footy, does not work.

So there Only remains 3 scenarios why it should not work.

1) The DTM is not correct. ( Checked it a lot and it always just display one possibility for the clay and it is correct.) Also used the default claydtm provided by getdropped69 and it also do not find the dtm.
2) It does not find the uptext, in other words the fonts might not be correct. (But all the other functions and procedures read the uptext correct.
3) WithDrawItems does not work correctly. There is something wrong with that function.

Is the last one a possibility?

Why do I want to use withdrawitem, because it does not matter in which slot in the bank your item is, it will find the dtm and withdraw it.

Any other suggestions or feedback? Has anyone actually tried the code to see what it does?

Second Edit.

Also Footy, Your loop for the InFull is not correct. I don`t want to withdraw items when the inventory is full, I want to withdraw when the inventory is not full. Your loop will never get executed because it is never true. When Executed as (Not(InvFull)) it actually works and find the dtm and withdraws it. Thanks a bunch.

So the conclusion is that withdrawitem is messed up, where do you report that?