Results 1 to 15 of 15

Thread: Identifier Needed ...!!!????

  1. #1
    Join Date
    Mar 2011
    Location
    Somerset, UK
    Posts
    304
    Mentioned
    0 Post(s)
    Quoted
    24 Post(s)

    Default Identifier Needed ...!!!????

    starting from line 57

    Code:
    Procedure WalkToSnape;
      begin
      if SPS_WalkPath(MainPath3) then
        loc:='Snape';
        Writeln('Walked To SnapeGrass');
      end;
    ends up with

    [Error] (58:1): Identifier expected at line 57
    Compiling failed.

    i dont understand
    what identifier is missing??

  2. #2
    Join Date
    Dec 2010
    Posts
    808
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by sm0k3 View Post
    starting from line 57

    Code:
    Procedure WalkToSnape;
    begin
      if SPS_WalkPath(MainPath3) then
      begin
        loc := 'Snape';
        Writeln('Walked To SnapeGrass');
      end;
    end;
    ends up with

    [Error] (58:1): Identifier expected at line 57
    Compiling failed.

    i dont understand
    what identifier is missing??
    That work?

  3. #3
    Join Date
    Mar 2011
    Location
    Somerset, UK
    Posts
    304
    Mentioned
    0 Post(s)
    Quoted
    24 Post(s)

    Default

    huh .. i dont get wat you mean ..

    its just part of the script but thats whats giving me probs


    EDIT

    oh i see .. lol
    il try it now

    Edit 2

    No same thing
    Last edited by sm0k3; 03-27-2011 at 09:34 PM.

  4. #4
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    You need to post even more. What he posted shows a complete procedure that has nothing wrong with it .
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  5. #5
    Join Date
    Mar 2011
    Location
    Somerset, UK
    Posts
    304
    Mentioned
    0 Post(s)
    Quoted
    24 Post(s)

    Default

    Code:
    program SnapeRunner;
    //{$DEFINE SMART}  //Uncomment for SMART
    {.include SRL/SRL.scar}
    {.i SRL/SRL/core/SPS/SPS.simba}
    
    const
    
      sUser   = '';//Stats username
      sPass   = '';//Stats Password
      Debug   = True; //Print Debug Info To Simba Leave on for beta
      SMARTstats = True; // set false if you dont want Stats Shown in SMART
      Version = 'Beta'; // Scripts Version Name
    
    
    var
    
      MainPath1, MainPath2, MainPath3r, MainPath2r, MainPath3: TPointArray; // Main Path Between snapegrass and Bank TPointArray
      Movestart: TPointArray; // Path From Tele poin in Fallador
      Picked, Runs, earns, antibans: Integer;
      loc: string;
    procedure WalkToStart;
      begin
        if SPS_WalkPath(movestart) then
        Writeln('Walked To Starting Position');
      end;
    Procedure WalkToWall;
      begin
        if (loc = 'Bank') then
          begin
            if SPS_WalkPath(MainPath1) then
            loc:='Wall';
            Writeln('Walked To Wall');
          end;
        if (loc = 'Gate') then
          begin
            if SPS_WalkPath(MainPath2r) then
            loc:='Wall';
            Writeln('Walked To Wall');
          end
      end;
    Procedure WalkToGate;
      begin
        begin
        if (loc = 'Wall') then
          begin
            if SPS_WalkPath(MainPath2) then
            loc:='Gate';
            Writeln('Walked To Gate');
          end;
        if (loc = 'Snape') then
          begin
            if SPS_WalkPath(MainPath3r) then
            loc:='Gate';
            Writeln('Walked To Gate');
          end
      end;
    Procedure WalkToSnape;
    begin
      if SPS_WalkPath(MainPath3) then
        begin
          loc:= 'Snape';
          Writeln('Walked To SnapeGrass');
      end;
    end;
    Procedure WalkToBank;
      begin
        if SPS_WalkPath(MainPath1r) then
        Writeln('Walked To Bank');
        loc:='Bank';
      end;
    Procedure OverWall;
      begin
      FindObjectEx(x, y, ['Crumbling', 'all'], [9939631], 25, 50, MSX1, MSY1, MSX2, MSY2);
      Mouse(x, y, 2, 2, true);
      end;
    begin
      SetupSRL;
      SPS_Areas := ['8_3', '8_4'];
    
    Movestart:=[Point(3484, 1576),Point(3434, 1579),Point(3405, 1603)];
    
    MainPath1:=[Point(3378, 1644),Point(3371, 1678)];
    
    MainPath2:=[Point(3358, 1680),Point(3359, 1697),Point(3359, 1724),
                  Point(3360, 1733),Point(3360, 1746),Point(3359, 1768),
                  Point(3360, 1978),Point(3356, 1793),Point(3356, 1809),
                  Point(3357, 1821)];
    
    MainPath3:=[Point(3359, 1840),Point(3368, 1857),Point(3361, 1809),
                  Point(3374, 1898),Point(3393, 1916),Point(3404, 1927),
                  Point(3404, 1956),Point(3403, 1985),Point(3398, 2007),
                  Point(3367, 2031),Point(3352, 2044),Point(3322, 2044),
                  Point(3299, 2028),Point(3286, 2011),Point(3268, 1985),
                  Point(3258, 1960),Point(3255, 1939),Point(3246, 1911)];
    MainPath1r:=InvertTPA(MainPath1);
    MainPath2r:=InvertTPA(MainPath2);
    MainPath3r:=InvertTPA(MainPath3);
     WalkToStart;
     loc:= 'Bank';
     WalkToWall;
     OverWall;
     WalkToGate;
     end.
    here you go .. unfinished lol i may have messed it up a bit whil trying to sort it out . also
    the MainPath3r:=InvertTPA(MainPath3); is there because
    if SPS_WalkPath(InvertTPA(MainPath3))
    ends in a Type missmatch error or somthing

  6. #6
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Get your stats password out of there.

    I'll take a look.

    Edit: I reformatted and I don't have SRL and when I try to download it (using the extension) it fails and can't untar it...

    Um, what this error basically means is that your begin and ends are mismatched.

    Try making sure you have one end for every begin. Also make sure each end has a semicolon after it save the last end in the program.
    Last edited by Sex; 03-27-2011 at 09:47 PM.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  7. #7
    Join Date
    Mar 2011
    Location
    Somerset, UK
    Posts
    304
    Mentioned
    0 Post(s)
    Quoted
    24 Post(s)

    Default

    Ah fixed but now i get

    Code:
    MainPath1r:=InvertTPA(MainPath1);
    [Error] (95:33): Type mismatch at line 94
    Compiling failed.

    if i change to

    Code:
    if SPS_WalkPath(invertTPA(MainPath2)) then
    Begin
    it tells me thats a type mismatch
    mainpath2 is a TpointArray ..Check Above
    i thought invertTPA was how to reverse the path for SPS
    Last edited by sm0k3; 03-27-2011 at 10:23 PM.

  8. #8
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Iirc, InvertTPA is a procedure and not a function. Just do InvertTPA(MainPath1);
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  9. #9
    Join Date
    Mar 2011
    Location
    Somerset, UK
    Posts
    304
    Mentioned
    0 Post(s)
    Quoted
    24 Post(s)

    Default

    right now ive got

    Code:
    Procedure WalkToWall;
      begin
        if (loc = 'Bank') then
          begin
            if SPS_WalkPath(MainPath1) then
            loc:='Wall';
            Writeln('Walked To Wall');
          end;
        if (loc = 'Gate') then
          begin
            if invertTPA(MainPath2) then
            loc:='Wall';
            Writeln('Walked To Wall');
          end
      end;
    still saying the invertTPA line is a type mismatch

    here's they array

    Code:
    MainPath2:=[Point(3358, 1680),Point(3359, 1697),Point(3359, 1724),
                  Point(3360, 1733),Point(3360, 1746),Point(3359, 1768),
                  Point(3360, 1978),Point(3356, 1793),Point(3356, 1809),
                  Point(3357, 1821)];

  10. #10
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Since InvertTPA is not a function you cannot use it in a if statement like that...um I don't know what you're doing that for as it would return true always if it were a function.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  11. #11
    Join Date
    Mar 2011
    Location
    Somerset, UK
    Posts
    304
    Mentioned
    0 Post(s)
    Quoted
    24 Post(s)

    Default

    marpis said
    If you want to run the same path to the other end, you can reverse the path by using InvertTPA:
    InvertTPA(MyPath);

    so im trying to run the path backwards

    the way i understood it was if .
    Code:
    if SPS_WalkPath(movestart) then
        Writeln('Walked To Starting Position');
    walked the path then
    Code:
    if SPS_WalkPath(InvertTPA(movestart)) then
        Writeln('Walked Back From Starting Position');
    This would walk Back allong the same path

    EDIT: Oh i get it i have to use invertTPA before the if and then again after SPS_WalKPath to set it foward again
    Last edited by sm0k3; 03-28-2011 at 12:15 AM.

  12. #12
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    InvertTPA is a procedure not a function meaning it does NOT return a result. All it does is change the variable in it to the inverted path. So:
    Simba Code:
    InvertTPA(MoveStart);
    if SPS_WalkPath(MoveStart) then
      Writeln('blah blah blah '); //etc...
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  13. #13
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    Simba Code:
    function InvertTPAWrap(TPA: TPointArray): TPointArray;
    begin
      Result := TPA;
      InvertTPA(Result);
    end;

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

  14. #14
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Yeah you could always just make a wrapper for it and use that . I don't know why the normal one isn't a function..
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  15. #15
    Join Date
    Mar 2011
    Location
    Somerset, UK
    Posts
    304
    Mentioned
    0 Post(s)
    Quoted
    24 Post(s)

    Default

    Right got that compleatly sorted.

    ive been looking into SPS

    it may just be me but when walking the EXACT same path
    it still manages to wander of in a compleatly different direction < very rarly though

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
  •