Results 1 to 7 of 7

Thread: Error, Help!

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

    Default Error, Help!

    Iam making an edgeville man killer and bone collector, but i seem to be having semicolon errors with scripts that i make...

    Error.
    SCAR Code:
    Failed when compiling
    Line 16: [Error] (14697:5): Semicolon (';') expected in script C:\Program Files\SCAR 3.13\Scripts\BoneCollector.scar

    Script.
    SCAR Code:
    Program BoneCollector;
    {.Include SRL/SRL.Scar}
    Var
    X, Y : Integer;

    Const
    HouseColor = 2311011;//Pick The Brown Color Of The House On Mini-Map.

    Procedure CheckDoor;
    Begin
     MakeCompass('N');
      If(FindObj(x, y, 'lose', 2637128, 5))Then
       Mouse(x, y, 1, 1, True);
      Wait(5000+random(5000));
     WriteLn('Door Is Closed, Opening Door');
    End Else
      If(Not(FindObj(x, y, 'lose', 2637128, 5)))And(Not(FindObj(x, y, 'pen', 2637128, 5)))Then
       WriteLn('Door Not Found, Looking For Door Again');
      MakeCompass('E');
        If(FindObj(x, y, 'lose', 2637128, 5))Then
         Mouse(x, y, 1, 1, True);
        Wait(5000+random(5000));
      WriteLn('Door Is Closed, Opening Door');
    End Else
    If(Not(FindObj(x, y, 'lose', 2637128, 5)))And(Not(FindObj(x, y, 'pen', 2637128, 5)))Then
     WriteLn('Door Not Found, Looking For Door Again');
      MakeCompass('S');
       If(FindObj(x, y, 'lose', 2637128, 5))Then
        Mouse(x, y, 1, 1, True);
       Wait(5000+random(5000));
      WriteLn('Door Is Closed, Opening Door');
     End Else
      If(Not(FindObj(x, y, 'lose', 2637128, 5)))And(Not(FindObj(x, y, 'pen', 2637128, 5)))Then
       WriteLn('Door Not Found, Looking For Door Again');
        MakeCompass('W');
         If(FindObj(x, y, 'lose', 2637128, 5))Then
          Mouse(x, y, 1, 1, True);
         Wait(5000+random(5000));
        WriteLn('Door Is Closed, Opening Door');
       End Else
      If(Not(FindObj(x, y, 'lose', 2637128, 5)))And(Not(FindObj(x, y, 'pen', 2637128, 5)))Then
     WriteLn('Door Not Found Anywhere Near By, Exiting');
    Exit;
      TerminateScript;
    End;

    Procedure WalkToHouse;
    Begin
     PerfectNorth;
      HighestAngle;
    Begin
      If(FindSymbol(x, y, 'furnace'))Then
       Mouse(x, y, 1, 1, True);
      Flag;
       WriteLn('Found Furnace, Walking To Furnace');
    Begin
     ClickExactMMColorTol(HouseColor, 5);
      Flag;
       WriteLn('Found House, Walking To House');
    Begin
     CheckDoor;
      End;
      End;
     End;
    End;

    Begin
    SetUpSRL;
    Begin
    WalkToHouse;
    End;
    End.

    Please help me i really badly need to fix this.
    Woot woot.

  2. #2
    Join Date
    Jul 2007
    Location
    Players[CurrentPlayer].Loc:='Bank'
    Posts
    875
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    To many end else. lets take something simple.
    SCAR Code:
    program new;
    {.include SRL/SRL.scar}
    var
    x,y :integer;
    begin
      if FindColor(x,y,466,msx1,msy1,msx2,msy2) then
      begin
        writeln('5')
      end else
      begin
        writeln('1');
      end;
    end.
    That will look for the color. If it finds it it will write 5. If it doesn't it will write 1. You can't have else, because else means that if anything BUT what you said before then it does this.
    Quote Originally Posted by sirlaughsalot
    .... Obama had the devil jump out of his ass, run and stab Hillary in the back...
    ILMMTYAEAFHPY.

  3. #3
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    Program BoneCollector;
    {.Include SRL/SRL.Scar}
    Var
    X, Y, Tries : Integer;
    DoorFound : Boolean;

    Const
    HouseColor = 2311011;//Pick The Brown Color Of The House On Mini-Map.

    Procedure CheckDoor;
    Begin
      MakeCompass('N');
      DoorFound := False;
      Tries := 0;
      repeat
        If(FindObj(x, y, 'lose', 2637128, 5))Then
          MMouse(x, y, 2, 2);
        if IsUpText('lose') then
          Mouse(x, y, 1, 1, True);
          begin
            DoorFound := True;
          end;
          Wait(5000+random(5000));
          WriteLn('Door Is Closed, Opening Door');
        If(Not(FindObj(x, y, 'lose', 2637128, 5)))And(Not(FindObj(x, y, 'pen', 2637128, 5)))Then
          WriteLn('Door Not Found, Looking For Door Again');
          Tries := Tries + 1;
          Writeln('Finding Door Try number: '+ IntToStr(Tries));
      until (DoorFound) or (Tries > 50)
      if Tries > 50 then
        Writeln(' Looked and didnt find after 50 tries Nxt player');
        Exit;
        TerminateScript;
    End;

    Procedure WalkToHouse;
    Begin
     PerfectNorth;
      HighestAngle;
    Begin
      If(FindSymbol(x, y, 'furnace'))Then
       Mouse(x, y, 1, 1, True);
      Flag;
       WriteLn('Found Furnace, Walking To Furnace');
    Begin
     ClickExactMMColorTol(HouseColor, 5);
      Flag;
       WriteLn('Found House, Walking To House');
    Begin
     CheckDoor;
      End;
      End;
     End;
    End;

    Begin
    SetUpSRL;
    Begin
    WalkToHouse;
    End;
    End.

    Try that instead

    ~Spaz

  4. #4
    Join Date
    Jul 2007
    Posts
    1,055
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    Program BoneCollector;
    {.Include SRL/SRL.Scar}
    Var
    X, Y : Integer;

    Const
    HouseColor = 2311011;//Pick The Brown Color Of The House On Mini-Map.

    Procedure CheckDoor;
    Begin
     MakeCompass('N');
      If(FindObj(x, y, 'lose', 2637128, 5))Then
       Mouse(x, y, 1, 1, True);
      Wait(5000+random(5000));
     WriteLn('Door Is Closed, Opening Door');
     If(Not(FindObj(x, y, 'lose', 2637128, 5)))And(Not(FindObj(x, y, 'pen', 2637128, 5)))Then
       WriteLn('Door Not Found, Looking For Door Again');
      MakeCompass('E');
        If(FindObj(x, y, 'lose', 2637128, 5))Then
         Mouse(x, y, 1, 1, True);
        Wait(5000+random(5000));
      WriteLn('Door Is Closed, Opening Door');
    If(Not(FindObj(x, y, 'lose', 2637128, 5)))And(Not(FindObj(x, y, 'pen', 2637128, 5)))Then
     WriteLn('Door Not Found, Looking For Door Again');
      MakeCompass('S');
       If(FindObj(x, y, 'lose', 2637128, 5))Then
        Mouse(x, y, 1, 1, True);
       Wait(5000+random(5000));
      WriteLn('Door Is Closed, Opening Door');
      If(Not(FindObj(x, y, 'lose', 2637128, 5)))And(Not(FindObj(x, y, 'pen', 2637128, 5)))Then
       WriteLn('Door Not Found, Looking For Door Again');
        MakeCompass('W');
         If(FindObj(x, y, 'lose', 2637128, 5))Then
          Mouse(x, y, 1, 1, True);
         Wait(5000+random(5000));
        WriteLn('Door Is Closed, Opening Door');
      If(Not(FindObj(x, y, 'lose', 2637128, 5)))And(Not(FindObj(x, y, 'pen', 2637128, 5)))Then
     WriteLn('Door Not Found Anywhere Near By, Exiting');
    Exit;
      TerminateScript;
    End;

    Procedure WalkToHouse;
    Begin
     PerfectNorth;
      HighestAngle;
    Begin
      If(FindSymbol(x, y, 'furnace'))Then
       Mouse(x, y, 1, 1, True);
      Flag;
       WriteLn('Found Furnace, Walking To Furnace');
    Begin
     ClickExactMMColorTol(HouseColor, 5);
      Flag;
       WriteLn('Found House, Walking To House');
    Begin
     CheckDoor;
      End;
      End;
     End;
    End;

    Begin
    SetUpSRL;
    Begin
    WalkToHouse;
    End;
    End.

    This one works too. BTW; your spacing is terrible please work on that.

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

    Default

    osmm, why not just use the repeat function and make it a lot smaller, so have
    SCAR Code:
    repeat
    //look for stuff
    untill (found) or tires >= 50) then
    smaller and neater and easier to read

    ~Spaz

  6. #6
    Join Date
    Jul 2007
    Posts
    1,055
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sorry I didn't really read the script at all. I just was making it complie. =/ I'll go back thru it.

    EDIT: Yea yours is better. lol, mine only trys once. I wouldn't try 50 times mayb 10-20 but yea don't use mine.

  7. #7
    Join Date
    Oct 2007
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Spaz i like yours but the thing is i want it to turn the compass so if you are abit farther from the door then it will probally find it because it turned the compass..
    Woot woot.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Line 135: [Error] (14845:1): Syntax error in script
    By AbsTrACt'^.| in forum OSR Help
    Replies: 16
    Last Post: 05-23-2008, 01:14 PM
  2. Replies: 5
    Last Post: 02-26-2008, 04:14 PM
  3. Smart error and Some kind of Math.scar error
    By FagetHax0r in forum OSR Help
    Replies: 6
    Last Post: 02-24-2008, 10:43 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
  •