Results 1 to 11 of 11

Thread: procedure FFlag(Distance: Integer);

  1. #1
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    6,136
    Mentioned
    28 Post(s)
    Quoted
    17 Post(s)

    Default procedure FFlag(Distance: Integer);

    FFlag works in a similar fashion like Flag, only FFlag solves a number of problems for you.
    1. It has a build-in timer, that solves the Hanging-Flag problem that sometime occurs (Flag wont go away from screen). If the Flag is still visible after 20 seconds, it will replant the Flag once at Color 255 (= itself). After that, you are on your own...
    2. FFlag exits, when the Flag is within Distance distance. As a result, your Player will roadwalk without stopping between each click.


    SCAR Code:
    {*******************************************************************************
    procedure FFlag(Distance: Integer);
    By: Wizzup? / WT-Fakawi.
    Description: Waits until Flag is within "Distance" distance.
    *******************************************************************************}

    procedure FFlag(Distance: Integer);
    var
      XK, YK, XL, YL : Integer;
    var
      T1, T2 : Extended;
    begin
      T1 := GetTickCount;
      repeat
        T2 := GetTickCount;
        Wait(100);
        if HumanCircleFlag(Distance) then
          Break;
        Wait(100);
        if T2 - T1 > 30000 then
        begin
          if FindColor(XL, YL, 255, MMX1, MMY1, MMX2, MMY2) then
             MouseFindFlag(XL, YL, 1, 1)
          else Mouse(MMCX, MMCY, 0, 0, True);
          break;
        end;
        if Random(20) = 1 then IdleTime(500,1000,0.01);
      until (not FindColor(XK, YK, 255, MMX1, MMY1, MMX2, MMY2));
    end;
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

  2. #2
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Didn't ronny.m.p make a cool function called RonnyFlag that also searches for the flag "pole" so you could walk north. Because, sometimes you can't see the flag but you can see the pole.

    EDIT: Oh wait sry, didn't ronny get banned?

  3. #3
    Join Date
    Dec 2006
    Posts
    908
    Mentioned
    1 Post(s)
    Quoted
    17 Post(s)

    Default

    So, a stupid question, do i just put -1, -2, -3 etc... if i want to make it continue walking without waiting for the flag?

    And also is it measured by pixels? (The distance)

  4. #4
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    Distance should be a positive number.
    Its the number of pixels close you are to the flag before the script decided to exit the procedure and carry on.
    Usually, I use 10-20 as the number.
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


  5. #5
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by deathscytex View Post
    So, a stupid question, do i just put -1, -2, -3 etc... if i want to make it continue walking without waiting for the flag?
    0-4 if you need to come to a stop.
    5-15 is you want to wait until right before the flag disappears.
    16-20 if you want to wait a little bit less.
    21+ if you're a crazy maniac person :-P

    It's possible to use RandomRange (generates a random number through two integers) in there

    SCAR Code:
    WriteLn(IntToStr(Random(Range(-5, 5))));

    could be

    -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, or 5.

    SCAR Code:
    FFlag(0); //Complete stop
    FFlag(RandomRange(0, 4)); //Stop
    FFlag(RandomRange(5, 15)); //Right before
    FFlag(RandomRange(16, 20)); //Little longer

    of course you could do whatever you want and do something like

    SCAR Code:
    FFlag(RandomRange(5, 20));

    also, FFlag is function and returns a Boolean, although, it will perform all of searching and waiting before you get the result, it is not the same as FlagPresent: Boolean; in terms of what it actually does.

    SCAR Code:
    if (FFlag(0)) then
      WriteLn('Flag was found when mini-map was clicked.');

    Hope me and Star answered your question(s).

  6. #6
    Join Date
    Dec 2006
    Posts
    908
    Mentioned
    1 Post(s)
    Quoted
    17 Post(s)

    Default

    Thanks! I finally got it! I just put 0 because i never knew what it does...

  7. #7
    Join Date
    Jun 2007
    Location
    Greenville, SC
    Posts
    1,149
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ATTENTION: I have been working on a procedure called "DFFlag(Distance: Integer);" This will make a "wait" unneeded b4 the FFlag function. I'll post the final function here if allowed. It's still under testing.

    ~Runescape Pro

  8. #8
    Join Date
    Dec 2006
    Posts
    908
    Mentioned
    1 Post(s)
    Quoted
    17 Post(s)

    Default

    Lol, seems similar but both different in a way :P

  9. #9
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Runescape Pro View Post
    ATTENTION: I have been working on a procedure called "DFFlag(Distance: Integer);" This will make a "wait" unneeded b4 the FFlag function. I'll post the final function here if allowed. It's still under testing.

    ~Runescape Pro
    Dude that's really simple.

    I've done that thousands of times before...

    I made this in about 20 seconds:

    Edit: Fixed.

    SCAR Code:
    function DFFlag(Distance: Integer): Boolean;
    var
      T: LongInt;
    begin
      MarkTime(T);
      while (not ((FlagPresent) or ((TimeFromMark(T)) >= (RandomRange(5000, 7000))))) do
        Wait(RandomRange(100, 200));
      Result := FFlag(Distance);
    end;

  10. #10
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    Dude that's really simple.

    I've done that thousands of times before...

    I made this in about 20 seconds:

    SCAR Code:
    function DFFlag(Distance: Integer): Boolean;
    var
      T: LongInt;
    begin
      MarkTime(T);
      while (not ((FlagPresent) or (T >= (RandomRange(5000, 7000))))) do
        Wait(RandomRange(100, 200));
      Result := FFlag(Distance);
    end;
    The 'T' should be TimeFromMark(T)



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  11. #11
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    The 'T' should be TimeFromMark(T)
    Ah, ok...forgot that... I guess that's what I get for pulling a function out of my ass as fast as I can. :-P

    Here we go:

    SCAR Code:
    function DFFlag(Distance: Integer): Boolean;
    var
      T: LongInt;
    begin
      MarkTime(T);
      while (not ((FlagPresent) or ((TimeFromMark(T)) >= (RandomRange(5000, 7000))))) do
        Wait(RandomRange(100, 200));
      Result := FFlag(Distance);
    end;

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. function FRandFlag(Distance: Integer) : boolean;
    By Raskolnikov in forum Research & Development Lounge
    Replies: 5
    Last Post: 02-01-2008, 05:16 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
  •