Results 1 to 3 of 3

Thread: starting scripting agail(long break) need some help updating

  1. #1
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default mta maze doer, help thread

    since im having a lot of trouble with my maze doer, and i suck at fixing my own problems, iv decided to just make a single thread for all of them. i will also update this thread for what im currently working on, what i need help with, and what i completed.

    right now, im just working on the maze finding system( every thing else is simple, just needs hard work).

    my current problem(s):

    when i get to the maze, it doesnt click on the guardian. dont know why, the only think i can do is change colors, but it doesnt work

    if i get to observe mode, it doesnt check the guardian and the end point colors, the mouse just moves around randomly

    my changes:
    i got rid of autocolor. it has a hassle, didnt work, and tpas work much better, even though it might need more work.


    completed:
    walk to maze - done
    click on the guardian(to go into observe mode) - not done
    maze finder - 10%(if that) done

    my mazefinding procedures all in one, once i finish it i will add it to the main script.

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

    var
      x, y, i, R, W: integer;
      counter: integer;
      MyTPA : TPointArray;
      MyPoint : TPoint;

    procedure clickreddot;// gaurdian on minimap
    begin
      if FindColorTolerance(x, y, 237, MMX1, MMY1, MMX2, MMY2, 10) then
        begin
          mouse(x, y, 2, 2, true);
          flag;
          wait(300+ random(400));
        end;
    end;

    procedure clickyellowdot; // the guardian helper guy on minimap
    begin
      repeat
      Counter:=counter+1;
      if FindColorTolerance(x, y, 62965, MMX1, MMY1, MMX2, MMY2, 10) then
            begin
              mouse(x, y, 2, 2, true);
              flag;
              wait(300+ random(400));
              clickreddot;
            end;
      until FindColorTolerance(x, y, 237, MMX1, MMY1, MMX2, MMY2, 10) or (Counter=10);
    end;


    procedure walktomaze; //walks to the maze, so i can see the gaurdian to get into observe mode
    begin
      clickreddot;
      if not FindColorTolerance(x, y, 237, MMX1, MMY1, MMX2, MMY2, 10) then
        begin
          wait(300);
          clickyellowdot;
        end;
    end;


    procedure clickguardian; //goes into observe mode
    begin
      flag;
      FindColorsTolerance(MyTPA, 11576484, MSx1, MSy1, MSx2, MSy2, 10);
      if Length(MyTPA) = 0 then FindColorsTolerance(MyTPA, 8156019, MSX1, MSY1, MSX2, MSY2, 10);
        begin
        if Length(MyTPA) = 0 then MakeCompass('E');
          FindColorsTolerance(MyTPA, 11576484, MSx1, MSy1, MSx2, MSy2, 10);
          if Length(MyTPA) = 0 then FindColorsTolerance(MyTPA, 8156019, MSX1, MSY1, MSX2, MSY2, 10);
             if Length(MyTPA) = 0 then MakeCompass('S');
               FindColorsTolerance(MyTPA, 11576484, MSx1, MSy1, MSx2, MSy2, 10);
               if Length(MyTPA) = 0 then FindColorsTolerance(MyTPA, 8156019, MSX1, MSY1, MSX2, MSY2, 10);
                 if Length(MyTPA) = 0 then MakeCompass('E');
                   FindColorsTolerance(MyTPA, 11576484, MSx1, MSy1, MSx2, MSy2, 10);
                   if Length(MyTPA) = 0 then FindColorsTolerance(MyTPA, 8156019, MSX1, MSY1, MSX2, MSY2, 10);
                     if Length(MyTPA) = 0 then MakeCompass('W');
                       FindColorsTolerance(MyTPA, 11576484, MSx1, MSy1, MSx2, MSy2, 10);
                       if Length(MyTPA) = 0 then FindColorsTolerance(MyTPA, 8156019, MSX1, MSY1, MSX2, MSY2, 10);
                         if Length(MyTPA) = 0 then Writeln('can not find gaurdian, exiting');
                         exit;
        for i := 0 to High(MyTPA)do
        begin
          MyPoint := MyTPA[i]
          MMouse (MyPoint.x, MyPoint.y, 3, 3);
          if (IsUpText('uardian')) then
            begin
              GetMousePos(x, y);
              Mouse(x, y, 0, 0, False);
              ChooseOption('bserve');
              Wait(5000+random(250));
              writeln('found color');
              Wait(900+random(350));
            end;
       end;
        end;
    end;

    procedure findmaze1; //checks if its maze #1

    begin
      if Length(MyTPA) = 0 then FindColorsTolerance(MyTPA, 8156019, MSX1, MSY1, MSX2, MSY2, 10); //i need to change the coords
        for i := 0 to High(MyTPA)do
        begin
          MyPoint := MyTPA[i]
          MMouse (MyPoint.x, MyPoint.y, 3, 3);
          if (IsUpText('uardian')) then
            begin
              if FindColorTolerance(x, y, 2107433, 243, 68, 110, 284, 10) then// ending point, darkest color
                writeln('this is maze 1');
            end;
        end;
    end;

    {procedure findmaze2;

    procedure findmaze3;

    procedure findmaze4;

    procedure findmaze5;

    procedure findmaze6;

    procedure findmaze7;

    procedure findmaze8;

    procedure findmaze9;

    procedure findmaze10;

    procedure findmaze;}



    begin
      MakeCompass('N');
      mousespeed := 7;
      walktomaze;
      wait(5000);
      clickguardian;
    end.

    love, hate, and feed back is welcome.
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  2. #2
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Wow thats a nice maze solver .

    Your function wont work because you have two identifiers, Diameter.

    Try this function:
    SCAR Code:
    function GetCircumfrence(diameter:integer):extended;
    begin
      Result := (2*Pi*(Diameter Div 2));
    end;

    Thats if your trying to find the circumference.

    Good Luck with scripting

  3. #3
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    thanks nauman =D

    and, thread is updated
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Starting SCAR Scripting, and i need help
    By Lance in forum OSR Help
    Replies: 5
    Last Post: 09-27-2008, 12:55 PM
  2. starting scripting
    By j035m03 in forum OSR Help
    Replies: 8
    Last Post: 07-16-2008, 02:04 PM
  3. Made a sig after a long break...
    By GoF in forum Graphics and Multimedia
    Replies: 6
    Last Post: 02-14-2008, 12:54 AM

Posting Permissions

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