SRL Archive - OSR Help

Issue with loop..


Peanuts

2013-05-28 13:54:29

procedure MineGems;

begin
GemCount := InvCount + 1;


if InvFull then
begin
end;

if not FindGems then
begin
writeln('none left');
ChangeWorld(RandomWorld(True, false));
Wait(1000);
end;
FindGems;


Wait(50);


end;

If i dont have the 'if not find ' it will work.. till its all mined..
If i have it on.. It will mine once and thn try to world hop..

:|

Kevin

2013-05-28 13:59:34

From: Peanuts
procedure MineGems;

begin
GemCount := InvCount + 1;


if InvFull then
// add
if not FindGems then
begin
writeln('none left');
ChangeWorld(RandomWorld(True, false));
Wait(1000);
end;
FindGems;


Wait(50);


end;

If i dont have the 'if not find ' it will work.. till its all mined..
If i have it on.. It will mine once and thn try to world hop..

:|


Just for coding standards' sake, try throwing a begin..end around the portion of code the Invfull should affect and see what happens?

Peanuts

2013-05-28 14:02:24

From: Kevin
Just for coding standards' sake, try throwing a begin..end around the portion of code the Invfull should affect and see what happens?


It wasn't that..
The actual script had a begin / end there

But you made me realize its prob to do with my messy code..

Found and fixed :D

THX MAN!

Kasi

2013-05-28 14:08:19


procedure MineGems;
begin
GemCount := InvCount + 1;
if InvFull then
begin

end else
if not FindGems then
begin
writeln('none left');
ChangeWorld(RandomWorld(True, false));
Wait(1000);
end;
Wait(50);
end;


Please use standards, reading code which isn't standardize makes me crazy.

Kevin

2013-05-28 14:08:25

I see, now with this logic, I would by defualt assume your FindGems method isn't returning true when it should be.

Peanuts

2013-05-28 14:18:47

From: Kevin
I see, now with this logic, I would by defualt assume your FindGems method isn't returning true when it should be.


Kevin!
Genius!
Haha….
I did exactly that.. forgot about putting a result = .. Or maybe I deleted it at some point.. Not sure.

Kevin

2013-05-28 14:33:03

From: Peanuts
Kevin!
Genius!
Haha….
I did exactly that.. forgot about putting a result = .. Or maybe I deleted it at some point.. Not sure.


:D Good to know it helped!