SRL Archive - Research & Development Lounge

FindDTMInBank(DTM : integer; var xcx, ycy : integer) : integer;


footballjds

2008-01-31 17:54:35

function GetScrollLvl : integer;
var
xxx : integer;
begin
FindColor( xxx, Result, 5531254, 468, 75, 468, 253);
end;
function FindDTMInBank(DTM : integer; var xcx, ycy, yOfScroll : integer) : boolean;
var
cx, cy : integer;
begin
if not(BankScreen) then EXIT;
if FindDTM(dtm, xcx, ycy, 21, 58, 467, 287) then
begin
yOfScroll:= GetSCrollLvl;
Result := True;
EXIT;
end;
if GetColor(475, 75) = 1777699 then
Mouse(475, 79, 3, 3, True);
MMouse(476, 280, 3, 3);
GetMousePos(cx, cy);
HoldMouse(cx + Random(1), cy + Random(1), True);
repeat
if FindDTM(dtm, xcx, ycy, 21, 58, 467, 287) then BREAK;
wait(1);
until not(GetColor(477, 271) = 1777699) or not(LoggedIn);
ReleaseMouse(cx, cy, True);
yOfScroll:= GetSCrollLvl;
Result := not(GetColor(477, 271) = 1777699);
end;
usage: FindDTMInBank(LogDTM, x, y, YOfScrollBar);

munk

2008-01-31 18:05:24

im confused at why it returns an integer and not a boolean?

Timer

2008-01-31 18:08:35

me eather, why would we have to know the amout on the bar up…?
just result true or false if found dtm

footballjds

2008-01-31 18:30:57

From: munk
im confused at why it returns an integer and not a boolean?


so in the future you don't have to search, you can just click da spot :duh:

MylesMadness

2008-01-31 18:37:30

Me and him kinda made this together(Ideas and bugs fixed). What it does is makes it so it only has to search the bank once.

Edit:Wouldn't this make major lag:
  repeat
if FindDTM(dtm, xcx, ycy, 21, 58, 467, 287) then BREAK;
wait(1);
until not(GetColor(477, 271) = 1777699) or not(LoggedIn);

footballjds

2008-01-31 19:23:02

actually myles it won't hardly lag at all.

MylesMadness

2008-01-31 20:01:02

I always thought calling a findanything every 1ms would lag. I learned something new today:p

footballjds

2008-01-31 20:29:56

find bitmap would lag the shit outa it… but as long as its not a HUGE dtm its fine.

MylesMadness

2008-01-31 21:15:42

Bitmaps I had no doubt in my mind because their slow even once let alone 1 every ms.

footballjds

2008-02-01 00:06:20

@myles :p
@everyone else, no comments? cmon!

ZephyrsFury

2008-02-01 00:23:05

From: footballjds
so in the future you don't have to search, you can just click da spot :duh:


I still don't get it. Why does it return GetScrollLvl?

footballjds

2008-02-01 00:31:44

ok, it figures out at what scroll lvl it is at…. so next time you open da bank you can have it click there.

ZephyrsFury

2008-02-01 02:39:59

Oh ok. I still think it would be better to return a boolean then have a variable in the parameters to store the scroll level. So then your could do something like this:


if FindDTMInBank(..) then
Mouse(...);

footballjds

2008-02-01 14:31:36

yeah, i was just getting it up, il add that:D
changed it, anyone used it?