Results 1 to 6 of 6

Thread: Please Help me.

  1. #1
    Join Date
    Oct 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Please Help me with this scar script I'm coding.

    Hi all. Thanks for taking the time to help me.This is my first powerchopper, as evident in the title,of my script, and I have a few problems. So far its only one part of the script, but here's the whole script anyway. The whole problem is at the bottom.

    Code:
    program Myfirstpowerchopper;
    {.include srl/srl.scar}
    
    Const
    treecolor1= 1517602;
    treecolor2= 3826305;
    
    Var
    x,y,L,MyMark : Integer;
    
    Procedure Startcutting;
    
    begin
    if(FindObj(x,y,'ree',TreeColor1,25))then
    begin
    Mouse(x,y,5,5,True);
    Writeln('walkingtotree')
    Flag;
    Writeln('CuttingTree')
    L:= InvCount;
    repeat
    if not Loggedin then
    exit;
    Until(InvCount > L);
    Writeln('TreeCut');
    If TimeFromMark(MyMark)> (2*60*100)then
    begin
    Logout;
    Exit;
    End;
    End;
    End;
    
    Procedure startcutting2;
    begin
    If (FindObj(x,y,'hop',Treecolor2,25))then
    begin
    Mouse(x,y,0,0,False);
    if ChooseOption('hop') then
    begin
    Writeln('walkingtotree')
    Flag;
    Writeln('CuttingTree')
    end;
    L:= InvCount;
    repeat
    Until(InvCount > L);
    Writeln('TreeCut');
    end;
    end;
    begin
    If TimeFromMark(MyMark)> (2*60*100)then
    begin
    Logout;
    Exit;
    End;
    End;
    
    
    
    Procedure AntiBanActions;
    
    begin
    
    case 1 + Random(3) of
    0 : HoverSkill('random', false);
    1 : RandomRClick;
    2 : GameTab(1 + Random(13));
    
    end;
    end;
    
    Procedure antirandoms;
    begin
    if FindFight then
    begin
    RunAwayDirection('W');
    Wait(12000+random(15000));
    RunBack;
    end;
    FindLamp('woodcutting');
    
    end;
    
    Procedure invcheck;
    begin
    if InvFull = true then
    DropAll;
    
    end;
    
    
    Begin
    
    SetupSRL;
    ActivateClient;
    Disguise('www.runescape.com - Mozilla Firefox');
    SetRun(true);
    MakeCompass('N');
    StartCutting;
    AntiBanActions;
    FindNormalRandoms;
    Antirandoms;
    invcheck;
    Repeat
    Until(false);
    
    end.
    It says I have to add a "." at this point :
    Code:
    Procedure startcutting2;
    begin
    If (FindObj(x,y,'hop',Treecolor2,25))then
    begin
    Mouse(x,y,0,0,False);
    if ChooseOption('hop') then
    begin
    Writeln('walkingtotree')
    Flag;
    Writeln('CuttingTree')
    end;
    L:= InvCount;
    repeat
    Until(InvCount > L);
    Writeln('TreeCut');
    end;
    end;
    begin
    If TimeFromMark(MyMark)> (2*60*100)then
    begin
    Logout;
    Exit;
    End;
    End;
    End;(//They want me to add it here.)
    Why? If I add a period, wouldn't it only compile and execute the first part without going through the main loop?

  2. #2
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Your basic program is structured liek this
    SCAR Code:
    program whatever;

    begin
    end. //with a period

    all other ends are followed by a ;
    SCAR Code:
    program helloworld;

    begin
     if random(2) = 1 then
     begin
      writeln('helloworld');
     end;
    end.
    ~ Metagen

  3. #3
    Join Date
    Oct 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes, what I'm trying to say is that they force me to add a "." whenever I put more than 2 "end;" in a procedure,Eg I wanted
    Code:
    end;
    end;
    end;
    but they want me to put it like
    Code:
    end;
    end;
    end.
    even if I still have more things to add. I am asking if it is because of anything in the script or simply because I cannot have more than two "ends"

  4. #4
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    Procedure startcutting2;
    begin
     If (FindObj(x,y,'hop',Treecolor2,25))then
     begin
      Mouse(x,y,0,0,False);
      if ChooseOption('hop') then
      begin
       Writeln('walkingtotree')
       Flag;
       Writeln('CuttingTree')
      end;
      L:= InvCount; {i think this}
      repeat
       {goes here}
      Until(InvCount > L);
      Writeln('TreeCut');
     end;
    end; {i think this end should not be there either, this end is the ending block for your procedure code.}

    {is this supposed to be another procedure, if not then}
    begin {why is there a begin here}
     If TimeFromMark(MyMark)> (2*60*100)then
     begin
      Logout;
      Exit;
     End;
    End;
    End;(//They want me to add it here.) {why is there an extra end here}

    ok from the looks of it you are repeating nothing
    go like this
    SCAR Code:
    repeat
     {things to repeat}
    until {condition met}

    and i think you have too many ends. Also do what i did, indent your code (makes it so much nicer to figure problems just like this out. GL fixing your script =]
    ~ Metagen

  5. #5
    Join Date
    Oct 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the help, I'm feeling kinda sleepy, I'll try to fix it tomorrow, its night here in Singapore. thanks for all the help, really appreciate it.

  6. #6
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Your welcome. i love helpin
    ~ Metagen

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
  •