SRL Archive - OSR Help

script lag


xdarkshadowx

2013-01-09 22:47:50

So my script lags a bit. only in one function though. It'll sometimes get stuck and only continue after I use the mouse to click on something, then it'll pick itself back up and continue on. Now this poses a problem as when I'm not here, it can just stop. Any clues and to what might be causing this? I've freed all of my BMP and DTMs. I streamlined the code so it's not doing a lot of calculations, but calculations aren't the problem, as the second I touch the mouse and click on something it takes off like it had never stopped..

not using smart FYI.

thanks

Kasi

2013-01-09 22:57:11

i would advise posting the script, ill take a look tomorrow if someone hasn't solved it by then

xdarkshadowx

2013-01-09 23:01:29

procedure DropOffInventory;  
begin
writeln('empting slot 1');
dragmouse(LocalLocation.x + 10,LocalLocation.y + 80,48,44,699,320,363,81);
wait(800 + random(500));
if(not IsCargoEmptied) then
begin
writeln('empting slot 2');
dragmouse(LocalLocation.x + 10 + 75,LocalLocation.y + 80,48,44,699,320,363,81);
wait(800 + random(500));
if(not IsCargoEmptied) then
begin
writeln('empting slot 3');
dragmouse(LocalLocation.x + 10 + 150,LocalLocation.y + 80,48,44,699,320,363,81);
wait(800 + random(500));
if(not IsCargoEmptied) then
begin
writeln('empting slot 4');
dragmouse(LocalLocation.x + 10,LocalLocation.y + 80 + 104,48,44,699,320,363,81);
wait(800 + random(500));
if(not IsCargoEmptied) then
begin
writeln('empting slot 5');
dragmouse(LocalLocation.x + 10 + 75,LocalLocation.y + 80 + 104,48,44,699,320,363,81);
wait(800 + random(500));
if(not IsCargoEmptied) then
begin
writeln('empting slot 6');
dragmouse(LocalLocation.x + 10 + 150,LocalLocation.y + 80 + 104,48,44,699,320,363,81);
end;
end; //608---712 = +104y
end;
end;
end;

end;

function IsCargoEmptied(): boolean;   //if the blue bar is empty will return true.
var
blueBarBoxEstimate: tbox;
localBM: integer;
begin

blueBarBoxEstimate.X1 := LocalLocation.X - 8;
blueBarBoxEstimate.Y1 := LocalLocation.Y + 40;
blueBarBoxEstimate.X2 := LocalLocation.X + 6;
blueBarBoxEstimate.Y2 := LocalLocation.Y + 53;

if(not IsColorInBoxTolerance(6441984, blueBarBoxEstimate, 45)) then
begin
writeln('cargo empty');
result := true
end
else
begin
writeln('Keep dragging away!');
result := false
end;
end;


All functions using mouse are now lagging like this somewhat. the above lags the worst. Grr.

edit: removed a bunch of variables and did some cleaning up, everything is working decent but the functions above still will freeze until the mouse is moved and clicked (or like 2-5 minutes has passed).