Results 1 to 6 of 6

Thread: Is there a way to...

  1. #1
    Join Date
    Feb 2013
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Is there a way to...

    I've looked everywhere I can think of on these forums, and I cannot find the answer so now i'm asking you guys.

    Is there a way to set up an action so it will only execute a specific number of times before terminating?

    i.e withdrawing 10 items from bank, or buying 10 items from a store, chopping 10 trees, mining 10 ores?

  2. #2
    Join Date
    Oct 2012
    Posts
    758
    Mentioned
    6 Post(s)
    Quoted
    282 Post(s)

    Default

    What exactly are you trying to do?
    Yes you can withdraw 10 items from the bank if you looked at the include you would see how the function WithdrawEx works.
    On the other hand, chopping 10 trees or mining 10 ores is completely different.
    I would go about this by creating some sort of loop. Then everytime you chop a tree or mine an ore you can increase an integer variable within that loop. Make it loop through your loopy loopdi loop loop loopness (sorry ) until your integer has reached a certain value.
    Looking at InvCount might be easier though in that case.
    May I ask what exactly you're trying to do?

  3. #3
    Join Date
    Jul 2012
    Posts
    437
    Mentioned
    10 Post(s)
    Quoted
    165 Post(s)

    Default

    it a for loop

    Simba Code:
    procedure ForToDoExample;
    var
      i: Integer;
    begin
      for i := 1 to 10 do // Notice the assignment mentioned earlier?  The assignment is the ":="
      begin
        Wait(500);
        WriteLn('The variable i = ' + IntToStr(i));
      end;
    end;
    heres a tutorial look at the loops section
    http://villavu.com/forum/showthread.php?t=58935

  4. #4
    Join Date
    Feb 2013
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ahh that makes a lot sense thanks.

    I'm trying to make a script where it purchases feathers, goes and fishes, banks, and repeats buying the feathers. The issue was arrising when buying feathers as the price goes up quite significantly as they are being bought.

  5. #5
    Join Date
    Oct 2012
    Posts
    758
    Mentioned
    6 Post(s)
    Quoted
    282 Post(s)

    Default

    Quote Originally Posted by bob_saget View Post
    it a for loop

    Simba Code:
    procedure ForToDoExample;
    var
      i: Integer;
    begin
      for i := 1 to 10 do // Notice the assignment mentioned earlier?  The assignment is the ":="
      begin
        Wait(500);
        WriteLn('The variable i = ' + IntToStr(i));
      end;
    end;
    heres a tutorial look at the loops section
    http://villavu.com/forum/showthread.php?t=58935
    Can be, but doesn't have to. You can use any loop all loop loopiness looop di doooopie looop nooopie dooopie works

  6. #6
    Join Date
    Feb 2013
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah I got that part working as intended now =D thanks for you're help, now to code the rest

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
  •