Results 1 to 3 of 3

Thread: Variable expected?

  1. #1
    Join Date
    Mar 2007
    Location
    Ohio
    Posts
    138
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Variable expected?

    Im getting really ticked off with my script i'm making, but on the bright side you can see how its coming along(and you get to help me ). So im getting this error: Line 1: [Error] (1:1): Variable Expected in script C:\Program Files\SCAR 3.14\Scripts\Stamp's RuneMysteries Quester.scar

    i know it has something simple and it MUST have to do with the AutoColor procedure for a ladder, but anyways heres what i got
    SCAR Code:
    program RuneMysteriesQuester;
    {.include SRL/SRL.scar}

    var
    x, y: Integer;

    function TellyToLumby: Boolean;
    begin
      if(Players[CurrentPlayer].Booleans[0])then Exit;
      if(not(LoggedIn))then Exit;
      GameTab(7);
      Mouse(571, 239, 6, 6, true);
      wait(11000 + random(3000));
      SymbolAccuracy := 0.6;
      if(FindSymbol(x, y, 'Quest'))then Result := True;
      if(FindSymbol(x, y, 'Water'))then Result := True;
      SymbolAccuracy := 0.8;
    end;

    {------------------------------------------------------------------------------]
    [ function ClickAnswer(Answer: string): Boolean;                               ]
    [ by: ZephyrsFury                                                              ]
    [ Description: Clicks the answer in an NPC chat.                               ]
    {------------------------------------------------------------------------------}

    function ClickAnswer(Answer: string; Times: Integer): Boolean;
    var
      j, i: Integer;
    begin
      if (not(LoggedIn)) then Exit;
      //if (TimeExceeded) then Exit;
      j := 0;
      i := 0;
      repeat
        if (FindNPCChatText(Answer, ClickLeft)) then
        begin
          FTWait(4);
          Inc(i);
        end;
        j := j + 1;
      until(j = Times);
      if (j = i) then Result := True;
    end;


    function AutoColorIt: Integer;
    var
      X, Y, Z: Extended;
      Points: TPointArray;
      Colors, UniqueColors: TIntegerArray;
      i, a: Integer;
      NewColor: Boolean;
    begin
      if not LoggedIn then Exit;
      ColorToleranceSpeed(0);
      FindColorsSpiralTolerance(MMCX, MMCY, Points, 6985, MMX1, MMY1, MMX2, MMY2, 5);
      if Length(Points) < 1 then
      begin
        ColorToleranceSpeed(1)
        Exit;
      end;
      Colors := GetColors(Points);

      for i := 0 to Length(Colors) -1 do
      begin
        NewColor := True;
        for a := 0 to GetArrayLength(UniqueColors) - 1 do
        begin
          if(UniqueColors[a] = Colors[i])then
          begin
            NewColor := False;
            Break;
          end;
        end;
        if(NewColor)then
        begin
          SetArrayLength(UniqueColors, GetArrayLength(UniqueColors) + 1);
          UniqueColors[GetArrayLength(UniqueColors) - 1] := Colors[i];
        end;
      end;
      for i := 0 to Length(UniqueColors) -1 do
      if UniqueColors[i] <> 0 then
      begin
        ColorToXYZ(UniqueColors[i], X, Y, Z);
        if (X < 5) and (X > 1) then
          if (Y < 4) and (Y > 0) then
            if (Z < 2) and (Z > -2) then
              if CountColor(UniqueColors[i], MMX1, MMY1, MMX2, MMY2) > 50 then
              begin
                WriteLn('AutoColor: '+IntTostr(UniqueColors[i]))
                Result := UniqueColors[i];
                Break;
              end;
      end;
      ColorToleranceSpeed(1);
    end;

    procedure TalkToDuke;
    var
      TPA: TPointArray;
      Found: Boolean;
      i, cx, cy, LadderColor: Integer;

    begin
      cx := MMCX;
      cy := MMCY;
      LadderColor := AutoColorIt;
      SymbolAccuracy := 0.6;
      if(FindSymbol(x, y, 'Quest'))then
        begin
          Mouse(x, y, 6, 6, true);
          FFlag(5);
          if(FindColorSpiral(cx, cy - 25, LadderColor, MMX1, MMY1, MMX2, MMY2))then
          begin
            Mouse(x + 3, y + 3, 2, 2, true);
            FFlag(0);
            if(FindColorTolerance(x, y, 803167, MSX1, MSY1, MSX2, MSY2, 10))or
            (FindColorTolerance(x, y, 603212, MSX1, MSY1, MSX2, MSY2, 10))then
            begin
              Mouse(x, y, 5, 5, false);
              ChooseOption('-up');
            end;
        if(FindSymbol(x, y, 'Quest'))then
        begin
          Mouse(x, y, 6, 6, true);
          //CheckDoor;
          SymbolAccuracy := 0.8;
        end;
        FindColorsTolerance(TPA, 4983817, MSX1, MSY1, MSX2, MSY2, 10);
        for i := 0 to High(TPA)do
        begin
          MMouse(TPA[i].x, TPA[i].y, 3, 3);
          if(IsUpText('alk'))then
          begin
            Found := True;
            GetMousePos(TPA[i].x, TPA[i].y);
            Break;
          end;
          if(Found)then Mouse(Tpa[i].x, TPA[i].y, 0, 0, true);
        ClickAnswer('continue', 1);
        ClickAnswer('quests', 1);
        ClickAnswer('continue', 4);
        ClickAnswer('probl', 1);
        ClickAnswer('continue', 3);
      end;
    end;

    begin
      SetupSRL;
      TalkToDuke;
    end.

    PS. Zephyr if you see this and dont want me to use your procedure i'll take it out

    i know its something really stupid, but its with the AutoColor procedure, cause i took it out and it would've worked

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

    Default

    SCAR Code:
    if(FindColorSpiral(cx, cy - 25, LadderColor, MMX1, MMY1, MMX2, MMY2))then
    It has to be variable

    do

    SCAR Code:
    DecEx(Cy, 25)
    after
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

  3. #3
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    SCAR Code:
    function ClickAnswer(Answer: string; Times: Integer): Boolean;
    var
      j, i: Integer;
    begin
      if (not(LoggedIn)) then Exit;
      //if (TimeExceeded) then Exit;
      j := 0;
      i := 0;
      repeat
        if (FindNPCChatText('what ever npc chat text is')) then
        begin
          FTWait(4);
          Inc(i);
        end;
        j := j + 1;
      until(j = Times);
      if (j = i) then Result := True;
    end;

    that should work

    and u should credit the procedure to zephyr if u didnt make it



Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Variable Expected
    By Laur€ns in forum OSR Help
    Replies: 9
    Last Post: 07-24-2008, 01:05 PM
  2. Variable Expected
    By NinjaTerrorist in forum OSR Help
    Replies: 20
    Last Post: 02-24-2007, 11: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
  •