Results 1 to 3 of 3

Thread: Silly Wavy Wait Times

  1. #1
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default Silly Wavy Wait Times

    This makes your wait times all silly and wavy.
    Simba Code:
    procedure SineWait(const min, max: Int32);
    const
      R1 = 0.15; //range of the small waves
      R2 = 0.85; //range of the large waves (Note: R1 + R1 = 1.0
      P1 = 4.00; //period of the small waves in minutes
      P2 = 60.0; //period of the large waves in minutes
    var
      t, r: Extended;
    begin
      if (max <= min) then Exit;
      if ((R1 + R2) <> 1.0) then Exit;
      t := (GetTimeRunning() / 60000);
      r := ((max - min) / 2);
      Wait(Round(R1 * r * Sin(2 * PI * t / P1) + R2 * r * Sin(2 * PI * t / P2) + min + r));
    end;
    With the above settings, your wait times will look like this over the course of an hour.



    Here's a little program to help visualize what final result will look like, where each pixel of width is 6 seconds.
    Simba Code:
    program sinewait_demo;

    function SineWaitDemo(const min, max, x: Int32): Int32;
    const
      R1 = 0.15; //range of the small waves
      R2 = 0.85; //range of the large waves (Note: R1 + R1 must be 1.0
      P1 = 4.00; //period of the small waves in minutes
      P2 = 60.0; //period of the large waves in minutes
    var
      t, r: Extended;
    begin
      if (max <= min) then Exit;
      if ((R1 + R2) <> 1.0) then Exit;
      t := (x / 10);
      r := ((max - min) / 2);
      Result := Round(R1 * r * Sin(2 * PI * t / P1) + R2 * r * Sin(2 * PI * t / P2) + min + r);
    end;

    procedure Demo();
    const
      W = 600;
      H = 300;
    var
      bmp, x, y: Int32;
    begin
      bmp := CreateBitmap(W, H);
      try
        for x := 0 to W-1 do
        begin
          y := SineWaitDemo(0, H-1, x);
          FastSetPixel(bmp, x, H-1 - y, $FFFFFF);
        end;
        ClearDebugImg();
        DisplayDebugImgWindow(W, H);
        DrawBitmapDebugImg(bmp);
      finally
        FreeBitmap(bmp);
      end;
    end;

    begin
      ClearDebug;
      Demo();
    end.

  2. #2
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

  3. #3
    Join Date
    Nov 2018
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    100 Mil OSRS Gold=$55.99 (delivery in 5 minutes,accept creditcard and paypal
    b t c n g a m e . c o m

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
  •