SRL Archive - OSR Help

SMART Mouse lag


Shatterhand

2012-01-28 09:01:01

Hi guys.
I just made an own superheater, it works flawless except one thing. When it does the superheating and I do minimaze/maximaze it to/from the taskbar, the mouse gets a lag, and SKIPS the click.

for i:=1 to 17 do
begin
MouseBox(664,390,674,403,mouse_left); //this will click on superheat spell
repeat until FindBitmapToleranceIn(nat, x, y, MIX1, MIY1, MIX2, MIY2, 30) //this will check for inventory tab
MouseBox(655,368,670,380,mouse_left); //this will click on ore
repeat until FindBitmapToleranceIn(supheat, x, y, MIX1, MIY1, MIX2, MIY2, 30) //this will check for spellbook tab
Xp:=XP+53;
Profit:=Profit+ProfitEach;
ReportOnSmart;
end;
Here is the code. It will click on supheat spell, wait till sees the inventory, then click on the chosen ore. But sometimes it skips the click and then the bot stucks in the repeat thing. Any ideas how to solve this?
Thanks,
hunt3rx3

Brandon

2012-01-28 09:11:22

It's because smart is losing focus every time you minimize and set to the foreground.. It was fixed in 6.7.. but I have no clue what happened in 6.9..

The below should make it keep trying until the item is clicked.. then you can continue on..


while (Not ItemActivated(ItemSlot)) do
begin
MouseBox(664,390,674,403,mouse_left); //ItemToClick..
wait(1000); //Time to wait between clicks..
if (ItemActivated(ItemSlot)) then break;
end;

Shatterhand

2012-01-28 09:24:12

From: ggzz
It's because smart is losing focus every time you minimize and set to the foreground.. It was fixed in 6.7.. but I have no clue what happened in 6.9..

The below should make it keep trying until the item is clicked.. then you can continue on..


while (Not ItemActivated(ItemSlot)) do
begin
MouseBox(664,390,674,403,mouse_left); //ItemToClick..
wait(1000); //Time to wait between clicks..
if (ItemActivated(ItemSlot)) then break;
end;


That would be awesome if we had no focus losing. By the way I solved the problem, it is a good failsafe I think. What do you thinkof it?
for i:=1 to 17 do
begin

done:=False;
Tic:=0;
MarkTime(Tic);
repeat
MouseBox(664,390,674,403,mouse_left);
repeat
if FindBitmapToleranceIn(nat, x, y, MIX1, MIY1, MIX2, MIY2, 30) then done:=True;
until (done) or (TimeFromMark(Tic)>5000)
until done

done:=False;
Tic:=0;
MarkTime(Tic);
repeat
MouseBox(655,368,670,380,mouse_left);
repeat
if FindBitmapToleranceIn(supheat, x, y, MIX1, MIY1, MIX2, MIY2, 30) then done:=True;
until (done) or (TimeFromMark(Tic)>5000)
until done

Xp:=XP+53;
Profit:=Profit+ProfitEach;
ReportOnSmart;
end;

Brandon

2012-01-28 09:31:41

Hmm you might want to try compiling that and running it..