Results 1 to 4 of 4

Thread: Type mismatch error ??

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

    Default Type mismatch error ??

    Ok so sorry for all my questions i have been asking But i cant under stand why i am getting this error. The error is

    Code:
    [Error] (84:19): Type mismatch at line 83
    Compiling failed.
    the function is

    Simba Code:
    Function FindMonster(ID:integer; TheName:String):Boolean;
    Var
      MonsterArray :TNPCArray;
      MyPoint      :TPoint;
      I,x,y        :Integer;
    Begin

      If R_FindNPCs(ID,False,MonsterArray) Then
        Begin
          MonsterArray := R_SortNPCs(MonsterArray)
          For I := 0 To High(MonsterArray) Do
            If Not MonsterArray[I].InCombat Then
              If Not R_Animating Then
                Begin
                  If R_TileOnMS(MonsterArray[I].Tile,0) Then
                    Begin
                      MyPoint := R_TileToMS(MonsterArray,0)
                      MMouse(MyPoint.x,MyPoint.y,RandomRange(-3,3),RandomRange(-3,3));
                        If WaitUptext(TheName,1200) Then
                          If Random(20) = 5 Then
                            Begin
                              GetMousePos(x,y);
                              Mouse(x,y,0,0,False);
                                If WaitOption('Attack') Then
                                  Begin
                                    Result := True
                                    TrollWait(RandomRange(100,1000));
                                    Exit;
                                  End;
                            End Else Begin
                              GetMousePos(x,y);
                              Mouse(x,y,0,0,True);
                              Result := True
                              TrollWait(RandomRange(100,1000));
                              Exit;
                            End;
                    End;
                End;
        End;
    End;

    the line is the middle one

    Simba Code:
    MyPoint := R_TileToMS(MonsterArray,0)                
    MMouse(MyPoint.x,MyPoint.y,RandomRange(-3,3),RandomRange(-3,3));
      If WaitUptext(TheName,1200) Then

    how ever if i coment out the top line i dont get that error?

    Thanks for any help and sorry for all the questions
    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

    Your real 'Type mismatch' is this line: "MyPoint := R_TileToMS(MonsterArray,0)"

    Here's the function for TileToMS:

    Simba Code:
    function R_TileToMS(TheTile: TTile; height : integer) : TPoint;
    begin
      result:= R_TileToMSEx(TheTile, 0.5, 0.5, height);
    end;

    So your input, for this function, would be (Tile, height). You have (TNPCArray, height), so there's your mismatch.

    See this line? "If R_TileOnMS(MonsterArray[I].Tile,0) Then" You had that one right, just do the same thing for line 83/84 (whichever it is) and you're problem is history.

    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
    Oct 2010
    Location
    Under a bridge
    Posts
    648
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Stupid me thanks flight
    Quote Originally Posted by DD on IRC
    wanted to troll the troll

  4. #4
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Also, your standards are very hard to read.. kinda OT. But, you only indent on new groups.

    Ex:

    Simba Code:
    if (not Here) then
    begin
      if (not There) then
      begin
        DoThat;
      end;
    end;
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

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
  •