Results 1 to 7 of 7

Thread: Round Find.

  1. #1
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default Round Find.

    Helo, guys.
    I was wandering if anyone can tell me what procedure/function I suppose to use to do this task. I want the player runing the script be able to type on which load they want the character to log out. So for example lets say they wrote 5. Then, I want my script to see if the loads they did is dividable by 5. If yes, the script should logout. Make sense? So if they did 10 loads the script should find that 5 can go into 10. So it should logout.

    Can someone tell me the procedure/function to do the above task?
    Thanks.
    Faster789 aka
    Bobo

  2. #2
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    SCAR Code:
    if(NumberOfLoadsToDo mod Loads = 0) then
    begin
      Writeln('All loads completed! Switching players now.');
      Loads := 0;
      Logout;
      NextPlayer(TrueOrFalse);
    end;

    That should do the trick. Of course, you can add failsafes and other things like resetting variables, but that should be your basic outline. NumberOfLoadsToDo should be a set variable (you can use Players[x].Integers[x] if you want also) while loads is just a variable used to store the number of loads done.
    :-)

  3. #3
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Lol , sorry I meant it just to Logout and Log back in but I just found I could use this but in a different way to do the trick!

  4. #4
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I use this in for your clay softener
    SCAR Code:
    procedure istimeup;
     begin
       if (Loadsnum1 = 4) then
         begin
           Logout;
           wait(25000+random(1000));
           Loginplayer;
         end;
     end;

    Then your SoftClay procedure

    SCAR Code:
    procedure SoftClay;
    begin
      SetRun(true);
      repeat
        if (not(LoggedIn)) then Exit;
        MarkTime(running);
        SetAngle(True);
        FindFountain;
        FillBucket;
        SoftenClay;
        Walktobank;
        Bankit;
        istimeup;
        LoadsNum := LoadsNum + 1;
        i:=4;
        repeat
        if(LoadsNum > i) then
          LoadsNum1:=LoadsNum-i;
        i:=i+4;
        until(i > LoadsNum);
        ReportVars[0] := ReportVars[0] + 1;
      until LoadsNum mod LoadsPerPlayer = 0
      NextPlayer(true);
    end;

    I just watched it log out and in after 24 (Yeah, I know, I must have messed up in my math somewhere and it's not going every 4, but atleast it's something like it) loads. You could easily make that 4 a const so it'd be easy to edit it.

  5. #5
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    @ Method: I made the same mistake once
    SCAR Code:
    if(NumberOfLoadsToDo mod Loads = 0) then
    It will stop when the script starts becuase Number of loads however big it will be if it is divided by 0 then the outcome will be zero meaning it wont do any loads .

    And your question faster:
    SCAR Code:
    If NumberOfLoads > Loads then
      NextPlayer(True);

  6. #6
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    @ Method: I made the same mistake once
    SCAR Code:
    if(NumberOfLoadsToDo mod Loads = 0) then
    It will stop when the script starts becuase Number of loads however big it will be if it is divided by 0 then the outcome will be zero meaning it wont do any loads .
    That simply means that you don't use that in your script until you can be sure your player has at least 1 load completed, then.
    :-)

  7. #7
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Ok then Method, I have been pwned!!!!!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Close Round Expected?
    By Raskolnikov in forum OSR Help
    Replies: 3
    Last Post: 02-12-2008, 06:59 AM
  2. Hmm a big problem not sure if i can get round it
    By philowns in forum OSR Help
    Replies: 6
    Last Post: 07-29-2007, 06:39 PM
  3. What Close Round???
    By Erik teh Viking in forum OSR Help
    Replies: 1
    Last Post: 07-02-2007, 08:30 PM

Posting Permissions

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