SRL Archive - Help

Why does this always eat?


KeepBotting

2012-07-04 18:42:41

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

2012-07-04 18:48:28

Edited OP, I really DO need help now…

Tniffoc

2012-07-05 11:22:52

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

2012-07-05 11:25:03

From: Tniffoc
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

2012-07-05 11:36:06

From: Tniffoc
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

2012-07-05 11:37:04

From: chig
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

2012-07-05 11:37:10

From: KeepBotting
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

2012-07-05 11:38:23

I was expecting to see this when I clicked on this…


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

KeepBotting

2012-07-05 11:38:25

From: Tniffoc
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?


From: Joe
I was expecting to see this when I clicked on this…


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…