Results 1 to 6 of 6

Thread: Calling a procedure that calls that procedure?

  1. #1
    Join Date
    Oct 2010
    Location
    Under a bridge
    Posts
    648
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Calling a procedure that calls that procedure?

    Ok so i have a wait procedure which does anti ban and calls find randoms while waiting but in my antiban i want a min or two wait and for this wait i want to call the wait procedure i have made to check for randoms and anti. So my question is do i need to make two wait procedures or is there way to be able to call something below you in the code? So if it does not make much sense but basicly

    Simba Code:
    procedure AntiBan;
    Begin
      TrollWait;
    End;

    Procedure TrollWait;
    Begin
      AntiBan;
    End;


    Something like that, but of cousre it has more code in it

    Thanks for any help

    ~Troll
    Quote Originally Posted by DD on IRC
    wanted to troll the troll

  2. #2
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    I'm a bit confuzzled. :S In your Anti-ban, you also want to be checking for randoms, yes?

    How about something like this?:

    Simba Code:
    Procedure AntiBan;
      var
        i: Integer;
      begin
        if not LoggedIn then Exit;
        R_FindRandoms;
        i := Random(250);

        case i of
          1..10: RandomAngle(1);
          11: Hoverskill('Farming',False);
          12: RandomMovement;
        end;

        Wait(RandomRange(100,250));
      end;

    So as long as 'AntiBan' is being called, it will randomly pick a number between 1 and 250 every 100-250 milliseconds. If that number is between 1-12, it will do one of those anti-bans, but from 13-250 (obviously checked more often) it will search for Randoms and if you're player is logged in.

    Hopefully that answers your question.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  3. #3
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  4. #4
    Join Date
    Feb 2009
    Location
    Irvine, CA
    Posts
    2,873
    Mentioned
    8 Post(s)
    Quoted
    138 Post(s)

    Default

    Simba Code:
    program new;


    procedure B; forward;


    procedure A;
    begin
      writeln('A');
      B;
    end;


    procedure B;
    begin
      writeln('B');
      A;
    end;


    begin
      A;
    end.
    Run it and see what it does

  5. #5
    Join Date
    Oct 2010
    Location
    Under a bridge
    Posts
    648
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the help every one

    Quote Originally Posted by TomTuff View Post
    Simba Code:
    program new;


    procedure B; forward;


    procedure A;
    begin
      writeln('A');
      B;
    end;


    procedure B;
    begin
      writeln('B');
      A;
    end;


    begin
      A;
    end.
    Run it and see what it does
    Thanks for pointing the end less loop out I would of missed it for a while as they way i called it the only time it would go into that loop would be 1 in 500. Thanks again everyone
    Quote Originally Posted by DD on IRC
    wanted to troll the troll

  6. #6
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    That is called recursion in a less elegant way!
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

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
  •