Results 1 to 7 of 7

Thread: type mismatch

  1. #1
    Join Date
    Feb 2009
    Location
    Irvine, CA
    Posts
    2,873
    Mentioned
    8 Post(s)
    Quoted
    138 Post(s)

    Default type mismatch

    ok so i finished writing my script (BANDIT AFKER FTW1!!1122@) and now im getting plennnnty of type mismatch errors. NCDS was helping me but he went to bed, and i wanna release this tonight... so here it is.

    error:

    Failed when compiling
    Line 27: [Error] (19911:47): Type mismatch in script C:\Program Files\SCAR 3.20\Scripts\My Scripts\AFK.scar

    lines 21-28:

    begin //line 21
    FindNormalRandoms; //line 22
    if FindSymbolIn(x, y, 'shop', 586, 27, 623, 65) then //line 23
    mouse(x,y,4,6, true) //line 24
    else //line 25
    Logout; //line 26
    if FindObjTPA(x,y,14474464,20,2,1,1,30,'hop') then //line 27
    mouse(x,y,4,6, false); //line 28

  2. #2
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    This:
    SCAR Code:
    if FindObjTPA(x,y,14474464,20,2,1,1,30,'hop') then //line 27
    should be this:
    SCAR Code:
    if FindObjTPA(x,y,14474464,20,2,1,1,30,['hop']) then //line 27

    The uptext parameter takes a TStringArray, not just a string.

  3. #3
    Join Date
    Feb 2009
    Location
    Irvine, CA
    Posts
    2,873
    Mentioned
    8 Post(s)
    Quoted
    138 Post(s)

    Default

    thanks! i will fix that in all my findobjtpas

    ok wait so i added a wait time after it findsymbol's, and now its giving me another one...

    Failed when compiling
    Line 26: [Error] (19910:1): Identifier expected in script C:\Program Files\SCAR 3.20\Scripts\My Scripts\AFK.scar

    mouse(x,y,4,6, true);
    wait(4000)
    else
    Last edited by TomTuff; 08-06-2009 at 01:35 PM.

  4. #4
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Post a larger section of code. I think I know the problem, but I want to make sure I'm not missing something.

  5. #5
    Join Date
    Feb 2009
    Location
    Irvine, CA
    Posts
    2,873
    Mentioned
    8 Post(s)
    Quoted
    138 Post(s)

    Default

    procedure TradeGuy;
    var
    x, y, T:integer;
    begin
    FindNormalRandoms;
    if FindSymbolIn(x, y, 'shop', 586, 27, 623, 65) then
    mouse(x,y,4,6, true);
    wait(4000)
    else
    Logout;
    if FindObjTPA(x,y,14474464,20,2,1,1,30,['hop']) then
    mouse(x,y,4,6, false);
    ChooseOption('Trade')
    mouse(189,69,10,4,true);
    wait(900); //for lag
    Mouse(582,227,10,10,false);
    ChooseOption('sell 10');
    Mouse(582,227,10,10,false);
    ChooseOption('sell 5');
    Mouse(582,227,10,10,false);
    ChooseOption('sell 10');
    Mouse(582,227,10,10,false);
    ChooseOption('sell 1')
    else
    logout;
    If(FindDTM(FoodDTM, x, y, 37, 92, 471, 288)) then
    begin
    Mouse(x,y,8,8,false);
    ChooseOption('Buy 10');
    Mouse(x,y,8,8,false);
    ChooseOption('Buy 1');
    Mouse(x,y,8,8,false);
    ChooseOption('Buy 5');
    Mouse(x,y,8,8,false);
    ChooseOption('Buy 10');
    end
    else
    logout;
    if(FindObjTPA(x,y,2448971,15,2,1,1,15,'alk')) then
    mouse(x,y,1,1,true)
    mouse(320,268,4,4,true)
    else
    logout;
    Inc(t)
    end;

    that's the entire procedure. Villavu removes the spaces, my standards are correct in SCAR.

  6. #6
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Fixed it. It was as I thought. You were missing a bunch of begins and ends. Also, use scar tags next time ([scar]).
    SCAR Code:
    procedure TradeGuy;
    var
    x, y, T:integer;
    begin
      FindNormalRandoms;
      if FindSymbolIn(x, y, 'shop', 586, 27, 623, 65) then
      begin
        mouse(x,y,4,6, true);
        wait(4000);
      end else
        Logout;
      if FindObjTPA(x,y,14474464,20,2,1,1,30,['hop']) then
      begin
        mouse(x,y,4,6, false);
        ChooseOption('Trade')
        mouse(189,69,10,4,true);
        wait(900); //for lag
        Mouse(582,227,10,10,false);
        ChooseOption('sell 10');
        Mouse(582,227,10,10,false);
        ChooseOption('sell 5');
        Mouse(582,227,10,10,false);
        ChooseOption('sell 10');
        Mouse(582,227,10,10,false);
        ChooseOption('sell 1');
      end else
        Logout;
      If(FindDTM(FoodDTM, x, y, 37, 92, 471, 288)) then
      begin
        Mouse(x,y,8,8,false);
        ChooseOption('Buy 10');
        Mouse(x,y,8,8,false);
        ChooseOption('Buy 1');
        Mouse(x,y,8,8,false);
        ChooseOption('Buy 5');
        Mouse(x,y,8,8,false);
        ChooseOption('Buy 10');
      end else
        Logout;
      if(FindObjTPA(x,y,2448971,15,2,1,1,15,'alk')) then
      begin
        mouse(x,y,1,1,true);
        mouse(320,268,4,4,true);
      end else
        Logout;
      Inc(t)
    end;

  7. #7
    Join Date
    Feb 2009
    Location
    Irvine, CA
    Posts
    2,873
    Mentioned
    8 Post(s)
    Quoted
    138 Post(s)

    Default

    ohhhh of course /facepalm, and btw i didnt know there were [scar] tags, thanks!

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
  •