Results 1 to 6 of 6

Thread: 2007 object finding and clicking

  1. #1
    Join Date
    Feb 2013
    Posts
    104
    Mentioned
    1 Post(s)
    Quoted
    32 Post(s)

    Default 2007 object finding and clicking

    i have narrowed this error down to the line if P07_IsUpTextMultiCustom(['Cho', 'hop', 'Dow', 'own', 'Tree']) then
    IsUpTextMultiCustom isn't working for me, i've also tried if P07_Containstext(P07_getUptext, ['own', 'ree']) then
    so i guess p07_getUpText isn't working correctly, if anyone has a solution or an idea i would greatly appreciate it.
    Simba Code:
    Procedure ChopTree;
    var
      treeTPA:TPointArray;
      timeTree, tmpCTS, L, R, K: integer;
    begin
      MarkTime(timeTree);
      tmpCTS := GetToleranceSpeed;
      SetColorToleranceSpeed(2);
      SetToleranceSpeed2Modifiers(3.88, 0.00) //hue and sat
      //FindColorsTolerance(keysTPA, 269853, MSX1, MSY1, MSX2, MSY2, 2);
      FindColorsSpiralTolerance(256, 165, treeTPA, 6155, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 2);
      L := High(treeTPA);
      R := random(L);
      K := RandomRange(1,28);
      mmouse(treeTPA[R].x,treeTPA[R].y, 1, 1);
      Wait(200);
        if P07_IsUpTextMultiCustom(['Cho', 'hop', 'Dow', 'own', 'Tree']) then
          repeat
            if K < 2 then
              begin
                ClickMouse2(mouse_right);
                P07_ChooseOptionMulti(['hop']);
                Wait(500);
              end
            else if K > 1 then
              begin
                ClickMouse2(mouse_left);
                Wait(500);
              end;
            if not P07_IsUpTextMultiCustom(['Cho', 'hop', 'Dow', 'own', 'Tree']) then break;
          until P07_DidClick(true,200) or (TimeFromMark(timeTree) > 5000);
        SetColorToleranceSpeed(tmpCTS);
        SetToleranceSpeed2Modifiers(0.02, 0.02);
    end;
    function keyTurn(Key:integer): boolean;
    var
      keysTPA:TPointArray;
      timekey, tmpCTS, L, R: integer;
      begin
        case key of
          1: KeyToHold:=37;
          2: KeyToHold:=39;
        end
            MarkTime(timeKey);
            tmpCTS := GetToleranceSpeed;
            SetColorToleranceSpeed(2);
            SetToleranceSpeed2Modifiers(3.88, 0.00) //hue and sat
            FindColorsSpiralTolerance(256, 165, keysTPA, 6155, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 2);
            L := High(keysTPA);
            R := random(L);
              if not FindColorsSpiralTolerance(256, 165, keysTPA, 6155, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 2) then
                  repeat
                    begin
                      KeyDown(KeyToHold);
                      Wait(100);
                      if TimeFromMark(timeKey) > RandomRange(1500, 3400) then Break;
                    end;
                Result := True;
              until FindColorsTolerance(keysTPA,6155,P07_MSX1, P07_MSY1, P07_MSX2,P07_MSY2, 2);
                Result := False;
                KeyUp(KeyToHold);
                SetColorToleranceSpeed(tmpCTS);
                SetToleranceSpeed2Modifiers(0.02, 0.02);
      end;
    after looking at my code a second time im noticing a lot of things i can change, but lets focus on the clicking part please
    Last edited by blockay; 03-03-2013 at 11:57 AM.

  2. #2
    Join Date
    May 2007
    Location
    England/Liverpool
    Posts
    1,004
    Mentioned
    9 Post(s)
    Quoted
    106 Post(s)

    Default

    Your using the wrong main screen coords

    these:
    MSX1, MSY1, MSX2, MSY2

    Should be:
    P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2

    is just a guess havn't tested the include just from looking.

  3. #3
    Join Date
    Feb 2013
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    37 Post(s)

    Default

    Post the entire script please.

  4. #4
    Join Date
    Feb 2013
    Posts
    104
    Mentioned
    1 Post(s)
    Quoted
    32 Post(s)

    Default

    Quote Originally Posted by CRU1Z1N View Post
    Your using the wrong main screen coords

    these:
    MSX1, MSY1, MSX2, MSY2

    Should be:
    P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2

    is just a guess havn't tested the include just from looking.
    i never seem to have any issues with msx1 msy1 etc, i tried ur suggestion and changed to p07 but that didn't work.

    @xeronate, i just need help with the clicking method..
    Updated code (still not working) any ideas?
    Simba Code:
    Procedure ChopTree;
    var
      treeTPA:TPointArray;
      timeTree, tmpCTS, L, R, K: integer;
    begin
      MarkTime(timeTree);
      tmpCTS := GetToleranceSpeed;
      SetColorToleranceSpeed(2);
      SetToleranceSpeed2Modifiers(3.88, 0.00) //hue and sat
      //FindColorsTolerance(keysTPA, 269853, MSX1, MSY1, MSX2, MSY2, 2);
      FindColorsSpiralTolerance(256, 165, treeTPA, 6155, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 2);
      L := High(treeTPA);
      R := random(L);
      K := RandomRange(1,28);
      mmouse(treeTPA[R].x,treeTPA[R].y, 1, 1);
      Wait(200);
        if P07_IsUpTextMultiCustom(['Cho', 'hop', 'Dow', 'own', 'Tree']) then
          repeat
            if K < 2 then
              begin
                ClickMouse2(mouse_right);
                P07_ChooseOptionMulti(['hop']);
                Wait(500);
              end
            else if K > 1 then
              begin
                ClickMouse2(mouse_left);
                Wait(500);
              end;
            if not P07_IsUpTextMultiCustom(['Cho', 'hop', 'Dow', 'own', 'Tree']) then break;
          until P07_DidClick(true,200) or (TimeFromMark(timeTree) > 5000);
        SetColorToleranceSpeed(tmpCTS);
        SetToleranceSpeed2Modifiers(0.02, 0.02);
    end;
    function keyTurn(Key:integer): boolean;
    var
      keysTPA:TPointArray;
      timekey, tmpCTS, L, R: integer;
      begin
        case key of
          1: KeyToHold:=37;
          2: KeyToHold:=39;
        end
            MarkTime(timeKey);
            tmpCTS := GetToleranceSpeed;
            SetColorToleranceSpeed(2);
            SetToleranceSpeed2Modifiers(3.88, 0.00) //hue and sat
            FindColorsSpiralTolerance(256, 165, keysTPA, 6155, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 2);
            L := High(keysTPA);
            R := random(L);
              if not FindColorsSpiralTolerance(256, 165, keysTPA, 6155, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 2) then
                  repeat
                    begin
                      KeyDown(KeyToHold);
                      Wait(100);
                      if TimeFromMark(timeKey) > RandomRange(1500, 3400) then Break;
                    end;
                Result := True;
              until FindColorsTolerance(keysTPA,6155,P07_MSX1, P07_MSY1, P07_MSX2,P07_MSY2, 2);
                Result := False;
                KeyUp(KeyToHold);
                SetColorToleranceSpeed(tmpCTS);
                SetToleranceSpeed2Modifiers(0.02, 0.02);
      end;

    my main loop

    Simba Code:
    begin
        DTM;
        CallThings;
        P07_DeclarePlayer;
        SetupP07Include;
        ActivateClient;
        Addonterminate('FreeThings');
        login;
        Wait(100);
      If P07_LoggedIn then
        begin
            randInt := Random(125);
          repeat
        login;
      if (run = 0) then
          begin
            turnRunOn;
            run := 1;
            z := 1;
          end;
      if(P07_InvFull) then
        repeat
          makeShafts;
        until not FindBitMapToleranceIn(logs, x, y, P07_MIX1, P07_MIY1, P07_MIX2, P07_MIY2, 50)
      else
        if not (P07_InvFull) then
            repeat
              ChopTree;
              keyTurn(2);
              waiting;
              P07_MakeCameraAngleHigh;
          until (P07_InvFull);
        Until (false)
      end;
        FreeThings;
        TerminateScript;
    End.
    it will hover over the trees, just not click ;/ any1 got any ideas?
    Last edited by blockay; 03-03-2013 at 01:11 AM.

  5. #5
    Join Date
    Feb 2013
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    37 Post(s)

    Default

    Try putting SRL_EnableNavBar; at the beginning of your chop procedure.
    If that doesn't work get rid of ActivateClient; and try it.

  6. #6
    Join Date
    Feb 2013
    Posts
    104
    Mentioned
    1 Post(s)
    Quoted
    32 Post(s)

    Default

    Quote Originally Posted by Xeronate View Post
    Try putting SRL_EnableNavBar; at the beginning of your chop procedure.
    If that doesn't work get rid of ActivateClient; and try it.
    neither worked
    Last edited by blockay; 03-03-2013 at 11:44 AM.

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
  •