Results 1 to 7 of 7

Thread: isSystemUpdating()

  1. #1
    Join Date
    Jul 2014
    Location
    My computer
    Posts
    78
    Mentioned
    8 Post(s)
    Quoted
    21 Post(s)

    Default isSystemUpdating()

    [RS3]A function to tell if the popup box that says the system will update in XX:XX time is on the screen or not. I have had many scripts die because of it, so this is useful for telling if the update popup is the cause or not.

    Simba Code:
    function isSystemUpdating(): boolean;
    var
      sysUpdateDTM: integer;
      p: TPoint;
    begin
      result := false;
      sysUpdateDTM := DTMFromString('mlwAAAHicY2dgYEhiZWDQBOIJQHwIiH+zMDCkAekUIN4ClN8IxJuBeBMUXwbiRUDcwc3P0A7E3TxADWhABAlzoWFGPBgKAMWyCwY=');
      if (findDTM(sysUpdateDTM, p.x, p.y, getClientBounds())) then
      begin
        writeln('Found system update screen.');
        result := true;
      end;
      freeDTM(sysUpdateDTM);
    end;
    Last edited by HKbotz; 02-16-2015 at 03:15 PM. Reason: fixed mem leak
    We must stop constantly fighting for human rights and equal justice in an unjust system, and start building a society where equal rights are an integral part of the design. --Jacque Fresco

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

  3. #3
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    I have a couple thoughts. First off, is this for RS3 or OSRS? Secondly, would it not be easier to use some OCR to check for the update text within a small area of the main screen? Also, don't forget to free your DTM before exiting the function!

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  4. #4
    Join Date
    Jul 2014
    Location
    My computer
    Posts
    78
    Mentioned
    8 Post(s)
    Quoted
    21 Post(s)

    Default

    Quote Originally Posted by Clarity View Post
    Thank you for this! +Repped.
    No problem

    Quote Originally Posted by Flight View Post
    I have a couple thoughts. First off, is this for RS3 or OSRS? Secondly, would it not be easier to use some OCR to check for the update text within a small area of the main screen? Also, don't forget to free your DTM before exiting the function!
    This is for RS3. I was going to use OCR but I caught the update popup right before it updated so I didn't have time to mess with any OCR stuff. Next time I catch an update when I'm not afk I will try for it.
    Thanks for the catch about freeing DTM, I added it.
    We must stop constantly fighting for human rights and equal justice in an unjust system, and start building a society where equal rights are an integral part of the design. --Jacque Fresco

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

    Default

    Quote Originally Posted by HKbotz View Post
    snip
    mem leak still not fixed, this will fix it:
    Simba Code:
    function isSystemUpdating(): boolean;
    var
      sysUpdateDTM: integer;
      p: TPoint;
    begin
      result := false;
      sysUpdateDTM := DTMFromString('mlwAAAHicY2dgYEhiZWDQBOIJQHwIiH+zMDCkAekUIN4ClN8IxJuBeBMUXwbiRUDcwc3P0A7E3TxADWhABAlzoWFGPBgKAMWyCwY=');
      if (findDTM(sysUpdateDTM, p.x, p.y, getClientBounds())) then
         result := true
      freeDTM(sysUpdateDTM);
    end;

  6. #6
    Join Date
    Jul 2014
    Location
    My computer
    Posts
    78
    Mentioned
    8 Post(s)
    Quoted
    21 Post(s)

    Default

    Quote Originally Posted by hoodz View Post
    mem leak still not fixed, this will fix it:
    Lol thanks. I guess I should stop doing these things at 7am after being up all night
    We must stop constantly fighting for human rights and equal justice in an unjust system, and start building a society where equal rights are an integral part of the design. --Jacque Fresco

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

    Default

    I have this is quite a few of my scripts:

    Simba Code:
    function isUpdateComing(): Boolean;
    var
      TPA: TPointArray;
    begin
      findColors(TPA, 0, intToBox(300, 25, 499, 74));
      result := ((TPA.getBounds().getWidth() = 200) and (TPA.getBounds().getHeight() = 50));
    end;

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
  •