Log in

View Full Version : Why does this always eat?



KeepBotting
07-04-2012, 10:42 PM
procedure HPCheck; //I got this procedure from LaakeRules.
var i: Integer; //And I think he got it from Home.
begin
WriteLn('Checking HP!');
if (HPPercent < 70) then
begin
WriteLn('Our HP is below 70%! We need to eat!');
for i := 1 to 28 do
if ExistsItem(i) then
InvMouse(I, 3);
if IsUpText('at Lob') then
begin
ClickMouse2(True);
Wait(RandomRange(350, 525));
exit;
end;
end;
end;

I put HPPercent < 70 in there, but it still eats even if I'm at full hp, what am I doing wrong?

KeepBotting
07-04-2012, 10:48 PM
Edited OP, I really DO need help now...

Tniffoc
07-05-2012, 03:22 PM
Sorry, I couldn't help but fix the standards. If you indent like this, you won't misplace a begin again.

procedure HPCheck;
var
i: Integer;
begin
WriteLn('Checking HP!');
if (HPPercent < 70) then
begin
WriteLn('Our HP is below specified level! We need to eat!');
for i := 1 to 28 do
if ExistsItem(i) then
InvMouse(I, 3);
if IsUpText('at Lob') then
begin
ClickMouse2(True);
Wait(RandomRange(350, 525));
exit;
end;
end;
end;

KeepBotting
07-05-2012, 03:25 PM
Sorry, I couldn't help but fix the standards. If you indent like this, you won't misplace a begin again.

procedure HPCheck;
var
i: Integer;
begin
WriteLn('Checking HP!');
if (HPPercent < 70) then
begin
WriteLn('Our HP is below specified level! We need to eat!');
for i := 1 to 28 do
if ExistsItem(i) then
InvMouse(I, 3);
if IsUpText('at Lob') then
begin
ClickMouse2(True);
Wait(RandomRange(350, 525));
exit;
end;
end;
end;
Is there something I can do to help myself learn the indenting? :( people keep bugging me about it.

Recursive
07-05-2012, 03:36 PM
Sorry, I couldn't help but fix the standards. If you indent like this, you won't misplace a begin again.

procedure HPCheck;
var
i: Integer;
begin
WriteLn('Checking HP!');
if (HPPercent < 70) then
begin
WriteLn('Our HP is below specified level! We need to eat!');
for i := 1 to 28 do
if ExistsItem(i) then
InvMouse(I, 3);
if IsUpText('at Lob') then
begin
ClickMouse2(True);
Wait(RandomRange(350, 525));
exit;
end;
end;
end;


Is there an automatic way to indent in simba? I know in cpp, you just ctrl+A and Ctrl+I to indent all

KeepBotting
07-05-2012, 03:37 PM
is there an automatic way to indent in simba? I know in cpp, you just ctrl+a and ctrl+i to indent all
cpp = c++?

Tniffoc
07-05-2012, 03:37 PM
Is there something I can do to help myself learn the indenting? :( people keep bugging me about it.

Well its pretty simple. You just indent the things in between the begins and ends and after statements to show what code is actually done by an if statement or loop or other statement. I think you could catch on pretty quickly if you took a look at what I did to your code.

Joe
07-05-2012, 03:38 PM
I was expecting to see this when I clicked on this...
http://4.bp.blogspot.com/-SwgnZmmmc9c/Tt5SR8mMLNI/AAAAAAAAFLs/DVM-49qGvKo/s400/Fat+American.jpg


but you have the wrong <
you are saying that if the health is over 70 then eat....

KeepBotting
07-05-2012, 03:38 PM
Well its pretty simple. You just indent the things in between the begins and ends and after statements to show what code is actually done by an if statement or loop or other statement. I think you could catch on pretty quickly if you took a look at what I did to your code.Yeah but I don't like indenting ^.^ because it makes my code look like it has a big ass or something. I once saw a friend use a program called PascalIndent for Windows, will that work for Simba code?



I was expecting to see this when I clicked on this...
http://4.bp.blogspot.com/-SwgnZmmmc9c/Tt5SR8mMLNI/AAAAAAAAFLs/DVM-49qGvKo/s400/Fat+American.jpg


but you have the wrong <
you are saying that if the health is over 70 then eat....
Orly? Wow, okay. Thanks.

Edited OP, I really DO need help now...