Results 1 to 3 of 3

Thread: Internal error?

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

    Default Internal error?

    So again i have a problem and im asking for help. I get an error message thats says

    Code:
    [Error] (45:48): Internal error (20) at line 44
    Compiling failed.
    And the function is

    Simba Code:
    Function FindFight(MonsterName:string):Boolean;

    Var
      AllNPCs,RightNPC :TNPCArray;
      TheMonster :MonsterData;
      I,a :Integer;
      PointI:TPoint;

    Begin

      AllNPCs    := R_GetAllNPCs(False);
      TheMonster := WhatMonsterData(MonsterName);

      For I := High(AllNPCs) Downto 0 Do
        If (AllNPCs[I].ID = TheMonster.ID) Then
          RightNPC[(High(RightNPC)+1)] = AllNPCs[I];

      For I := High(RightNPC) Downto 0 Do
        R_SortNPCs(RightNPC);

      For I := 0 To High(RightNPC) Do
        If RightNPC[I].InCombat Then
          If R_TileOnMM(RightNPC[I]) Then
          Begin
            PointI := R_TileToMM(RightNPC[I]);
            MMouse(PointI.x,PointI.y,4,4);
            If WaitUptext(TheMonster.Name,2000) Then
            Begin
              GetMousePos(x,y);
              If Random(20) = 5 Then
              Begin
                Mouse(x,y,0,0,False);
                If WaitOption('Attack',2000) Then
                Begin
                  Result := True
                  Exit;
                End;
              End Else Begin
                Mouse(x,y,0,0,True);
                Result := true;
                Exit;
              End;
            End;
          End;
    End;

    Thanks for any help, i hope to finish atleast one script by the end of summer im getting really annoyed at not even finishing my first script.

    Thanks
    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

    Post line 43 and 44. Not of the function, of the whole script.

    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
    Feb 2007
    Location
    Florida
    Posts
    460
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You had a begin/end in the wrong place.

    Simba Code:
    Function FindFight(MonsterName:string):Boolean;

    Var
      AllNPCs,RightNPC :TNPCArray;
      TheMonster :MonsterData;
      I,a :Integer;
      PointI:TPoint;

    Begin

      AllNPCs    := R_GetAllNPCs(False);
      TheMonster := WhatMonsterData(MonsterName);

      For I := High(AllNPCs) Downto 0 Do
        If (AllNPCs[I].ID = TheMonster.ID) Then
          RightNPC[(High(RightNPC)+1)] = AllNPCs[I];

      For I := High(RightNPC) Downto 0 Do
        R_SortNPCs(RightNPC);

      For I := 0 To High(RightNPC) Do
        If RightNPC[I].InCombat Then
          If R_TileOnMM(RightNPC[I]) Then
          Begin
            PointI := R_TileToMM(RightNPC[I]);
            MMouse(PointI.x,PointI.y,4,4);
            If WaitUptext(TheMonster.Name,2000) Then
            Begin
              GetMousePos(x,y);
              If Random(20) = 5 Then
              Begin
                Mouse(x,y,0,0,False);
                If WaitOption('Attack',2000) Then
                Begin
                  Result := True
                  Exit;
                End;
              End Else //no need for a begin here.
                Mouse(x,y,0,0,True);
                Result := true;
                Exit;
            End;
          End;
    End;
    Varrock gTanner
    Previously known as England155.

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
  •