SRL Archive - Help

if and else


i need to bot!

2012-03-08 16:07:25

Hey people :), i haven't been on villavu for a while, and am finally back- but i came upon a problem when using 'else'. My goal is to say 'if find this dtm, click, else, if find this other dtm, click'.. but I don't quite know how to use 'else' :'(

as in:
if FindDTM(wai1, x, y, MMX1, MMY1, MMX2, MMY2) then
Mouse (x, y, 0, 0, true);
else if FindDTM(wai2, x, y, MMX1, MMY1, MMX2, MMY2 then
Mouse (x, y, 0, 0, true);

thanks in advance :D

x[Warrior]x3500

2012-03-08 16:14:07

use this as a template


program new;
const
a=1;

begin
if (a=1) then
begin
writeln('1');
end else if (a=2) then
begin
writeln('2');
end else
begin
writeln('3');
end;
end.

Sin

2012-03-08 16:30:39

Nah, he's just missing a parentheses.

masterBB

2012-03-08 16:36:18

What parenthesis ?

if FindDTM(wai1, x, y, MMX1, MMY1, MMX2, MMY2) then
Mouse (x, y, 0, 0, true)
else if FindDTM(wai2, x, y, MMX1, MMY1, MMX2, MMY2 then
Mouse (x, y, 0, 0, true);

tehq

2012-03-08 16:38:00

From: masterBB
What parenthesis ?


else if FindDTM(wai2, x, y, MMX1, MMY1, MMX2, MMY2 then


To end the second FindDTM

Nebula

2012-03-08 16:38:43

The parentheses after MMY2

^^He said it first :(

But yeah just add the parentheses and it should work.

masterBB

2012-03-08 16:42:33

Then this one needed two fixes ;)

if FindDTM(wai1, x, y, MMX1, MMY1, MMX2, MMY2) then
Mouse (x, y, 0, 0, true) //removed ;
else if FindDTM(wai2, x, y, MMX1, MMY1, MMX2, MMY2) then //added )
Mouse (x, y, 0, 0, true);

i need to bot!

2012-03-08 16:56:06

thanks :D just needed to get rid of the ';' after mouse xD