Results 1 to 8 of 8

Thread: Compiling Error

  1. #1
    Join Date
    Jan 2012
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Compiling Error

    Before anything i want to thank Yohojo and Coh3n because i learned a lot from there tuts and especially Kyle Undefined because i copied a lot of his "your first script" tutorial because i understood almost all of it very well thanks to how well he explained everything, and i just changed parts of the script to work with what im doing.

    So the problem with my script is that when i compile it says this:
    Code:
    [Hint] C:\Simba\Includes\SRL/SRL/core/animation.simba(257:3): Variable 'X' never used at line 256
    [Hint] C:\Simba\Includes\SRL/SRL/core/animation.simba(257:3): Variable 'Y' never used at line 256
    [Error] (110:13): Invalid number of parameters at line 109
    Compiling failed.
    im not so much concerned with the X and Y thing but idk how to fix the parameters one, and im sure the problem is because i copied the part that the error is coming from and use it differently. thanks!

    Code:
    program WheatPicker;
    {$DEFINE SMART}
    {$i srl/srl.simba}
    {$IFDEF SMART}
        {$i srl/srl/misc/paintsmart.simba}
    {$ENDIF}
    
    Procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
    
      Players[0].Name :='';
      Players[0].Pass :='';
      Players[0].Nick :='';
      Players[0].Active:=True;
    end;
    
    procedure Antiban; 
    begin
      if(not(LoggedIn))then Exit;
      begin
        case Random(100) of
          10: RandomRClick;
          30: PickUpMouse;
          50: RandomMovement;
          70: BoredHuman;
          89: ExamineInv;
        end;
      end;
    end;
    
    function FindWheat(var x, y : Integer) : Boolean;
    var
      a : Integer;
      TPA : TPointArray;
      ATPA : T2DPointArray;
      MP : TPoint;
      tmpCTS : Integer;
      Box :TBox;
    begin
      if(not(LoggedIn))then Exit;
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.06, 1.07);
    
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, 11119560, MSX1, MSY1, MSX2, MSY2, 9);
      SortTPAFrom(TPA, Point(MSCX, MSCY));
      ATPA := TPAtoATPAEx(TPA, 15, 15);
    
      for a:= 0 to High(ATPA) do
      begin
        MP := MiddleTPA(ATPA[a]);
        Box := IntToBox((MP.X - 20), (MP.Y - 20), (MP.X + 20), (MP.Y + 20));
        {$IFDEF SMART}
        SMART_DrawBoxEx(True, Box, clYellow);
        {$ENDIF}
        MMouse(MP.X, MP.Y, 3, 3);
        if(WaitUptext('heat', 400 + Random(350))) then
        begin
          x := MP.X; y := MP.Y;
          Result := True;
          {$IFDEF SMART}
          SMART_ClearCanvas;
          {$ENDIF}
          Break;
        end
      end;
    
      ColorToleranceSpeed(tmpCTS);
      SetColorspeed2Modifiers(0.2, 0.2);
    end;
    
    procedure PickWheat();
    var
      x, y : Integer;
      Box : TBox;
    begin
      if(not(LoggedIn)) then Exit;
      MakeCompass('N');
      Box := IntToBox(MSCX - 10, MSCY - 25, MSCX + 15, MSCY + 15);
      repeat
        if (not(FindNormalRandoms)) then
        begin
         if(FindWheat(x, y))then
          begin
            Wait(RandomRange(100, 200));
            Mouse(x, y, 2, 2, mouse_Left);
            Wait(RandomRange(100, 300));
            while(Animating(Box, 500, 30))do
            begin
              AntiBan;
              Wait(RandomRange(100, 300));
            end;
          end else
            Exit;
        end;
      until(InvFull or (not FindWheat(x, y)));
    end;
    
    
    begin
      SetUpSRL;
      ClearDebug;
      DeclarePlayers;
      LoginPlayer;
      AntiBan;
      FindWheat;
      PickWheat;
    end.

  2. #2
    Join Date
    Dec 2011
    Posts
    353
    Mentioned
    3 Post(s)
    Quoted
    8 Post(s)

    Default

    Its because instead of FindWheat(x, y); you have just FindWheat;

  3. #3
    Join Date
    Jan 2012
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    when i change it to FindWheat(x, y); i get:
    [Error] (110:14): Unknown identifier 'x' at line 109
    Compiling failed.

  4. #4
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    X and Y need to be actual coordinates, not just X and Y.
    I think.

  5. #5
    Join Date
    Jan 2012
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    those variables change multiple times idk how or what coords to make them

  6. #6
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Remove the FindWheat in your main loop And it'll work.

  7. #7
    Join Date
    Jan 2012
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sin View Post
    Remove the FindWheat in your main loop And it'll work.
    OMFGGG THANK YOU SOO FUCKING MUCH!!!!!!!!!!!!!!!!!!!!!
    ahah i totally forgot that function was ment to be run by another one, after i fixed the script and thought about it i understood lol thank you very much!

  8. #8
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Quote Originally Posted by koolio718 View Post
    OMFGGG THANK YOU SOO FUCKING MUCH!!!!!!!!!!!!!!!!!!!!!
    ahah i totally forgot that function was ment to be run by another one, after i fixed the script and thought about it i understood lol thank you very much!
    ^.^

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
  •