Results 1 to 4 of 4

Thread: Wont do what i say

  1. #1
    Join Date
    Nov 2006
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Wont do what i say

    i am trying to get it to click on the mini map but what it does is clicks on the tele symbol again did i do something wrong? try it and see if it does the same for you.

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}


    var
    Tele,Tree4,Tree5,Tree6,Tree7: integer;

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;



      Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Nick := '';
      Players[0].Active := True;

      NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    end;

    procedure DeclareBMPS;
    begin
      Tele := BitmapFromString(21, 21, 'z78DACD96510E83201044AF54' +
           '60557E6994FB1FA9A9FA413399CD20B5A9241B83C29B5D94C156B' +
           '39427B3929E679C6DB578C6A6FFF1BE821F3FC6C20C6DB49D6B2D' +
           '5DE0E62DAF3561A41A908E4FA147217628410AD1C6B8610A31563' +
           'F520D983BE851B84B594ACD18250D983B541BB98CE82B410DEC0B' +
           'C4AC59BE694A366F18FD3AB00AF472EBDEDA5147CF350D4AB58F9' +
           '95B16D28F7BA681AD824F6FB90A1D3550BA903BA363BB837E63E5' +
           'FFE0ABBBA661E48F3B9D05F69C1FED369D5EF6B59D96798DE06E4' +
           '32EC3DC0D9DCE759C5E8765ABAC9C40864E176C4E5F89500D7AB2' +
           '1A61296FEAA726617D5F65A640EE');

       Tree4 := BitmapFromString(3, 2, '3F6A29487DFF487DFF3F6A293F' +
           '6A29487D2F');

       Tree5 := BitmapFromString(2, 7, '2B59162B59FF2B59FF2B59FF22' +
           '46FF2B59162246102246105322034A2E154A2E154A2E154A2E154' +
           'A2E15');

       Tree6 := BitmapFromString(2, 4, '224610FF5916FF46102B591622' +
           '4610224610224610224610');

       Tree7 := BitmapFromString(2, 3, '2B59162B59FF2B59FF2B59162B' +
           '59162B5916');
    end;
    //////////////////////////////////////////////////////////////////////
    Procedure Setup;
    begin
      SetupSRL;
      DeclareBMPS;
      ActivateClient;
      DeclarePlayers;
      LoginPlayer;
      ClearDebug;
      MakeCompass('N');
      SetRun(true);
    end;
    ////////////////////////////////////////////////////////////////////
    Procedure GetToLumb;
    begin
     Gametab(7);
     if(FindBitmap(Tele, x, y))then
        begin
          MMouse(x, y, 1, 1);
          Mouse(x, y, 1, 1, True);
          Wait(17000+random(2000));
        end;
        FreeBitmap(Tele);
    end;
    //////////////////////////////////////////////////////////////////////
    procedure GetToTree;
    begin
      if (FindBitmapToleranceIn(Tree4, x, y, 666, 147, 614, 126, 50) or
      FindBitmapToleranceIn(Tree5, x, y, 666, 147, 614, 126, 50) or
      FindBitmapToleranceIn(Tree6, x, y, 666, 147, 614, 126, 50) or
      FindBitmapToleranceIn(Tree7, x, y, 666, 147, 614, 126, 50)) then
      MMouse(x, y, 0, 0);
      Mouse(x, y, 0, 0, true);
      Flag;
      FreeBitmap(Tree4);
      FreeBitmap(Tree5);
      FreeBitmap(Tree6);
      FreeBitmap(Tree7);
    end;
    /////////////////////////////////////////////////////////////
    function FindFastRandoms: Boolean;
    var
      i: Integer;
    begin
      for i := 1 to 14 do
      begin
        case I of
          1: CloseWindow;
          2: if FindTalk then
              Result := True;
          3: if FindMod then
              Result := True;
          4: if FindMime then
              Result := True;
          5: if FindMaze then
              Result := True;
          6: if FindQuiz then
              Result := True;
          7: if FindDemon then
              Result := True;
          8: if FindScapeRune then
              Result := True;
          9: if FindTalk then // Call it twice
              Result := True;
          10: if FindLamp(LampSkill) then // Maybe we missed it?
              Result := True;
          11: if (FindNewBox) then
            begin
              Result := True;
              if (UseBoxSolver) then
                SolveBox
              else
                GambleNewBox;
            end;
          12: if FindTrade then
              Result := True;
          13:
            begin
              if NoGameTab then
              begin
                Result := True;
                Players[CurrentPlayer].Rand := 'No GameTab';
                //Players[CurrentPlayer].loc := 'No GameTab';
                Logout;
                Exit;
              end;
            end;
          14: if RC then
              Result := True;
        end;
        if Result then
          Break;
        Wait(1);
      end;
      SaveToChatLog;
    end;
    //////////////////////////////////////////////////////////////////////
    procedure findrandoms;
    begin
    FindFastRandoms;
    FindNormalRandoms;
    end;
    //////////////////////////////////////////////////////////////
    procedure antiban;
    begin
     case Random(10) of
      2:begin
       MouseBox(MSx1, MSy1, MSx2, MSy2, 3);
       end;

      4:begin
          HoverSkill('Woodcutting', False);
          wait(2000+random(1000));
          GameTab(4);
        end;

      5: PickUpMouse;

      6:begin
        MouseBox(MIx1, MIy1, MIx2, MIy2, 3);
        end;

      8: BoredHuman;

      9: begin
             GameTab(1 + Random(12));
             wait(1000+random(1000));
             GameTab(4);
           end;
     end;
    end;


    /////////////////////////////////////////////////////////////
    procedure chopping;
    begin
    if (FindColorTolerance(x, y, 3698784, 160, 97, 516, 209, 3) or
    FindColorTolerance(x, y, 1261624, 160, 97, 516, 209, 3) or
    FindColorTolerance(x, y, 4753536, 160, 97, 516, 209, 3) or
    FindColorTolerance(x, y, 4425848, 160, 97, 516, 209, 3) or
    FindColorTolerance(x, y, 2252880, 160, 97, 516, 209, 3) or
    FindColorTolerance(x, y, 5079160, 160, 97, 516, 209, 3) or
    FindColorTolerance(x, y, 1722424, 160, 97, 516, 209, 3) or
    FindColorTolerance(x, y, 2578512, 160, 97, 516, 209, 3) or
    FindColorTolerance(x, y, 3442808, 160, 97, 516, 209, 3))then
      begin
       MMouse(x,y,2,2);
        if (IsUpText('Chop dow')) then
        Mouse(x,y,2,2,true);
        findrandoms;
       antiban;
      end;
    end;

    begin
    Setup;
    GetToLumb;
    GetToTree;
    chopping;
    end.

  2. #2
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    SCAR Code:
    procedure GetToTree;
    begin
      if (FindBitmapToleranceIn(Tree4, x, y, 666, 147, 614, 126, 50) or
      FindBitmapToleranceIn(Tree5, x, y, 666, 147, 614, 126, 50) or
      FindBitmapToleranceIn(Tree6, x, y, 666, 147, 614, 126, 50) or
      FindBitmapToleranceIn(Tree7, x, y, 666, 147, 614, 126, 50)) then
      MMouse(x, y, 0, 0);
      Mouse(x, y, 0, 0, true);
      Flag;
      FreeBitmap(Tree4);
      FreeBitmap(Tree5);
      FreeBitmap(Tree6);
      FreeBitmap(Tree7);
    end;
    is this ur minimap clicking part?
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  3. #3
    Join Date
    Nov 2006
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yea

  4. #4
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I believe your problem is that with the GetToTree procedure. Scar is not finding any of the tree bitmaps.
    SCAR Code:
    procedure GetToTree;
    begin
      if (FindBitmapToleranceIn(Tree4, x, y, 666, 147, 614, 126, 50) or
      FindBitmapToleranceIn(Tree5, x, y, 666, 147, 614, 126, 50) or
      FindBitmapToleranceIn(Tree6, x, y, 666, 147, 614, 126, 50) or
      FindBitmapToleranceIn(Tree7, x, y, 666, 147, 614, 126, 50)) then
     begin// you need this
      MMouse(x, y, 0, 0);
      Mouse(x, y, 0, 0, true);
      Flag;
      FreeBitmap(Tree4);
      FreeBitmap(Tree5);
      FreeBitmap(Tree6);
      FreeBitmap(Tree7);
    end else
     writeln('Did not find any tree bitmaps');//if you see this after running it, my theory was correct
    end;

    If the action you want scar to perform if something happens is more than one line long, you need to enclose it with a begin and end. Otherwise, scar thinks the action is only the very next line after then (in this case MMouse) Since scar has not found the tree bitmap, your x and y coordinates are still the same as the tele symbol from the preceding procedure. Therefore, MMouse will move to the tele symbol since that was the last set of coords.

    Hope that helped


    p.s.
    you don't need MMouse and Mouse, Mouse moves to the position for you automatically.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Wont Right-Click???
    By Rora in forum OSR Help
    Replies: 3
    Last Post: 11-10-2007, 06:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •