SRL Archive - Help

need script help


farseer

2012-05-10 22:54:04

well,im pretty new started learn simba script and i just wanna banking all my oak logs but somehow won't work:

Procedure bankking;
var
x, y:Integer;
begin
//Deposit OAK LOGS
if BankScreen then
begin
if FindColorTolerance(x, y, 3958151, MIX1, MIY1, MIX2, MIY2, 20) then
begin
Writeln('Found OAK LOGS');
Mouse(x, y, 0, 0, false);
WaitOptionMulti(['posit','All'], 300);
end else;
Writeln('no OAK logs')
Exit;
end;
end;

the debug box show:
fond oak logs but do nothing just get stuck,pretty stupid question but help me alot .

CephaXz

2012-05-10 23:15:08

Try

Mouse(x, y, 0, 0, mouse_right);
WaitOptionMulti(['posit','All'], 3000);

You could also add a check on uptext.
If it doesn't do the job again, its probably because the color and tolerance is wrong. It might be finding other things instead of logs.

Runaway

2012-05-10 23:18:37


Procedure bankking;
var
x, y:Integer;
begin
//Deposit OAK LOGS
if BankScreen then
begin
if FindColorTolerance(x, y, 3958151, MIX1, MIY1, MIX2, MIY2, 20) then
begin
Writeln('Found OAK LOGS');
Mouse(x, y, 0, 0, false);
WaitOptionMulti(['posit','All'], 300);
end else
begin
Writeln('no OAK logs');
Exit;
end;
end;
end;

I don't think this is the error, but you should not have a semi-colon after the end else, and you need a begin/end after the end else also. I fixed it for you above.

If that's not the reason it didn't work, try increasing the WaitOptionMulti() time.

CephaXz

2012-05-10 23:25:46

From: Runaway

Procedure bankking;
var
x, y:Integer;
begin
//Deposit OAK LOGS
if BankScreen then
begin
if FindColorTolerance(x, y, 3958151, MIX1, MIY1, MIX2, MIY2, 20) then
begin
Writeln('Found OAK LOGS');
Mouse(x, y, 0, 0, false);
WaitOptionMulti(['posit','All'], 300);
end else
begin
Writeln('no OAK logs');
Exit;
end;
end;
end;

I don't think this is the error, but you should not have a semi-colon after the end else, and you need a begin/end after the end else also. I fixed it for you above.

If that's not the reason it didn't work, try increasing the WaitOptionMulti() time.


Didn't realize that because of the standards, messed up my mind :duh:

farseer

2012-05-11 01:40:09

Thanks your guys,thanks so much.
I fixed it.

Le Jingle

2012-05-11 01:57:48

Well if you have your hatchet equipped, you could do:

Procedure bankking;
var
x, y:Integer;
begin
if BankScreen then
DepositAll() // Found & Deposited
else
Exit; // Didn't have any oak logs
end;

Let me know if it works, + hope this helps if it does

farseer

2012-05-11 03:46:03

From: Le Jingle
Well if you have your hatchet equipped, you could do:

Procedure bankking;
var
x, y:Integer;
begin
if BankScreen then
DepositAll() // Found & Deposited
else
Exit; // Didn't have any oak logs
end;

Let me know if it works, + hope this helps if it does


Already figure it out,still many thanks all of you.