SRL Archive - Help and Support

My new function laggs and I have no idea why :((


n3ss3s

2007-07-04 10:29:33

Well, since GetMinimapPos doesnt work and for the scripting competition you cant even use KYAB scripts, I made new walking procedure to use bitmaps(Yes, now you think why dont you just use DDTMS : because I read YoHoJos tut, it was awesome, but I just came up to a feeling I dont like DDTMS . So, I made bitmap walking, but it laggs and I cant solve it :(


procedure LWalk(LandMark : array of Integer; H, W : Integer; Debug : Boolean);
var I, Cbx1, Cby1, Cbx2, Cby2, Cx1, Cy1 : Integer;
A, AA : Extended;
begin
NewLine := '';
if(not(TabExists( 4)))then
begin
Wait(100 + Random(25));
Writeln('Not logged in. Exitting procedure nWalk.');
Exit;
end;
if(Debug) then
begin
Wait(100 + Random( 25));
Writeln('Starting LWalk.');
end;
for I := 1 to GetArrayLength(LandMark) do
begin
if(FindDeformed(x, y, LandMark[I], MMX1, MMY1, MMX2, MMY2)) then
begin
if(Debug) then
begin
Writeln('omfg found ur bitmap!');
Writeln('Bitmap found in angle of '+ FloatToStr(A)+' degrees');
Writeln('bmp Accuracy : '+ FloatToStr(AA));
Wait(50+random(10));
end;
Cbx1 := x;
Cby1 := y;
Cbx2 := Cbx1 + W;
Cby2 := Cby1 + H;
Wait(50+random(10));
ClickMouseBox( Cbx1, Cby1, Cbx2, Cby2, True);
repeat
FindTalk;
Wait(40 + random(15));
until(FlagDistance < 50 + random(8)) or (not(LoggedIn));
end;
Wait(100 + Random(25));
end;
Wait(100 + Random(25));
end;

I added few waits but that didnt help.
Help appreciated.

SKy Scripter

2007-07-04 14:18:21

because bitmaps. are gay to use, to find stuff. jk.
but if you have to many bitmaps it can be laggy :)

n3ss3s

2007-07-04 14:24:06

But its only 3. I havent used FreeBitmap at all and I kinda dont know whats the benefits of using it, so should I use it?

GOSH IM STUPID I FORGOT TO LOAD THE BITMAPS!
Aww still lags :( I hope someone could help

Wanted

2007-07-04 17:22:03

The bitmaps are what makes it lag, also you have some inefficient coding there use TBox and TPoint.

The lag won't go away so switch over to DDTMs…

n3ss3s

2007-07-05 04:53:02

Guess I'll have to. Well, they cant be so bad since so many people use em, so I maybe I'll use DDTMs too :)

SKy Scripter

2007-07-06 02:10:57

Lol Freeing Bitmaps is good. Because SCAR doesnt have to hold all that memory after you used the bitmaps.

n3ss3s

2007-07-06 04:37:18

But does that mean I have to call BitmapFromString again?

jhildy

2007-07-06 09:41:01

yes if you want to use them.

n3ss3s

2007-07-06 12:01:01

OK thx everybody.