SRL Archive - Jr. Member General Help and Discussion

Finding stackable item DTM in bankScreen


Lama

2014-11-16 16:20:15

So I'm trying to find an item (portable sawmill) in the bankscreen and withdraw it under certain circumstances, however, after multiple different DTM variations and other trial and error, I havee yet to figure out a way to get the script to find it, and I think it's because it's stackable and the number covers up some of the black outline of the item.

The only thing I don't understand is that in the DTM editor, the editor can find the DTM's I make, but when used in practice, it doesn't detect it at all.

Here's the code snippet I am using for development:

if bankScreen.isOpen(1250) or pinScreen.isOpen(1250) then
begin
if pinScreen.isOpen() then
pinScreen.enter(players[currentPlayer].bankPin);
mouseBox([393, 564, 420, 585], MOUSE_LEFT); // quick inventory deposit seems broken at the moment, look in to

writeLn(toStr(bankScreen.getPackCountDTM(millDTM))); // For dev purposes, always comes out as 0 so far

if bankScreen.isPackEmpty() then // probably unnecessary check
if not bankScreen.withdraw(millDTM, 1) then // withdraw the mill, by DTM
begin
writeLn('No extra mills left ... terminating script ...');
terminateScript();
end;
smartImage.debugDTM(millDTM, mainScreen.getBounds(), clLime);
antiban();
if bankScreen.isItemInPackSlot(1) then // also probably unnecessary, have yet to test all of this...
bankScreen.close();

Any thoughts so I don't have to limit users to 'Place this item in bank slot 10, etc'?

Hoodz

2014-11-16 16:25:44

From: Lama
So I'm trying to find an item (portable sawmill) in the bankscreen and withdraw it under certain circumstances, however, after multiple different DTM variations and other trial and error, I havee yet to figure out a way to get the script to find it, and I think it's because it's stackable and the number covers up some of the black outline of the item.

The only thing I don't understand is that in the DTM editor, the editor can find the DTM's I make, but when used in practice, it doesn't detect it at all.

Here's the code snippet I am using for development:

if bankScreen.isOpen(1250) or pinScreen.isOpen(1250) then
begin
if pinScreen.isOpen() then
pinScreen.enter(players[currentPlayer].bankPin);
mouseBox([393, 564, 420, 585], MOUSE_LEFT); // quick inventory deposit seems broken at the moment, look in to

writeLn(toStr(bankScreen.getPackCountDTM(millDTM))); // For dev purposes, always comes out as 0 so far

if bankScreen.isPackEmpty() then // probably unnecessary check
if not bankScreen.withdraw(millDTM, 1) then // withdraw the mill, by DTM
begin
writeLn('No extra mills left ... terminating script ...');
terminateScript();
end;
smartImage.debugDTM(millDTM, mainScreen.getBounds(), clLime);
antiban();
if bankScreen.isItemInPackSlot(1) then // also probably unnecessary, have yet to test all of this...
bankScreen.close();

Any thoughts so I don't have to limit users to 'Place this item in bank slot 10, etc'?


dont get points at the top, just get one mainpoint in the middle(7-12 tol), and like 4-5 subpoints(black outline(65536 i believe?)) at the bottom of the item.

Lama

2014-11-16 16:33:44

From: hoodz
dont get points at the top, just get one mainpoint in the middle(7-12 tol), and like 4-5 subpoints(black outline(65536 i believe?)) at the bottom of the item.


I've actually tried that, but I'll add more tolerance this time. Still doesn't explain why the editor can still find the item.

Hoodz

2014-11-16 16:50:42

From: Lama
I've actually tried that, but I'll add more tolerance this time. Still doesn't explain why the editor can still find the item.


did you actually load the dtm?

bonsai

2014-11-16 16:53:35

Have you seen this tool Clarity posted?

Lama

2014-11-16 16:59:19

From: hoodz
did you actually load the dtm?


Yes ;)

From: bonsai
Have you seen this tool Clarity posted?


I've tried the tool in the past and it wouldn't really work for me, I'll give it another go if hoodz advice doesn't work out.

EDIT: Both methods are not working as of yet.

Ashaman88

2014-11-16 19:20:58

This doesn't help your problem really, but why not have the bank slot be a variable the user sets? That's what I usually do as a lazy man

KeepBotting

2014-11-16 21:31:26

Screenshot us your DTM editor, like how you're placing the points and whatnot. Maybe you've got it mixed up about how to place them properly.

Lama

2014-11-16 21:32:06

From: Ashaman88
This doesn't help your problem really, but why not have the bank slot be a variable the user sets? That's what I usually do as a lazy man


Good news is that I got the bitmap withdraw overload to work! So, it searches for the bottom half of the sawmill instead of a DTM, and it's working flawlessly so far.

NKN

2014-11-16 21:33:06

From: Lama
Good news is that I got the bitmap withdraw overload to work! So, it searches for the bottom half of the sawmill instead of a DTM, and it's working flawlessly so far.


Glad it worked out for you.