SRL Archive - OSR Help

Clicking Problem


Striken

2012-05-12 00:41:49

Today I have tried many times to try to fix up my script which doesn't seem to mine but it hovers over the ore in which I select. It only hovers but doesn't click on it.

 1:
begin
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
Wait(250+random(500));

FindNormalRandoms;
if FindCopper(x, y) then
begin
MMouse(x, y, 0, 0);
if IsUpText('ine') then
Writeln('Found Ore');
Wait(150+random(50));
if IsUpText('ine') then
Mouse(x, y, 5, 5, True);
Wait(10+random(25));

end else Writeln('Cannot Find Ore');
repeat
until(InvFull);

nickrules

2012-05-12 00:58:01

Oh boy skippy, I love these issues!

this is basically what you've got, but indented "correctly"

begin
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
Wait(250+random(500));

FindNormalRandoms;
if FindCopper(x, y) then
begin
MMouse(x, y, 0, 0);
if IsUpText('ine') then
Writeln('Found Ore');
Wait(150+random(50));
if IsUpText('ine') then
Mouse(x, y, 5, 5, True);
Wait(10+random(25));

end else Writeln('Cannot Find Ore');
repeat
until(InvFull);

There are a few things wrong, which would explain your issues here.

If you use an if..then statement, and you want to do several lines of stuff if that if..then statement is true, then you must use begins and ends.

If you do that right, it'd probably look something like this:
begin
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
Wait(250+random(500));

FindNormalRandoms;
if FindCopper(x, y) then
begin
MMouse(x, y, 0, 0);
if IsUpText('ine') then
begin
Writeln('Found Ore');
Wait(150+random(50));
if IsUpText('ine') then
begin
Mouse(x, y, 5, 5, True);
Wait(10+random(25));
end;
end;
end else
begin
Writeln('Cannot Find Ore');
end;

repeat
until(InvFull);

Now, debugging time!

begin
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
Wait(250+random(500));

FindNormalRandoms;
if FindCopper(x, y) then
begin
writeln('FindCopper Resulted true!');
MMouse(x, y, 0, 0);
if IsUpText('ine') then
begin
Writeln('FindCopper resulted true, and the uptext is a match!');
Wait(150+random(50));
if IsUpText('ine') then
begin
writeln('FindCopper resulted true, the uptext is a match, and (for some reason we checked again, but we don''t need to) the uptext check still matches!');
Mouse(x, y, 5, 5, True);
Wait(10+random(25));
end;
end;
end else
begin
Writeln('Cannot Find Ore');
end;

repeat
until(InvFull);

using this, you can figure out where it's going "wrong"

Basically, each line will only be written IF the if..then is true - which means, if it isn't there's your issue.

So, if the debug were to say this:
FindCopper Resulted true!
and nothing else, that means that the uptext didn't match.

Also, you check the uptext twice, when you don't need to.
Also, clickmouse2(x,y,mouse_left) will leftclick right where the mouse is (so you don't move it)

Striken

2012-05-12 01:04:18

From: nickrules
Oh boy skippy, I love these issues!

this is basically what you've got, but indented "correctly"

begin
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
Wait(250+random(500));

FindNormalRandoms;
if FindCopper(x, y) then
begin
MMouse(x, y, 0, 0);
if IsUpText('ine') then
Writeln('Found Ore');
Wait(150+random(50));
if IsUpText('ine') then
Mouse(x, y, 5, 5, True);
Wait(10+random(25));

end else Writeln('Cannot Find Ore');
repeat
until(InvFull);

There are a few things wrong, which would explain your issues here.

If you use an if..then statement, and you want to do several lines of stuff if that if..then statement is true, then you must use begins and ends.

If you do that right, it'd probably look something like this:
begin
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
Wait(250+random(500));

FindNormalRandoms;
if FindCopper(x, y) then
begin
MMouse(x, y, 0, 0);
if IsUpText('ine') then
begin
Writeln('Found Ore');
Wait(150+random(50));
if IsUpText('ine') then
begin
Mouse(x, y, 5, 5, True);
Wait(10+random(25));
end;
end;
end else
begin
Writeln('Cannot Find Ore');
end;

repeat
until(InvFull);

Now, debugging time!

begin
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
Wait(250+random(500));

FindNormalRandoms;
if FindCopper(x, y) then
begin
writeln('FindCopper Resulted true!');
MMouse(x, y, 0, 0);
if IsUpText('ine') then
begin
Writeln('FindCopper resulted true, and the uptext is a match!');
Wait(150+random(50));
if IsUpText('ine') then
begin
writeln('FindCopper resulted true, the uptext is a match, and (for some reason we checked again, but we don''t need to) the uptext check still matches!');
Mouse(x, y, 5, 5, True);
Wait(10+random(25));
end;
end;
end else
begin
Writeln('Cannot Find Ore');
end;

repeat
until(InvFull);

using this, you can figure out where it's going "wrong"

Basically, each line will only be written IF the if..then is true - which means, if it isn't there's your issue.

So, if the debug were to say this:
FindCopper Resulted true!
and nothing else, that means that the uptext didn't match.

Also, you check the uptext twice, when you don't need to.
Also, clickmouse2(x,y,mouse_left) will leftclick right where the mouse is (so you don't move it)


No wonder….I totally forgot about that :duh:
Rep+