Results 1 to 9 of 9

Thread: Desperly Need A Function/Procedure

  1. #1
    Join Date
    Dec 2006
    Location
    UK
    Posts
    118
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Desperly Need A Function/Procedure

    I realy need a compass function/procedure that can set the compass to N,W,E,S, and make all of the lines on the minimap stright. I have tried to make this myself before, but without sucsess.


    Thanks
    THE NERD

  2. #2
    Join Date
    Oct 2006
    Posts
    2,297
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    How you mean?
    MakeCompas('N');
    MakeCompas(E');
    MakeCompas('S');
    MakeCompas('W');
    Do you mean this?
    [QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
    [CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]

  3. #3
    Join Date
    Feb 2006
    Posts
    920
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm sorry but it's just not possible using SCAR, Jagex has prevented this by detecting if an angle is 0 then it will randomly move it a bit to the right or the left..
    If you need perfectly straight lines then we're back to ScarScape scripting where walking could be done like Mouse, Mouse, Mouse, Mouse... booring, and a real script wouldn't need straight lines...
    What do you need it for?

  4. #4
    Join Date
    Dec 2006
    Location
    UK
    Posts
    118
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by the scar noob View Post
    How you mean?
    MakeCompas('N');
    MakeCompas(E');
    MakeCompas('S');
    MakeCompas('W');
    Do you mean this?
    No,
    I need a procedure that can line up the vertical and horzontal line on the minimap. Aswell as change the compass direction. There used to be one be it is not capatable with the current SRL and i can't change it to make it capatable

  5. #5
    Join Date
    Dec 2006
    Location
    UK
    Posts
    118
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Lorax View Post
    I'm sorry but it's just not possible using SCAR, Jagex has prevented this by detecting if an angle is 0 then it will randomly move it a bit to the right or the left..
    If you need perfectly straight lines then we're back to ScarScape scripting where walking could be done like Mouse, Mouse, Mouse, Mouse... booring, and a real script wouldn't need straight lines...
    What do you need it for?
    I no but im not producing and script, but a set of world walk procedures. I have reduced the need for it to have stright line on the minimap, but there is still 2 out of 10 chances it will get it wrong. The lines don't need to be perfect, just almost. And procedures can compensate the screen sway. But perfect north and things like that arn't acurrect enough for my procedure to move charater reliably around the world map.

  6. #6
    Join Date
    Mar 2006
    Location
    United States, -7:00 GMT
    Posts
    1,790
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Use radialwalk, it works excellent, and is easy to learn.

    hakuna matata ;)

  7. #7
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    It's not that hard to make one of these, actually. Just copy the MakeCompass procedure out of SRL, rename it to something else like MakeCompass1, and replace the FindColor command that determines when the compass point is in the correct place with a different way to detect straight lines on the minimap. I did this before with DTMs of straight lines. Maybe I'll whip one up later.

  8. #8
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Here you go, took 20 minutes including testing.

    Code:
    program New;
    {.include SRL/SRL.scar}
    function MakeCompass1(Side: string): Boolean;
    var
      Fx, Fy, dx, dy, StartPos, EndPos, Vline: Integer;
      ComMark: Integer;
      Left_Right: Boolean;
    begin
      StartPos := FindCompassAngle;
      MarkTime(ComMark);
      case LowerCase(Side) of
        'n': if StartPos > 180 then EndPos := 360 else EndPos := 0;
        'e': if StartPos < 270 then EndPos := 90 else EndPos := 450;
        's': EndPos := 180;
        'w': if StartPos < 90 then EndPos := -90 else EndPos := 270;
      end;
      if StartPos > EndPos then Left_Right := True
        else if StartPos < EndPos  then Left_Right := False
        else exit;
      VLine := DTMFromString('78DA636C656260286340011FDF3D673002D28' +
           'C40FC1F0818416AB270AB0101B09A2622D414E056C3045353835F' +
           '0D005A9217D4');
      repeat
        if Left_Right then KeyDown(VK_RIGHT)
      else KeyDown(VK_Left);
        Wait((10) + Random(10));
        if Left_Right then KeyUp(VK_Right)
      else KeyUp(VK_Left);
        if (FindDTM(VLine,dx, dy, MMX1, MMY1, MMX2, MMY2)) then
        begin
          Result := True;
          Writeln('Found VLine');
          break;
        end;
      until (TimeFromMark(ComMark) > 7000);
      FreeDTM(VLine);
    end;
    
    begin
      SetupSRL;
      ActivateClient;
      MakeCompass1('n');
    end.
    By the way, if you don't need it 100% accurate, then you can move the KeyUp and KeyDown statements outside the loop. If you do this, it will consistently over-shoot by a small amount, but it will be close.

  9. #9
    Join Date
    Dec 2006
    Location
    UK
    Posts
    118
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Wow, thanks tarajunky. I've been trying to make one of these for ages man. That a real help for my world walk stuff which has been on hold untill i could find one of these

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. A Function/Procedure
    By Abbott in forum OSR Help
    Replies: 7
    Last Post: 09-09-2008, 08:48 PM
  2. Function/Procedure for counting
    By Hatched.Egg in forum OSR Help
    Replies: 2
    Last Post: 05-31-2008, 07:20 PM
  3. Function and Procedure 'variables'.
    By Wizzup? in forum OSR Advanced Scripting Tutorials
    Replies: 11
    Last Post: 03-27-2008, 03:07 AM
  4. 1 procedure or function
    By Kasi in forum OSR Help
    Replies: 1
    Last Post: 03-03-2008, 10:12 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
  •