Results 1 to 23 of 23

Thread: MarkTime

  1. #1
    Join Date
    Apr 2012
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default MarkTime

    Hey,
    i got a problem with MarkTime and TimeFromMark...

    What i want to do: if Button X is pressed the counter should start. Next time x needed to be pressed it should check if timer is running for more then 5 seconds (cooldown). and after that it should reset the timer to 0. heres what i got:

    Simba Code:
    begin
        MarkTimer(t);
        If (TimeFromMark(t) > 5000) Then
        begin
        SendKeys('1', 100, 30);
        t:= 0;
        end else
        Wait(50);
    end;

    Thanks
    Last edited by schnubbel15; 12-01-2012 at 12:36 AM.

  2. #2
    Join Date
    Nov 2008
    Location
    Norway, Alesund
    Posts
    924
    Mentioned
    0 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by schnubbel15 View Post
    Hey,
    i got a problem with MarkTime and TimeFromMark...

    What i want to do: if Button X is pressed the counter should start. Next time x needed to be pressed it should check if timer is running for more then 5 seconds (cooldown). and after that it should reset the timer to 0. heres what i got:

    Simba Code:
    begin
        MarkTimer(t);
        If (TimeFromMark(t) > 5000) Then
        begin
        SendKeys('1', 100, 30);
        t:= 0;
        end else
        Wait(50);
    end;
    Thanks
    Use SIMBA TAGS! :X

    EDIT: I guess that's what you wanted.
    Simba Code:
    begin
        MarkTimer(t);
        Repeat
            SendKeys('1', 100, 30);
        Until(TimeFromMark(t) > 5000);  
        t:= 0;
    end;

  3. #3
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    I don't understand your concept...

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  4. #4
    Join Date
    Apr 2012
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    its just the procedure which i cant get to work.. just want to know how exactly MarkFromTime and TimeMark works and how i can reset it :/

  5. #5
    Join Date
    Nov 2008
    Location
    Norway, Alesund
    Posts
    924
    Mentioned
    0 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by schnubbel15 View Post
    its just the procedure which i cant get to work.. just want to know how exactly MarkFromTime and TimeMark works and how i can reset it :/
    I edited, my first post check it out or that's what you wanted?

  6. #6
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    I don't think so. Hey nubbel, use this:
    Simba Code:
    Procedure Checker;
    Var
            t:integer;
    Begin
    if (isKeyDown(88)) then
        MarkTime(t); //lol
    repeat
    Until (isKeyDown(88));
    If (TimeFromMark(t) > 5000) Then
      begin
        SendKeys('1', 100, 30);
        t:= 0;
      end
    else
      Wait(50);
    End;

    I think that should do it, try it just in case.
    Last edited by Rezozo; 12-01-2012 at 12:47 AM.

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  7. #7
    Join Date
    Apr 2012
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    not exactly, i want it the other way, it should start WHEN the timer is over 5 seconds :/ and 1 more question is a timer always a global timer? will it continue to count the time when i am in another procedure? (sorry for my bad english :P)

  8. #8
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Isn't it "MarkTime(t)"?

  9. #9
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    Check out mine, or wait, are you referring to mine?
    Technically, yes, timer is a global timer, and can be used in other procedures, while still counting the seconds, and give the correct output. But remember, if you use MarkTime(t); The t must be a global variable, or it wont work outside the procedure.
    ~Rez

    Edit: Ooh, didn't notice that BMWXi, nice catch.

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  10. #10
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Simba Code:
    var
      t: integer; // declared "globally," meaning the entirety of the file has access to integer, t.

    procedure something;
    var
      tt: integer;  // declared "locally," meaning integer tt can only be used within this procedure
    begin
      marktime(tt); // only marks integer tt to 0 milliseconds
      repeat
        wait(1000+random(100));
      until(TimeFromMark(tt) > 5000);
      // above loop will wait until the marked time, tt, is greater than 5000 ms.
    end;

    begin
      something;
    end.

    ^ to provide an example

  11. #11
    Join Date
    Apr 2012
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    mhm, i dont really get your code

    this is what i think it should look like...(doesnt work)

    Simba Code:
    begin
        MarkTime(t);
        Repeat
            SendKeys('1', 100, 30);
        Until(TimeFromMark(t) < 2000);
        t:= 0;
    end;

  12. #12
    Join Date
    Nov 2008
    Location
    Norway, Alesund
    Posts
    924
    Mentioned
    0 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by Rezozo View Post
    I don't think so. Hey nubbel, use this:
    Simba Code:
    Procedure Checker;
    Var
            t:integer;
    Begin
    if (isKeyDown(88)) then
        MarkTime(t); //lol
    repeat
    Until (isKeyDown(88));
    If (TimeFromMark(t) > 5000) Then
      begin
        SendKeys('1', 100, 30);
        t:= 0;
      end
    else
      Wait(50);
    End;

    I think that should do it, try it just in case.
    I did copy paste from his code my bad.

  13. #13
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    @schnubbel
    You need t to be declared as an integer:
    Simba Code:
    Var
      t:Integer;

  14. #14
    Join Date
    Apr 2012
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    yea i know, i have it its just a cut out, but when i run it it only spams the "1" key :/ cant find my mistake

  15. #15
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by schnubbel15 View Post
    yea i know, i have it its just a cut out, but when i run it it only spams the "1" key :/ cant find my mistake
    Change "<" to " >"

  16. #16
    Join Date
    Apr 2012
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    already did, like i said it will spam the 1 key

  17. #17
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Could you post what you have?

  18. #18
    Join Date
    Apr 2012
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    (its just a script to test the Timer thing...:P)

    Simba Code:
    var
      t: Integer;

    procedure test;
    var
      x, y: Integer;
      Skill: Integer;
    begin
        MarkTime(11t);
        Repeat
            SendKeys('1', 100, 30);
        Until(TimeFromMark(t) < 5000);
        t:= 0;
    end;



     begin
        SetupSRL;
      Wait(5000);
      repeat
        test;
        wait(10000);
      until false;
    end.

  19. #19
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    Simba Code:
    procedure Timer;
    var
      T: Integer;
    begin
        MarkTime(T); //Makes T = 0 ms
        repeat     //Tells the script to repeat between here and until
          if (TimeFromMark(t) > 5000) then  //if Time >5sec then press button and reset timer
          begin
            SendKeys('1', 100, 30);
            T := 0;
          end else
          Wait(50);   //otherwise just wait another 50 ms
        until(False);   //Tells the script to repeat forever
    end;

  20. #20
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    if you are simply trying to press 1 for the action bar, not more times than needed;
    Simba Code:
    if WaitFunc(@PlayerChatActive, 100, 5000) then
        TypeByte(VK_1);

  21. #21
    Join Date
    Apr 2012
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    mhh could u explain it a bit? (sorry that im such noobish)

  22. #22
    Join Date
    Apr 2012
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    so... i figured out that my only problem atm is that i cant set the marktime back to 0:/
    Last edited by schnubbel15; 12-01-2012 at 12:23 PM.

  23. #23
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Quote Originally Posted by schnubbel15 View Post
    so... i figured out that my only problem atm is that i cant set the marktime back to 0:/
    Why not just marktime again?

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
  •