Results 1 to 6 of 6

Thread: [Script writing question]

  1. #1
    Join Date
    Apr 2014
    Posts
    323
    Mentioned
    0 Post(s)
    Quoted
    131 Post(s)

    Default [Script writing question]

    Is it possible that I can write in a game timer in the script and have procedures act according to that game timer?

    Example: I want to write a Nightmare Zone script.

    The first layer to that script would be a procedure that that flicks the prayer on/off ever minute.
    the next layer would be a procedure that redoses on overloads every 'x' amount of time
    and the final layer would be one that redoses on absorbtions.

    all of these procedures would be running off of a 'world clock', where when the script starts, the world clock starts and after every certain amount of time that passes on the world clock, these procedures do their thing.

    If my logic in this script idea is bunk, please dont be afraid to correct/tell me so.

  2. #2
    Join Date
    Jun 2014
    Location
    Lithuania
    Posts
    475
    Mentioned
    27 Post(s)
    Quoted
    200 Post(s)

    Default

    Quote Originally Posted by hakishakataki View Post
    Is it possible that I can write in a game timer in the script and have procedures act according to that game timer?

    Example: I want to write a Nightmare Zone script.

    The first layer to that script would be a procedure that that flicks the prayer on/off ever minute.
    the next layer would be a procedure that redoses on overloads every 'x' amount of time
    and the final layer would be one that redoses on absorbtions.

    all of these procedures would be running off of a 'world clock', where when the script starts, the world clock starts and after every certain amount of time that passes on the world clock, these procedures do their thing.

    If my logic in this script idea is bunk, please dont be afraid to correct/tell me so.
    procedure repeatshit();
    var
    t: ttimemarker;
    p: boolean;
    begin
    t.start();
    p:= false;
    repeat
    repeat
    wait(250); //for example
    until t.gettime()>60000; //one minute
    Mousebox(prayerbutton.x,prayerbutton.y, mouse_left);
    if p=false then P:=true else p:=false;
    writeln(tostring(p));
    t.reset();
    until false; //if you wana forever or other condition
    end;

    and so on..... atleast i do some kind of this stuff like this

  3. #3
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    On phone so can't give you example code.

    You could have 3 global integer variables which hold the time for your three 'stopwatches'. You would have one procedure called checkTimers, and call that everywhere you want to check the timers. The checkTimer procedure would check all of your timers, such as:

    If timeFromMark(prayerTimer) > 60000 then togglePrayer

    So if it's been more than 60s since you last started the timer it will run the togglePrayer procedure. At the end of the toggle prayer procedure you would markTime(prayerTimer) to reset the timer.

  4. #4
    Join Date
    Apr 2014
    Posts
    323
    Mentioned
    0 Post(s)
    Quoted
    131 Post(s)

    Default

    hmm, thanks guys! this helps a bunch!

  5. #5
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    Quote Originally Posted by hakishakataki View Post
    Is it possible that I can write in a game timer in the script and have procedures act according to that game timer?
    Everything is possible my brother

  6. #6
    Join Date
    Apr 2014
    Posts
    323
    Mentioned
    0 Post(s)
    Quoted
    131 Post(s)

    Default

    Quote Originally Posted by hoodz View Post
    Everything is possible my brother
    all you have to do is believe

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
  •