Results 1 to 7 of 7

Thread: Issue with loop..

  1. #1
    Join Date
    Mar 2008
    Posts
    426
    Mentioned
    1 Post(s)
    Quoted
    116 Post(s)

    Default Issue with loop..

    Code:
    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..

    :|
    Last edited by Peanuts; 05-28-2013 at 06:02 PM.

  2. #2
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

    Default

    Quote Originally Posted by Peanuts View Post
    Code:
    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?

  3. #3
    Join Date
    Mar 2008
    Posts
    426
    Mentioned
    1 Post(s)
    Quoted
    116 Post(s)

    Default

    Quote Originally Posted by Kevin View Post
    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

    THX MAN!
    Last edited by Peanuts; 05-28-2013 at 06:08 PM.

  4. #4
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Simba Code:
    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.

  5. #5
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

    Default

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

  6. #6
    Join Date
    Mar 2008
    Posts
    426
    Mentioned
    1 Post(s)
    Quoted
    116 Post(s)

    Default

    Quote Originally Posted by Kevin View Post
    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.

  7. #7
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

    Default

    Quote Originally Posted by Peanuts View Post
    Kevin!
    Genius!
    Haha....
    I did exactly that.. forgot about putting a result = .. Or maybe I deleted it at some point.. Not sure.
    Good to know it helped!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •