Results 1 to 7 of 7

Thread: Help with 2 Things

  1. #1
    Join Date
    Jan 2012
    Posts
    713
    Mentioned
    3 Post(s)
    Quoted
    9 Post(s)

    Default Help with 2 Things

    Alright so I've been using findobjcus w/ ACA for a while becasue its been so simple and I can just throw scripts together but I gave ATPA a go here is my issue > It will Find the Altar perfectly Fine > Right click wont choose the option altar and will immediately move outside to the left side of the screen then repeat > finding altar > rightclicking bla bla.
    Simba Code:
    Function Altar: Boolean;
    Var
      CTS, I: Integer;
      TPA: TPointArray;
      ATPA: Array of TPointArray;
    Begin
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);  
      SetColorSpeed2Modifiers(1.39, 0.20);
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, AltarColor, MSX1, MSY1, MSX2, MSY2, 18); // Used ACA 'AltarColor'
      ColorToleranceSpeed(CTS);
      ATPA := TPAToATPAEx(TPA, 15, 15);

      For I := 0 to High(ATPA) Do
      Begin
        MiddleTPAEx(ATPA[i], x, y);
        MMouse(X, Y, 2, 2);
        If (IsUpTextMultiCustom(['Altar'])) Then
        begin
         ClickMouse2(False);
         Wait(100 + Random(50));
         ChooseOption('Altar');
          end;
          result:=true;
          break;
        end;
      end;
    end;


    Second one is simple the Until(invFull); must be written wrong because on a full inventory it will still keep trying to pick up items. Whats the correct way to write it?

    Simba Code:
    Procedure PickupSticks;
    Begin
      Gametab(Tab_Inv)
      If (FindObjCustom(X, Y, ['The names here'], [COL], 5)) Then // ignore this line
      Begin
        Writeln('Found Da Sticks');
        Wait(700+random(50));
        ClickMouse2(False);
        Wait(200 + Random(150));
        ChooseOption('Take')
        Wait(500 + Random(150));
        MMouse(292,180,2,2);
        Wait(44000 + Random(1000));
      End Else Writeln('Cant Find The Stick');
      Repeat
        PickupSticks;
      Until(invFull);  //  < Here is the issue
        Teleport;
    End;

  2. #2
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    For the first point, try using 'ltar' without the A.

    As for the second question, what I see is that it'll never actually reach that part of the code which checks if the inventory is full because of the way you've written it. Just rearrange it a bit to make
    Simba Code:
    procedure PickupSticks;
    begin
      repeat
        GameTab(tab_Inv)
        if (FindObjCustom(X, Y, ['The names here'], [COL], 5)) then // ignore this line
        begin
          Writeln('Found Da Sticks');
          Wait(700+random(50));
          ClickMouse2(False);
          Wait(200 + Random(150));
          ChooseOption('Take')
          Wait(500 + Random(150));
          MMouse(292,180,2,2);
          Wait(44000 + Random(1000));
        end else
          WriteLn('Cant Find The Stick');
      until(InvFull)
      Teleport;
    end;
    and it should work fine.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  3. #3
    Join Date
    Jan 2012
    Posts
    713
    Mentioned
    3 Post(s)
    Quoted
    9 Post(s)

    Default

    Tried changing the uptext to 'ltar' didnt seem to work

  4. #4
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Try increasing the wait, or using WaitOption instead. Also, there are few failsafes in that procedure. You return it true even though it may not choose the option, which is what's happening, so add a few else statements in there as well
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  5. #5
    Join Date
    Jan 2012
    Posts
    713
    Mentioned
    3 Post(s)
    Quoted
    9 Post(s)

    Default

    Simba Code:
    Function Altar: Boolean;
    Var
      CTS, I: Integer;
      TPA: TPointArray;
      ATPA: Array of TPointArray;
    Begin
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(1.39, 0.20);
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, AltarColor, MSX1, MSY1, MSX2, MSY2, 18); // Used ACA 'AltarColor'
      ColorToleranceSpeed(CTS);
      ATPA := TPAToATPAEx(TPA, 20, 20);

      For I := 0 to High(ATPA) Do
      Begin
        MiddleTPAEx(ATPA[i], x, y);
        MMouse(X, Y, 2, 2);
        Wait(1000 + Random(600));
        If (IsUpTextMultiCustom(['ltar','Altar','tar','ar'])) Then
        Begin
         Wait(1000 + Random(800));
         ClickMouse2(False);
         Wait(700 + Random(50));
         ChooseOption('Altar');
         End;
         Break;
      End;
    End;

    Changed the code to add longer waits, it will find the color and sit there find a new color move to it and sit there won't right click the object and enter. Ideas?

  6. #6
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Try running this. I've added some debugging WriteLns so we can see what it's actually doing.

    Simba Code:
    Function Altar: Boolean;
    Var
      CTS, I: Integer;
      TPA: TPointArray;
      ATPA: Array of TPointArray;
    Begin
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(1.39, 0.20);
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, AltarColor, MSX1, MSY1, MSX2, MSY2, 18); // Used ACA 'AltarColor'
      ColorToleranceSpeed(CTS);
      ATPA := TPAToATPAEx(TPA, 20, 20);

      For I := 0 to High(ATPA) Do
      Begin
        WriteLn('Starting FOR TO DO loop');
        WriteLn(GetArrayLength(ATPA));
        MiddleTPAEx(ATPA[i], x, y);
        MMouse(X, Y, 2, 2);
        Wait(1000 + Random(600));
        If (IsUpTextMultiCustom(['ltar','Altar','tar','ar'])) Then
        Begin
         WriteLn('Found uptext');
         Wait(1000 + Random(800));
         ClickMouse2(False);
         Wait(700 + Random(50));
         if ChooseOption('Altar') then
           WriteLn('Chose option');
         End;
         Break;
      End;
    End;
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  7. #7
    Join Date
    Jan 2012
    Posts
    713
    Mentioned
    3 Post(s)
    Quoted
    9 Post(s)

    Default

    Figured out the issue it was the uptext being 'mysterious ' instead of altar, fail on my part.

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
  •