SRL Archive - Help

Why doesn't this work (Similar to my previous thread?)


Daher

2012-08-20 12:07:59

So i tried to make my script do another task if it can't find a color, now it seems to give me a FUCKING ERROR EVERYTIME I TRY THIS…

end else
Is the error WHY!?!?!?

var
x, y, w, h: integer;
begin
GetClientDimensions(w, h);
if FindColor(x, y, 1872300, 0, 0, w - 1, h - 1) then
Mouse(x, y, 0, 0, True);
begin
loot := (loot + 1);
if FindColor(x, y, COLOR, 0, 0, w - 1, h - 1) then
Mouse(x, y, 0, 0, True);
wait(3000)
end else
Mouse(1103, 426, 0, 0, True);
wait(500);
Mouse(928, 482, 0, 0, True);
wait(15000)
Mouse(1010, 282, 0, 0, True);
wait(3000)
end;

Flight

2012-08-20 12:11:56

I can help ya out bud, what's the error you're getting when you try to compile?

Edit:
If I may suggest, you can use
['/simba] tags for stuff like this rather than [code]['/code].

footballjds

2012-08-20 12:26:22

The issue appears to be the logic you're using with end else. Let me explain how you should be using it so you can fix your code.



program new;
begin
if Random(10) > 5 then
begin
//procedures
writeln(GetSystemTime);
end else
begin
//more fucking procedures
writeln('bitch please');
end;
end.

I would just fix your procedure but I'm not sure what your trying to do so I don't know the proper logic.
However, I can tell you this. You need to place the begin directly after the if/then or else it acts as a dummy begin.

EDIT: if you upload your entire script I can fix the logic for the code you posted.

Daher

2012-08-20 13:12:40

From: footballjds
The issue appears to be the logic you're using with end else. Let me explain how you should be using it so you can fix your code.



program new;
begin
if Random(10) > 5 then
begin
//procedures
writeln(GetSystemTime);
end else
begin
//more fucking procedures
writeln('bitch please');
end;
end.

I would just fix your procedure but I'm not sure what your trying to do so I don't know the proper logic.
However, I can tell you this. You need to place the begin directly after the if/then or else it acts as a dummy begin.

EDIT: if you upload your entire script I can fix the logic for the code you posted.


program SilkStealer;
{.include SRL/SRL.simba}

const
COLOR = 1816341;
AMOUNT = 24000;

var
loot, money: Integer;

procedure StealSilk;
var
x, y, w, h: integer;
begin
GetClientDimensions(w, h);
if FindColor(x, y, 1872300, 0, 0, w - 1, h - 1) then
Mouse(x, y, 0, 0, True);
begin
loot := (loot + 1);
if FindColor(x, y, COLOR, 0, 0, w - 1, h - 1) then
Mouse(x, y, 0, 0, True);
wait(3000)
end else
Mouse(1103, 426, 0, 0, True);
wait(500);
Mouse(928, 482, 0, 0, True);
wait(15000)
Mouse(1010, 282, 0, 0, True);
wait(3000)
end;
procedure Proggy;
begin
Writeln('');
Writeln('********************************');
Writeln('Thanks for using my script!');
Writeln('We have stolen: ' + IntToStr(loot) + ' loot');
Writeln('We have stolen: ' + IntToStr(money) + ' money');
Writeln('********************************');
Writeln('Much credit to abu_jwka for helping me script most of it!') Writeln('');
end;

begin
ClearDebug;
SetUpSRL;
AddOnTerminate('Proggy');
repeat
ClearDebug;
StealSilk;
money := (loot * AMOUNT);
until (IsKeyDown(114));
end.

footballjds

2012-08-20 13:18:14

program SilkStealer;
{.include SRL/SRL.simba}

const
COLOR = 1816341;
AMOUNT = 24000;

var
loot, money: Integer;

procedure StealSilk;
var
x, y, w, h: integer;
begin
GetClientDimensions(w, h);
if FindColor(x, y, 1872300, 0, 0, w - 1, h - 1) then
begin
Mouse(x, y, 0, 0, True);
loot := (loot + 1);
if FindColor(x, y, COLOR, 0, 0, w - 1, h - 1) then
begin
Mouse(x, y, 0, 0, True);
wait(3000)
end else
begin
Mouse(1103, 426, 0, 0, True);
wait(500);
Mouse(928, 482, 0, 0, True);
wait(15000)
Mouse(1010, 282, 0, 0, True);
wait(3000)
end;
end;
end;
procedure Proggy;
begin
Writeln('');
Writeln('********************************');
Writeln('Thanks for using my script!');
Writeln('We have stolen: ' + IntToStr(loot) + ' loot');
Writeln('We have stolen: ' + IntToStr(money) + ' money');
Writeln('********************************');
Writeln('Much credit to abu_jwka for helping me script most of it!') Writeln('');
end;

begin
ClearDebug;
SetUpSRL;
AddOnTerminate('Proggy');
repeat
ClearDebug;
StealSilk;
money := (loot * AMOUNT);
until (IsKeyDown(114));
end.

you're welcome.

Daher

2012-08-20 13:31:10

From: footballjds
program SilkStealer;
{.include SRL/SRL.simba}

const
COLOR = 1816341;
AMOUNT = 24000;

var
loot, money: Integer;

procedure StealSilk;
var
x, y, w, h: integer;
begin
GetClientDimensions(w, h);
if FindColor(x, y, 1872300, 0, 0, w - 1, h - 1) then
begin
Mouse(x, y, 0, 0, True);
loot := (loot + 1);
if FindColor(x, y, COLOR, 0, 0, w - 1, h - 1) then
begin
Mouse(x, y, 0, 0, True);
wait(3000)
end else
begin
Mouse(1103, 426, 0, 0, True);
wait(500);
Mouse(928, 482, 0, 0, True);
wait(15000)
Mouse(1010, 282, 0, 0, True);
wait(3000)
end;
end;
end;
procedure Proggy;
begin
Writeln('');
Writeln('********************************');
Writeln('Thanks for using my script!');
Writeln('We have stolen: ' + IntToStr(loot) + ' loot');
Writeln('We have stolen: ' + IntToStr(money) + ' money');
Writeln('********************************');
Writeln('Much credit to abu_jwka for helping me script most of it!') Writeln('');
end;

begin
ClearDebug;
SetUpSRL;
AddOnTerminate('Proggy');
repeat
ClearDebug;
StealSilk;
money := (loot * AMOUNT);
until (IsKeyDown(114));
end.

you're welcome.


end;
end;
end;

Thanks lol.