SRL Archive - General Botting Help

If then statement running even though if is false


gamingvexation

2014-10-20 19:57:42

begin
repeat
If GetColor(696, 406) = 9800975 Then

Wait(3000);

PressKey(13);

SendKeys('Selling Life 1:8 Def!', 155, 30);

PressKey(13);

Until(GetColor(809, 584) = 16777215);

repeat



This is the part I'm having an issue with. The getcolor is the wrong color, but it's still running everything below it. How do I prevent it from doing this and move on to the next part?

Olly

2014-10-20 20:01:27

'Then' will only run the line under it, so if the color is found it will wait 3 seconds and then do the rest. what you need to do is put the other functions in a begin..end

If findcolor() then
Begin
//stuff I want to happen
End;

On phone so best response I can give :d

gamingvexation

2014-10-20 20:05:34

It's all good, I figured it out regardless :D Thank you for your help though :)

And phones+forums=irritability :D

Kyle

2014-10-20 20:07:53

To expand on what @Olly; said since he is on his phone:

if findColor() then
writeln('Color found');
writeln('I will run even if color isn''t found!!');


if findColor() then
begin
writeln('Color found');
writeln('I will only run if color is found!!');
end;

This is one of the main reasons why using proper standards and "tabing" after a begin or a loop/if then, is so important, makes it much easier to see what is going on!

EDIT:Ninja'd by OP :'(