Results 1 to 4 of 4

Thread: How do i get a function in a mainloop?

  1. #1
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default How do i get a function in a mainloop?

    SCAR Code:
    function Totrees: Boolean;
      begin
      If not loggedin then
      exit;
      begin

      If FindSymbol(x, y,'fishing spot') then
      Begin
        Mouse(x, y, 5, 5, True);
        Wait(100);
        FFlag(0);
        Wait(1000);
        if FindObjCustom(cx, cy, ['Willow', 'llow'], [TreeColor1, TreeColor2], 3) then
        begin
        Result := True;
        Attrees := True;
             end else Result := False;
    End;
    end;
    end;

    That is telling it to walk to the trees, my question is how can i get it into the main loop. I go like this
    SCAR Code:
    begin
    declareplayers;
    totrees;

    And it says identifier expected at where i put it in the main loop It compiles if i dont put it in the main loop. If it cant be done then can you change it in to a procedure that compiles and work.. Because i get errors..

  2. #2
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    maybe put if ToTrees then

  3. #3
    Join Date
    Aug 2007
    Location
    Emo-land
    Posts
    1,109
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol man, work on your standards: 2 spaces in for begins and 2 back for ends.
    SCAR Code:
    function Totrees: Boolean;
    begin
      If Not(LoggedIn) then
        Exit;
      If FindSymbol(x, y,'fishing spot') then
      begin
        Mouse(x, y, 5, 5, True);
        Wait(100);
        FFlag(0);
        Wait(1000);
        if FindObjCustom(cx, cy, ['Willow', 'llow'], [TreeColor1, TreeColor2], 3) then
        begin
          Result := True;
          AtTrees := True;
        end;
        //Don't need else false because it is set to false by default.
      end;
    end;

    Begin
      SetupSRL;
      DeclarePlayers;
      if ToTrees then
        ChopTree;
    end.

  4. #4
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by FrÕzÑ_§ÕµL View Post
    Lol man, work on your standards: 2 spaces in for begins and 2 back for ends.
    SCAR Code:
    function Totrees: Boolean;
    begin
      If Not(LoggedIn) then
        Exit;
      If FindSymbol(x, y,'fishing spot') then
      begin
        Mouse(x, y, 5, 5, True);
        Wait(100);
        FFlag(0);
        Wait(1000);
        if FindObjCustom(cx, cy, ['Willow', 'llow'], [TreeColor1, TreeColor2], 3) then
        begin
          Result := True;
          AtTrees := True;
        end;
        //Don't need else false because it is set to false by default.
      end;
    end;

    Begin
      SetupSRL;
      DeclarePlayers;
      if ToTrees then
        ChopTree;
    end.
    lol i hadnt finished script and didnt use my program that does it for me.. btw.. in wc section i realesed beta. can u test?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Designing a mainloop - make it failsafe
    By pwnaz0r in forum Outdated Tutorials
    Replies: 28
    Last Post: 09-10-2008, 09:05 AM
  2. MainLoop Problems
    By elf5380 in forum OSR Help
    Replies: 6
    Last Post: 04-27-2008, 06:44 PM
  3. Replies: 2
    Last Post: 02-26-2008, 08:26 PM
  4. [FUNCTION] FindDoorColour: integer; By ZephyrsFury [FUNCTION]
    By ZephyrsFury in forum Research & Development Lounge
    Replies: 10
    Last Post: 07-27-2007, 08:45 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
  •