Jump to content
Bixby Sayz

SMART drives me crazy

Recommended Posts

Since I use SMART (a lot) when running scripts I always like to make sure any dtms I create work both with a targeted browser client and using SMART. Except it is never quite that simple...

 

I use a simple little test script (see below) that checks to find the dtm 1) on main screen, 2) tabs along the top of bank, 3) bank contents, 4) inventory, and 5) chat box. And of course it behaves differently using SMART.

 

I test it by placing my item in the first slot of a bank tab (so item appears on the tabs across the top of bank because sometimes those items are slightly different than items in the bank itself), and in the inventory. (See screenshot)

 

First run I just uncomment SMART define and let 'er rip just to get SMART loaded.

Second run I login, open bank, toggle SMART to enabled, and run it.

Third run I comment out SMART define, toggle SMART to disabled, target SMART as if it were a browser and run it again.

 

In the screen shot and script I am testing a normal log.

Using SMART:

Found on main screen (86,69)

Not found on bank tabs

Not found in bank

Not found in inventory

Not found in chat

Treating SMART window as just a browser:

Found on main screen (90,73)

Found on bank tab 2 (90,73)

Found in bank slot 0 (49,115)

Found in inventory slot 0 (574,236)

Not found in chat

 

What the? Crap like this drives me round the bend. (Yes I have tripled checked my graphics settings in SMART)

 

ide-070812-201702.jpg

 

[sCAR]program new;

{$DEFINE RS2}

{$DEFINE SMART}

 

{$I OSI\OSI.scar}

 

procedure Test;

var

DTM: Integer;

P: TPoint;

begin

// Logs - Normal

DTM := DTMFromString('78DA633464606058CA800292BC7418B880342310FF0702467D206315031A6002938C501EA32690584E849A19F8D500004555082D');

 

try

// Find anywhere on main screen

if FindDTM(DTM, P.X, P.Y, MSX1, MSY1, MSX2, MSY2) then

begin

WriteLn(Format('Found on main screen (%d,%d)', [P.X, P.Y]));

MMouse(P.X, P.Y, 0, 0);

end

else

WriteLn('Not found on main screen');

 

// Find on tabs along top of bank

if FindDTM(DTM, P.X, P.Y, MBX1, (MBY1 - 40), MBX2, (MBY1 + 7)) then

begin

WriteLn(Format('Found on bank tab %d (%d,%d)', [(((P.X - 25) div 48) + 1), P.X, P.Y]));

MMouse(P.X, P.Y, 0, 0);

end

else

WriteLn('Not found on bank tabs');

 

// Find in bank itself

if FindDTM(DTM, P.X, P.Y, MBX1, MBY1, MBX2, MBY2) then

begin

WriteLn(Format('Found in bank slot %d (%d,%d)', [CordsToBankSlot(P), P.X, P.Y]));

MMouse(P.X, P.Y, 0, 0);

end

else

WriteLn('Not found in bank');

 

// Find in inventory

if FindDTM(DTM, P.X, P.Y, MIX1, MIY1, MIX2, MIY2) then

begin

WriteLn(Format('Found in inventory slot %d (%d,%d)', [CordsToItemSlot(P), P.X, P.Y]));

MMouse(P.X, P.Y, 0, 0);

end

else

WriteLn('Not found in inventory');

 

// Find in chat box

if FindDTM(DTM, P.X, P.Y, MCX1, MCY1, MCX2, MCY2) then

begin

WriteLn(Format('Found in chat (%d,%d)', [P.X, P.Y]));

MMouse(P.X, P.Y, 0, 0);

end

else

WriteLn('Not found in chat');

finally

FreeDTM(DTM);

DTM := 0;

end;

end;

 

begin

ClearDebug;

SetUpOSI;

Test;

end.[/sCAR]

Link to comment
Share on other sites

Treating as a browser you mean? Not really but it works. If the script doesn't load the SMART library but the window is already up then as far as SCAR is concerned it's just another client window. I could load up the browser but why bother when there is a handy web browser right there in front of you.

 

What drives me crazy is how color and other finding routines behave differently when using SMART in a script. To make it even more fun if you do a get color at point (somex,somey) it returns the same color using either SMART or the browser (*most* of the time). And then sometimes with no consistency get color will return meaningless values under SMART, causing the finding routines to fail.

Link to comment
Share on other sites

Is anyone else having issues with dtm finding using SMART? (Or is anyone even bothering these days)

 

Running a test script that loads Iron Ore dtm from Smithing.scar then looks for it on: Entire Screen, Main Screen, Bank Tabs, Bank Screen, Inventory.

 

Run this with a browser as client it finds every single one. Run this using SMART and it finds the Entire Screen and Bank Tab and that's it. Both the web client and SMART have the identical graphics settings (triple checked).

Link to comment
Share on other sites

Yeah i finally got it working. But who knows maybe if i close and try to reopen again it will flop lol. But SetupOSI isn't seeing it there. So it goes through its damn wait procedures for like 12000000, before it does anything :(

 

I'm on the character creation screen. So maybe that's why. Is there a way to bypass the waits?

Is 8 compatible with SCAR?

 

Also how the hell do you use SMART without using SetupOSI procedure.

Edited by LordJashin
Link to comment
Share on other sites

Well, the coordinates are different. I think SMART is slightly smaller than browser on its box size or w/e. Also... Java, and SMART, might render RS2 a "little" bit different on the graphics? I doubt it tho...

 

 

Try doing the targeting from the desktop thing, that janilabo I think used, or maybe it was you. My brain is lost atm.

Link to comment
Share on other sites

Try doing the targeting from the desktop thing, that janilabo I think used, or maybe it was you. My brain is lost atm.
Yeah that was me. And that does work: Disable SMART, comment out SMART from script, target SMART window (so SMART window is now treated as "just another client") and voila it finds it.

 

Re-enable SMART, un-comment SMART in script, and doesn't find. Aaaaaaaaaaaargh.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...