Results 1 to 8 of 8

Thread: Detecting blast furnace gauge state

  1. #1
    Join Date
    May 2013
    Posts
    98
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default Detecting blast furnace gauge state

    Hi,

    I'm working on a blast furnace script and I'd like to find a way for my bots to detect how hot the furnace is.

    For those not familiar you can check with a gauge thing that you have to click on then it opens up an interface thing. I'll try attach a pic for you.

    Capture.PNG


    Here's what I've tried or looked at:
    it doesnt seem like any reflection data changes as the needle moves, examine data, ID etc..

    I don't know much about widgets but i got a widget viewer and heated it up and nothing seemed to change.

    I guess this leaves something color-based? Checking manually should work fine with my script so I'm open to this.

    However color and advanced TPA's really rnt my forte so some help or suggestions would be much appreciated, or if theres a better way let me know your ideas.

    Thanks for your time.

  2. #2
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Gonna have to see more pics to see if this works

    Simba Code:
    function getFuranceHeat():extended;
    var
      handTPA:TPointArray;
      t:TPoint;
    begin
      findColorsSpiralTolerance(t.x, t.y, handTPA, 1118484, 157, 21, 442, 308, 0);
      if (length(handTPA) < 1) then
       exit;
      t := middleTPA(handTPA);
      result := degrees(fixRad((ArcTan2(-(t.y - 281), t.x - 160) + Radians(90)) - Pi));
    end;

    Also the input numbers are based off the picture in the browser not the game

  3. #3
    Join Date
    Mar 2015
    Posts
    189
    Mentioned
    3 Post(s)
    Quoted
    73 Post(s)

    Default

    If you use reflection you could use the settings in the client to check wether your bars are done or not.

    Code:
    function isBarsReady() : boolean;
    var
      arraySettings : TIntegerArray;
    begin
      arraySettings := R_GetSettingArray;
      writeLn(arraySettings[546]);
      if (arraySettings[546] > 20) then
      begin
        Result := true;
      end else
        Result := false;
    end;

  4. #4
    Join Date
    May 2013
    Posts
    98
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    Quote Originally Posted by rj View Post
    Gonna have to see more pics to see if this works

    Simba Code:
    function getFuranceHeat():extended;
    var
      handTPA:TPointArray;
      t:TPoint;
    begin
      findColorsSpiralTolerance(t.x, t.y, handTPA, 1118484, 157, 21, 442, 308, 0);
      if (length(handTPA) < 1) then
       exit;
      t := middleTPA(handTPA);
      result := degrees(fixRad((ArcTan2(-(t.y - 281), t.x - 160) + Radians(90)) - Pi));
    end;

    Also the input numbers are based off the picture in the browser not the game
    tyvm for that, I have taken some more pictures so you can get a better idea of the interface, I will test your code when hooks are back up.

    http://imgur.com/a/gWroU

    I believe the red 'warning' things that can be seen in 1 or 2 pics just signify broken cogs/belt.

  5. #5
    Join Date
    May 2013
    Posts
    98
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    Quote Originally Posted by mocrosoft View Post
    If you use reflection you could use the settings in the client to check wether your bars are done or not.

    Code:
    function isBarsReady() : boolean;
    var
      arraySettings : TIntegerArray;
    begin
      arraySettings := R_GetSettingArray;
      writeLn(arraySettings[546]);
      if (arraySettings[546] > 20) then
      begin
        Result := true;
      end else
        Result := false;
    end;
    Thanks, thats a handy suggestion and while it might not solve this particular issue, I'll likely use it in my script.

  6. #6
    Join Date
    May 2013
    Posts
    98
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    Quote Originally Posted by rj View Post
    Gonna have to see more pics to see if this works

    Simba Code:
    function getFuranceHeat():extended;
    var
      handTPA:TPointArray;
      t:TPoint;
    begin
      findColorsSpiralTolerance(t.x, t.y, handTPA, 1118484, 157, 21, 442, 308, 0);
      if (length(handTPA) < 1) then
       exit;
      t := middleTPA(handTPA);
      result := degrees(fixRad((ArcTan2(-(t.y - 281), t.x - 160) + Radians(90)) - Pi));
    end;

    Also the input numbers are based off the picture in the browser not the game
    Hey, unfortunately it's not working for me, I tried changing the bounds to be tighter to the interface and I even tried making it check the whole screen when I realized the problem was the ATPA keeps coming back empty but it doesnt find anything.
    Simba Code:
    findColorsSpiralTolerance(t.x, t.y, handTPA, 1118484, msx1, msy1, msx2, msy2, 0);
    which is weird because I checked and your color looks right to me for the needle.

    Update:

    I used a DTM to find the needle and that seemed to be working, so now that I have a point to put into your result function. It's not working for me unfortunately, at about 3 o clock the needle returns like 300 and then it goes all over the place as i heat the furnace up
    Simba Code:
    result := degrees(fixRad((ArcTan2(-(t.y - 281), t.x - 160) + Radians(90)) - Pi));

  7. #7
    Join Date
    May 2013
    Posts
    98
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    Edit: Problem is with my DTM, it stop getting reecognized when the needle goes past a certain point, so back to square 1

  8. #8
    Join Date
    May 2013
    Posts
    98
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    Quote Originally Posted by slacky View Post
    Simba Code:
    function GaugeTemperature(): Double;
    var
      ATPA:T2DPointArray;
      TPA:TPointArray;
      tip:TPoint;
    const
      center:TPoint = [254,170];
    begin
      FindColorsTolerance(TPA, 1118485, 170,84,340,255, 45);
      FilterPointsDist(TPA, 70,80, center.x, center.y);
      Assert(Length(TPA) > 0, 'Err, pointer not found!');

      ATPA := ClusterTPA(TPA,2);
      SortATPAFromSize(ATPA,0,False);
      SortTPAFrom(ATPA[0], center);
      tip := ATPA[0][high(ATPA[0])];

      Result := Degrees( FixRad(ArcTan2(tip.y-center.y, tip.x-center.x) + (PI/2)) );
    end;

    Works on all your images. Coordinates has been adjusted to account for image offset, so it can simply be applied without any effort.
    It increases clockwise, as I found that to make most sense here, so: starting at top = 0, right = 90, bottom = 180.. etc..
    Slacky posted this on another thread which works beautifully for me, incase anyone needs this.

    Tyvm everyone who posted.

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
  •