Results 1 to 11 of 11

Thread: procedure HoldTimer(H, M, S: Integer; OnTimer: procedure);

  1. #1
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default procedure HoldTimer(H, M, S: Integer; OnTimer: procedure);

    Place in SRL\SRL\Core\Timing.scar:
    scar Code:
    procedure HoldTimer(H, M, S: Integer; OnTimer: procedure);
    var
      MS: Integer;
    begin
      MS := GetTimeRunning + (H * 60 * 60 * 1000) + (M * 60 * 1000) + (S * 1000);
      while (MS > GetTimeRunning) do
        OnTimer();
    end;

    What does this do? Instead of waiting every X milliseconds it can wait hours, minutes and seconds.. Also, while it is stopping the time, you can let it call the procedure OnTimer.

    This may or may not be useful, but i made this a while back and found it sitting in my scripts directory

    Have fun
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  2. #2
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    =p it looks neat.

    i smell a farming script?
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  3. #3
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Wink

    Quote Originally Posted by Awkwardsaw View Post
    =p it looks neat.

    i smell a farming script?
    Sorry, not P2P

    BTW, could this be used in Farming?
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  4. #4
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You should add a wait in the loop to avoid lagging. At least a Wait(15).


  5. #5
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    yes, like after you go through your runs, set the amount of time to wait, and log back in to do it over.
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  6. #6
    Join Date
    Jul 2008
    Location
    England
    Posts
    763
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I would get rid if OnTimer() and put SRL_Procs[srl_AntiBan]()

    SCAR Code:
    procedure HoldTimer(H, M, S: Integer);
    var
      MS: Integer;
    begin
      MS := GetTimeRunning + (H * 60 * 60 * 1000) + (M * 60 * 1000) + (S * 1000);
      while (MS > GetTimeRunning) do
        if SRL_Procs[srl_AntiBan] <> nil then
         SRL_Procs[srl_AntiBan]();
    end;
    lol

  7. #7
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by Cazax View Post
    You should add a wait in the loop to avoid lagging. At least a Wait(15).
    Hasn't lagged for me at all during my testing

    Quote Originally Posted by Awkwardsaw View Post
    yes, like after you go through your runs, set the amount of time to wait, and log back in to do it over.
    Oh kewl.

    Quote Originally Posted by Quickmarch View Post
    I would get rid if OnTimer() and put SRL_Procs[srl_AntiBan]()

    SCAR Code:
    procedure HoldTimer(H, M, S: Integer);
    var
      MS: Integer;
    begin
      MS := GetTimeRunning + (H * 60 * 60 * 1000) + (M * 60 * 1000) + (S * 1000);
      while (MS > GetTimeRunning) do
        if SRL_Procs[srl_AntiBan] <> nil then
         SRL_Procs[srl_AntiBan]();
    end;
    So you would want it to do AntiBan every single millisecond? For one, i wouldn't like that
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  8. #8
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Quickmarch View Post
    I would get rid if OnTimer() and put SRL_Procs[srl_AntiBan]()
    That kinda kills the idea of the procedure. The idea is that the user can choose the procedure, it doesn't always have to be antiban. Besides, everyone makes their own antiban procedures.

  9. #9
    Join Date
    Jul 2008
    Location
    England
    Posts
    763
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Dan's The Man View Post
    Hasn't lagged for me at all during my testing


    Oh kewl.


    So you would want it to do AntiBan every single millisecond? For one, i wouldn't like that
    You could put a WaitTime parameter and in the loop put Wait(WaitTime); - Just a suggestion.
    lol

  10. #10
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by Quickmarch View Post
    You could put a WaitTime parameter and in the loop put Wait(WaitTime); - Just a suggestion.
    Meh, the users can do what they want with it if they implement it into their scripts. Or, if the devs can modify it to their hearts content if they do add it to SRL
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  11. #11
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    i like the wait thing

    how about a different version of this, but instead of doing a procedure for a set amount of time, make it wait a set amount of time and then do the said procedure
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

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
  •