Results 1 to 24 of 24

Thread: Walk to yellow/red dots on MM?

  1. #1
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default Walk to yellow/red dots on MM?

    I tried to use radial walk, it fails for some reason.

    Also, can I do this?
    SCAR Code:
    procedure checkinfight;boolean;
    var nif;
    begin
      if infight then exit;
      end else
      begin
        marktime(nif);
      end;
    end;

    procedure mainloop;
    begin
      xx;
     xx;
     repeat
     antiban;
     checkinfight;
     until TimeFromMark(nif)>xxx;
     recheck;//a procedure that hopworld.
    end;
    can I use mark time from an other procedure? Also, is there a way to "unmarktime"?
    Last edited by Main; 08-27-2009 at 05:19 PM.
    Oh Hai Dar

  2. #2
    Join Date
    Nov 2008
    Location
    Melbourne, Australia
    Posts
    2,240
    Mentioned
    3 Post(s)
    Quoted
    11 Post(s)

    Default

    SCAR Code:
    program New;
    {.Include SRL/SRL.scar}
    Var
      X, Y:Integer;
    begin
      SetupSRL;
      X := MMCX
      Y := MMCY
      If(FindColorSpiralTolerance(X, Y, ColourOnTheMinimap, MMX1, MMY1, MMX2, MMY2, Tolerance?)) then
      Mouse(X, Y, 3, 3, True)
      else
      Writeln('Could not walk');
    end.

    Give that a try
    Click here to find out how to get full screen without members! | Click here to check out my Ultimate Bitmap Tutorial! Edited to work with Simba! |

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

    Default

    Use GetMiniMapDotsIn then get the first point and walk to it

  4. #4
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    Ty you two
    Oh Hai Dar

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

    Default

    Quote Originally Posted by Main_Ftw View Post
    Also, can I do this?
    SCAR Code:
    procedure checkinfight;boolean;
    var nif;
    begin
      if infight then exit;
      end else
      begin
        marktime(nif);
      end;
    end;

    procedure mainloop;
    begin
      xx;
     xx;
     repeat
     antiban;
     checkinfight;
     until TimeFromMark(nif)>xxx;
     recheck;//a procedure that hopworld.
    end;
    can I use mark time from an other procedure? Also, is there a way to "unmarktime"?
    Regarding the second question. All would work, I think, but nif would have to be a Global variable.

    SCAR Code:
    program New;
    var
      Nif : Integer;

    procedure checkinfight;boolean;
    begin
      if infight then exit;
      end else
      begin
        marktime(nif);
      end;
    end;

    procedure mainloop;
    begin
      xx;
     xx;
     repeat
     antiban;
     checkinfight;
     until TimeFromMark(nif)>xxx;
     recheck;//a procedure that hopworld.
    end;

    Also, you did not declare which type of variable nif is. Using MarkTime, the variable must be an integer.

    Richard.
    <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.

  6. #6
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    yeah, sorry, I forgot (:

    so if the second time, its in fight. It would unmark the time (NIF)?
    Oh Hai Dar

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

    Default

    What do you mean? You want to reset Nif every time it finds a fight?
    <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.

  8. #8
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    yeah
    Could any one explain to my how does "getminimapdots" work?
    Last edited by Main; 08-27-2009 at 07:12 PM.
    Oh Hai Dar

  9. #9
    Join Date
    Feb 2007
    Location
    Estonia.
    Posts
    1,938
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Do you mean something like that:
    SCAR Code:
    program New;
    {.include srl/srl.scar}
    {.include srl/srl/skill/fighting.scar}

    var
      Nif: Integer;

    procedure CheckInFight;
    begin
      if InFight then Exit;
    end;

    begin
      SetupSRL;
      MarkTime(Nif);
      repeat
        CheckInFight;
      until (TimeFromMark(Nif) > 10000);
    end.
    ?
    ~Eerik~

  10. #10
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    I want the script to constantly check for infight.
    SCAR Code:
    procedure CIF
    begin
      If Infight then exit;
      else
        MarkTime(nif);
      end;
    end;

    procedure Mainloop;
    begin
      repeat
      CIF;//Check in fight, Infight:=true...etc
      (W/E);
      until TimeFromMark(NIF)>xxx
    end;

    Lets say atm, I am not infight, the script marks it NIF. But when I repeat CIF, and I am INFIGHT, I want the script to reset/unmark the time (NIF)
    Last edited by Main; 08-27-2009 at 06:16 PM.
    Oh Hai Dar

  11. #11
    Join Date
    Feb 2007
    Location
    Estonia.
    Posts
    1,938
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    SCAR Code:
    program New;
    {.include srl/srl.scar}
    {.include srl/srl/skill/fighting.scar}

    var
      NIF: Integer;

    begin
      SetupSRL;
      repeat
        if (not InFight) then
        begin
          Writeln('Not in fight.');
          MarkTime(NIF);
        end;
        repeat
          Wait(100);
          Writeln('Searching for fight.');
        until (InFight or (TimeFromMark(NIF) > 10000));
        Writeln('We found a fight or we passed the maximum waiting time.');
      until ((TimeFromMark(NIF) > 10000));
      Writeln('We passed maximum waiting time.');
    end.
    This one?
    ~Eerik~

  12. #12
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    OO ty

    Err.. the infight boolean fails for me(: lol
    Last edited by Main; 08-27-2009 at 06:31 PM.
    Oh Hai Dar

  13. #13
    Join Date
    Feb 2007
    Location
    Estonia.
    Posts
    1,938
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    If you get any more problems, feel free to add my MSN: eerik.muuli@hotmail.com.
    ~Eerik~

  14. #14
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    kk

    Is there a way to UNMARK time? Its killing me now!


    NVM, I found a alternative solution ^_^
    Last edited by Main; 08-27-2009 at 06:44 PM.
    Oh Hai Dar

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

    Default

    Quote Originally Posted by Main_Ftw View Post
    kk

    Is there a way to UNMARK time? Its killing me now!


    NVM, I found a alternative solution ^_^
    UnMark time?

    SCAR Code:
    Variable := 0; :)

  16. #16
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    ty...
    Great... now I have to do that change again lol ^_^
    Oh Hai Dar

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

    Default

    This?
    SCAR Code:
    program New;
    {.include SRL/SRL/scar}
    {.include SRL/SRL/skill/fighting.scar}

    var
      Nif : Integer;

    procedure CheckInFight;
    begin
      if Infight then
        Nif:= 0;
      else
        MarkTime(Nif);
    end;

    procedure MainLoop;
    begin
      Bla;
      Bla2;
     repeat
       AntiBan;
       CheckInFight;
     until TimeFromMark(Nif) > 10000;
     ReCheck;
    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.

  18. #18
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    yeah
    Could any one explain to my how does "getminimapdots" work?
    Last edited by Main; 08-27-2009 at 07:13 PM.
    Oh Hai Dar

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

    Default

    SCAR Code:
    {*******************************************************************************
    function GetMiniMapDots(WhatDot: String): TPointArray;
    By: Nava2
    Description: Results the dots specified by WhatDot on the Minimap. See GetMiniMapDots
                 in for more information.
    *******************************************************************************}

    function GetMiniMapDots(WhatDot: String): TPointArray;
    begin
      Result := GetMinimapDotsIn(WhatDot, MMX1, MMY1, MMX2, MMY2);
    end;

    Hopefully this will show you what to do:

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

    var
      MapTPA : TPointArray;
      I, X, Y : Integer;

    procedure MapDots;
    begin
      MapTPA:= GetMiniMapDots('red');
      if Length(MapTPA) = 0 then
        MapTPA:= GetMiniMapDots('npc');
      if Length(MapTPA) = 0 then
      begin
        WriteLn('No dots on the mini-map');
        Exit;
      end;
      for I:= 0 to High(MapTPA) do
      begin
        MMouse(MapTPA[I].x, MapTPA[I].y, 5, 5);
        FFlag(3);
        if FindColorSpiralTolerance(X, Y, 5121452, MSX1, MSY1, MSX1, MSY2, 15) then
        begin
          MMouse(X, Y, 5, 5);
          WaitUptext('oins', 350);
          GetMousePos(X, Y);
          Mouse(X, Y, 0, 0, True);
        end;
      end;
    end;
     
    begin
      SetupSRL;
      MapDots;
    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.

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

    Default

    From my next section:

    I'll just post some commented code for this one, I think there's only one usage of this procedure in SRL. And that is in the function GetMiniMapDotsIn:

    SCAR Code:
    {*******************************************************************************
    function GetMiniMapDotsIn(WhatDot: String; x1, y1, x2, y2: Integer): TPointArray;
    By: footballjds, NaumanAkhlaQ, Nava2 & Cazax
    Description: Results the dots specified by WhatDot in x1, y1, x2, y2.
    Usage : 'npc', 'yellow' : Yellow Dot;
            'cape', 'blue' : Blue Dot;
            'item', 'red' : Red Dot;
            'player', 'white' : White Dot;
            'friend', 'green' : Green Dot;
    *******************************************************************************}

    function GetMiniMapDotsIn(WhatDot: string; x1, y1, x2, y2: Integer): TPointArray;
    var
      Color: Integer;
    begin
      WhatDot := LowerCase(WhatDot);
      case WhatDot Of
        'npc', 'yellow': Color := 60909;  //The one color
        'cape', 'blue': Color := 12742980;// for FindColors is being setup here
        'item', 'red': Color := 789758;  
        'player', 'white': Color := 16711422;
        'friend', 'green': Color := 61440;
      else
        srl_Warn('GetMiniMapDotsIn', '"' + WhatDot + '" is not a valid dot type', warn_AllVersions);
      end;
      FindColorsSpiralTolerance(MMCX, MMCY, Result, Color, x1, y1, x2, y2, 0); //Finds all occurances of 'Color' this will search spiraling outwards from the MiniMap center.
      RAaSTPA(Result, 4); //LOOK HERE > This will make one point per box on a player dot, great for counting.
      if (Length(Result) < 1) then Exit; //Incase RAaSTPA sets Result as '0' due to no dots being found.
      if (WhatDot = 'player') or (WhatDot = 'white') then //Necessary.
      begin
        InvertTPA(Result);
        SetLength(Result, Length(Result) - 1);
        InvertTPA(Result);
      end;
    end;

    You see the prime usage of RAaSTPA is in this function, without it there would have been more lines of code, using this function makes it shorter. And remember the dots are round, so RAaSTPA accomodates that very nicely.

  21. #21
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    Hmmm It gaves results. How can I use it to click the nearest yellow dot thou? Near MMC.
    Findbitmapspiral doesn't work well with dots bit map (or color) for me.
    Oh Hai Dar

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

    Default

    The example I gave showed how you would do that:
    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    var
      MapTPA : TPointArray;
      I, X, Y : Integer;

    procedure MapDots;
    begin
      MapTPA:= GetMiniMapDots('red');
      if Length(MapTPA) = 0 then
        MapTPA:= GetMiniMapDots('npc');
      if Length(MapTPA) = 0 then
      begin
        WriteLn('No dots on the mini-map');
        Exit;
      end;
      for I:= 0 to High(MapTPA) do
      begin
        MMouse(MapTPA[i].x, MapTPA[i].y, 5, 5);
        FFlag(3);
        if FindColorSpiralTolerance(X, Y, 5121452, MSX1, MSY1, MSX1, MSY2, 15) then
        begin
          MMouse(X, Y, 5, 5);
          WaitUptext('oins', 350);
          GetMousePos(X, Y);
          Mouse(X, Y, 0, 0, True);
        end;
      end;
    end;
     
    begin
      SetupSRL;
      MapDots;
    end.

    If you need help understanding it, let me know.
    <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.

  23. #23
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default


    I'll read over some tutorials now.
    Oh Hai Dar

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

    Default

    I've annotated it. See if this helps:
    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    var
      MapTPA : TPointArray;
      I, X, Y : Integer;

    procedure MapDots;
    begin
      MapTPA:= GetMiniMapDots('red');   //Tries to find items on MM, and saves it to MapTPA
      if Length(MapTPA) = 0 then        //If none found (Length = 0) then...
        MapTPA:= GetMiniMapDots('npc'); //Will try to find NPCs
      if Length(MapTPA) = 0 then        //Again, if none were found...
      begin
        WriteLn('No dots on the mini-map'); //It will WriteLn and
        Exit;                               //Exit the procedure
      end;
      for I:= 0 to High(MapTPA) do          //Makes I = 0, and repeats ({} to {} on left) the amount of dots found (High(MapTPA))
    {}  begin
        MMouse(MapTPA[i].x, MapTPA[i].y, 5, 5); //Moves mouse to the X point, and Y point of the TPoint with 5,5 randomness
        FFlag(3);                               //Waits until player is 3 ?MM pixels? from destination
        if FindColorSpiralTolerance(X, Y, 5121452, MSCX, MSCY, MSC1, MSC2, 15) then  //Example of colour finding - made up colour
        begin   //Hopefully you understand from here on
          MMouse(X, Y, 5, 5);         //Moves mouse to where the colour was found
          WaitUptext('oins', 350);    //Waits for uptext 'oins'
          GetMousePos(X, Y);          //Saves where the cursor is
          Mouse(X, Y, 0, 0, True);    //Clicks left
        end;
    {}  end;
    end;

    begin
      SetupSRL;
      MapDots;
    end.
    Richard.
    <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.

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
  •