Results 1 to 16 of 16

Thread: how to fix this error?

  1. #1
    Join Date
    May 2008
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default how to fix this error?

    Line 20: [Error] (19817:1): Identifier expected in script
    Here is thw whole script, i need some help with the error.
    Code:
    program New;
     {.include SRL/SRL.scar}
    function ClickMeat: Boolean;
    var
      meatBMP, x, y, i : Integer;
    begin
     meatBMP := BitmapFromString(9, 7, 'beNqrqZkiyUtFtHr+fFxSC6d' +
           'O2bZmNRChia9bvGhGTw9WqaUzpk9sbYVIIctuXLZs3sSJ7QCneECD' +
           '');
    GameTab(tab_Inv)
    For i := 0 to 15 Do
     if(FindBitmapToleranceIn(meatBMP, x, y,MIX1, MIY1, MIX2, MIY2, i))then
     begin
      MMouse(x,y,4,4);
      if(IsUpText('aw meat'))then
       GetMousePos(x, y);
       Mouse(x,y,0,0,false);
       Result:= True
       break;
      Else //this is the line with the error
       writeln('could not find the correct uptext')
     Else
     writeln('Could not find the meat bitmap')
     end;
    end;
    begin
    SetupSRL;
    ActivateCLient;
    if ClickMeat then
      Writeln('we have clicked the raw meat')
    else
      Writeln('we have not clicked the raw meat')
    end.

  2. #2
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Don't put a ";" after the then part of the if statement if you got an else after that.

    EDIT: I see you know that.
    So the problem there is that you don't got an if then else statement there if you understand this.
    That else is just hanging there.
    Use begin/end; after the second if too then use "end else".
    Will post it in a sec.

    I hope this works:
    SCAR Code:
    program New;
     {.include SRL/SRL.scar}
    function ClickMeat: Boolean;
    var
      meatBMP, x, y, i : Integer;
    begin
      meatBMP := BitmapFromString(9, 7, 'beNqrqZkiyUtFtHr+fFxSC6d' +
           'O2bZmNRChia9bvGhGTw9WqaUzpk9sbYVIIctuXLZs3sSJ7QCneECD' +
           '');
      GameTab(tab_Inv)
      For i := 0 to 15 Do
        if(FindBitmapToleranceIn(meatBMP, x, y,MIX1, MIY1, MIX2, MIY2, i))then
        begin
          MMouse(x,y,4,4);
          if(IsUpText('aw meat'))then
          begin
            GetMousePos(x, y);
            Mouse(x,y,0,0,false);
            Result:= True
            break;
          end else //this is the line with the error
            writeln('could not find the correct uptext')
        end else
          writeln('Could not find the meat bitmap')
    end;

    begin
      SetupSRL;
      ActivateCLient;
      if ClickMeat then
        Writeln('we have clicked the raw meat')
      else
        Writeln('we have not clicked the raw meat')
    end.
    Last edited by Sabzi; 08-28-2009 at 12:15 AM.

  3. #3
    Join Date
    May 2008
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    there isnt one, is there? if im missing it can you show me what you mean

  4. #4
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It's there. Also your standards are not the best and I haven't corrected them.
    This may worth a look.

  5. #5
    Join Date
    May 2008
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i changed the both of the else's to end else and now im getting,

    Line 22: [Error] (19819:5): Semicolon (';') expected in script

    also, how come your code comes in color while mine does not

  6. #6
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Did you try what I posted? It works for me. Or at least doesn't give me any error.
    I use [ scar][ /scar] tags. Without the spaces.

  7. #7
    Join Date
    May 2008
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    how would i go about copy pasting code, i want to see if i missed something while changing mine to match yours, but when i copy paste, it comes out as 1 big line in scar

    EDIT: ive got the script to work, thanks there is one problem im trying to figure out, ill post it if i cant do it.
    Last edited by U.S.mann; 08-28-2009 at 12:57 AM.

  8. #8
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by U.S.mann View Post
    how would i go about copy pasting code, i want to see if i missed something while changing mine to match yours, but when i copy paste, it comes out as 1 big line in scar

    EDIT: ive got the script to work, thanks there is one problem im trying to figure out, ill post it if i cant do it.
    I don't know what is the problem with copy/pasting(I mean the 1 line part), I never got that. And I am glad that you got it working.
    Oh, and if you EC reading this then just don't say anything to me :P(I am not a pro)

  9. #9
    Join Date
    May 2008
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nevermind, i got it. thanks for making the script work!
    + repped

    Last edited by U.S.mann; 08-28-2009 at 01:50 AM.

  10. #10
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by U.S.mann View Post
    'ec' ?
    EvilChicken!
    He is a developer and I had a talk with him about explaining things.
    So I told him to explain not just fix the things. Then I just fix the things here and don't explain .
    But if you need any explanation just tell me and I will see what can I do!
    Last edited by Sabzi; 08-28-2009 at 02:19 AM. Reason: me -> I, thx U.S.mann

  11. #11
    Join Date
    May 2008
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sabzi View Post
    Then me just fix the things here and don't explain .
    Then I just fix the things here and don't explain .

    Quote Originally Posted by Sabzi View Post
    If you see any grammar/type mistake in my post please don't hesitate to correct me.
    Last edited by U.S.mann; 08-28-2009 at 01:46 AM.

  12. #12
    Join Date
    May 2008
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    for some reason it cant find the bitmap, thats odd, i even made a new bitmap and searched for it without logging off rs

  13. #13
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by U.S.mann View Post
    for some reason it cant find the bitmap, thats odd, i even made a new bitmap and searched for it without logging off rs
    First, don't make double posts. Edit your posts instead!
    Second, what are you trying to make a bitmap for?
    Third, please note that when you are making a bitmap it should be the most unique and the smallest you can make. And black = nothing in scar's eyes. So what is not your item or whatever you are searching for (example the background of the inventory) should be edited to be black.
    Forth, (offtopic) Thanks the previous spelling mistake fix.
    And finally search in the tutorial island there are a lot of great tutorial on bitmaps.

  14. #14
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by U.S.mann View Post
    how would i go about copy pasting code, i want to see if i missed something while changing mine to match yours, but when i copy paste, it comes out as 1 big line in scar

    EDIT: ive got the script to work, thanks there is one problem im trying to figure out, ill post it if i cant do it.
    GTFO internet explorer, and get on firefox, + Botting in firefox, in my experience tends to be the best.

    IE does that when u copy/paste scripts sometimes. Mozilla doesn't, and its faster.

  15. #15
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Smarter Child View Post
    GTFO internet explorer, and get on firefox, + Botting in firefox, in my experience tends to be the best.

    IE does that when u copy/paste scripts sometimes. Mozilla doesn't, and its faster.
    Google Chrome is faster than FireFox. And if you're stupid and still use Internet Explorer, click the quote button on the post with the script and copy + paste that. I think that fixed it for someone else with this problem. But get Google Chrome + auto on FireFox.

  16. #16
    Join Date
    May 2008
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks everyone, i opened up firefox and it worked perfectly. the script works now too. [but that has nothing to do with firefox]

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
  •