Results 1 to 12 of 12

Thread: Getting an error when using TPA's

  1. #1
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default Getting an error when using TPA's

    I am currently working on a powerminer for a RSPS, when it starts up it attempts to detect smoke(random event smoke that comes from rocks) and if it does not find any it moves on to click the iron rock, So far I got:

    Simba Code:
    program Powermine;
    {$i srl/srl.simba}
    Procedure AntiSmoke;
    Begin
    SetColorToleranceSpeed(2);
    SetToleranceSpeed2Modifiers(0.18,0.45);
    Wait(5000);
    end;
    Procedure FindRock;
    var
      tmpCTS, l, r,X,Y:Integer;
      IronTPA:TPointArray;
      SmokeTPA:TPointArray;
    begin
      SmokeTPA := GetToleranceSpeed;
      SetColorToleranceSpeed(2);
      SetToleranceSpeed2Modifiers(0.17, 0.17);
      If FindColorsTolerance(SmokeTPA, 7110803, 11, 27, 522, 360, 4) then
        begin
        AntiSmoke;
    end;
    begin
      tmpCTS := GetToleranceSpeed;
      SetColorToleranceSpeed(2);
      SetToleranceSpeed2Modifiers(0.18,0.45);
      if FindColorsTolerance(IronTPA, 2569557, 11, 27, 522, 360, 3) then
        begin
        SetColorToleranceSpeed(tmpCTS);
        SetToleranceSpeed2Modifiers(0.02, 0.02);
        L := High(IronTPA)
        wait(randomrange(60, 200));
        mmouse(IronTPA[r].x, IronTPA[r].y, 2, 2);
        clickmouse2(mouse_left);
        end;
    end;

    begin
     SetupSRL
     FindRock;
    end

    But I get this error:
    Code:
    [Error] C:\Simba\Scripts\KMiner.simba(16:32): Type mismatch at line 15
    Compiling failed.
    I don't understand what's wrong.

  2. #2
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Delete that line, i don't even...

    -Boom

  3. #3
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Delete what line..?

  4. #4
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    The error says there's something wrong with line 15.

    Simba Code:
    SmokeTPA := GetToleranceSpeed;

    You are trying to assign an integer to a TPA?? Just delete the line

  5. #5
    Join Date
    Dec 2012
    Posts
    191
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SmokeTPA := GetToleranceSpeed;
    This is wrong. You assign the GetToleranceSpeed to your temporary CTS variable( in your case, tmpCTS)

    EDIT: LOL p1ng you were faster

  6. #6
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Code:
    [Error] C:\Simba\Scripts\KMiner.simba(41:4): Identifier expected at line 40
    Compiling failed.
    lol wtf got this error last line, i never get errors on the last line must be something dumb

  7. #7
    Join Date
    Dec 2012
    Posts
    191
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SetupSRL
    doesn't have a semicolon after it...

    end
    And you don't have a .(dot) on the last end.

  8. #8
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Those are the first to things I tried to fix, and btw i fixed the end. before you mentioned it:


  9. #9
    Join Date
    Dec 2012
    Posts
    191
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Inside the FindRock procedure, you have 4 begins and only 2 ends. Close those begins up!

    EDIT: Was looking to your code snippet but even so, just by your picture, is something along those lines, see if every begin or case has an end.

  10. #10
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Slashed View Post
    Inside the FindRock procedure, you have 4 begins and only 2 ends. Close those begins up!

    EDIT: Was looking to your code snippet but even so, just by your picture, is something along those lines, see if every begin or case has an end.
    ahh got it, usualy when i forget a end; it goes to the line before it not the end thanks anywayz

  11. #11
    Join Date
    Dec 2012
    Posts
    191
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by rjj95 View Post
    ahh got it, usualy when i forget a end; it goes to the line before it not the end thanks anywayz
    Your welcome.

    As a tip to avoid similar errors in the future, everytime you do a begin, type the end as well. That way you don't forget.

  12. #12
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Slashed View Post
    Your welcome.

    As a tip to avoid similar errors in the future, everytime you do a begin, type the end as well. That way you don't forget.
    I usually do that but this is my first TPA script so I was a little confused

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
  •