Results 1 to 5 of 5

Thread: FindObjColorByText

  1. #1
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default FindObjColorByText

    Put in the UpText name and it will start in the center of screen and look around till it finds the UpText then retrieves the color. Once it reaches the edge of the screen it stops looking.

    This isn't perfect as you can imagine, but it works Okayish in my Autofigher.

    SCAR Code:
    function FindObjColorByText(ObjName:string): integer;//by Narcle
    var
    xx,yy, MainTimeCount, TimeCount1, TimeCount2, MoP, coloris:integer;
    begin
    MMouse(258, 180, 1, 1);
    MainTimeCount := 1;
    GetMousePos(xx, yy);
    repeat
      repeat
       If (MoP = 0) then MMouse(xx,yy-25, 1, 1) else MMouse(xx,yy+25, 1, 1);
       GetMousePos(xx, yy);
       if IsUpText(ObjName) then
        begin
          coloris := GetColor(xx,yy);
          Writeln('Object color is: '+inttostr(coloris)+' at '+inttostr(xx)+', '+inttostr(yy));
          result := coloris;
          exit;
        end;
       TimeCount1 := TimeCount1+1;
      until(TimeCount1 = MainTimeCount)
      repeat
       If (MoP = 0) then MMouse(xx+40,yy, 1, 1) else MMouse(xx-40,yy, 1, 1);
       GetMousePos(xx, yy);
       if IsUpText(ObjName) then
         begin
          coloris := GetColor(xx,yy);
          Writeln('Object color is: '+inttostr(coloris)+' at '+inttostr(xx)+', '+inttostr(yy));
          result := coloris;
          exit;
          end;
        TimeCount2 := TimeCount2+1;
      until(TimeCount2 = MainTimeCount)
      MainTimeCount := MainTimeCount+1;
      TimeCount1 := 0;
      TimeCount2 := 0;
      if (MoP = 0) then MoP := 1 else MoP := 0;
    until(MainTimeCount >= 12)
    Writeln('Couldnt find object color!');
    result := 0;
    end;
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  2. #2
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Hmmm.... Backwards approach, but besides the fact it moves the mouse around a lot its O.K.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  3. #3
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    yea... not sure how there is a better way (in my experiences so far)
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  4. #4
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    how about making it confined to a user set box?

    so it would only look for the object in the inventory or something

    just sumthin to keep ya busy

  5. #5
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Macrosoft View Post
    how about making it confined to a user set box?

    so it would only look for the object in the inventory or something

    just sumthin to keep ya busy
    Already Done:
    SCAR Code:
    function MouseInvText(istextup, option:string; leftclick: Boolean; inv1, inv2, waitfor, xtimes:integer): Boolean; //by Narcle
    var
    i,x,y, times:integer;
    begin
    gametab(4);
    for i := inv1 to inv2 do
    if (ExistsItem(i)) then
      begin
      MMouseItem(i);
      GetMousePos(x, y);
      wait(100+random(50));
      if (pos(istextup, rs_GetUpText) > 0) then
        begin
          if (leftclick = true) then
            begin
              Mouse(x,y,5,5,true);
              result := true;
              times := times + 1;
            end else
            begin
              Mouse(x,y,5,5,false);
              if Chooseoption(option) then
              begin
                result := true;
                times := times + 1;
              end;
            end;
          end;
        wait(waitfor+random(100));
        if (times = xtimes) then exit;
      end else
      result := false;
      exit;
    end;

    Its in AutoFight 0.54

    Although this is for inventory only, but its inventory only with many options.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

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
  •