Results 1 to 13 of 13

Thread: Acess violation - Error

  1. #1
    Join Date
    Apr 2007
    Location
    Rimmington
    Posts
    169
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Exclamation Acess violation - Error

    Hey,

    i have used the search button for this but still with no luck in fixing so heres my post to try n find out what my problem is.

    ive been just playing really getting used to the code and what not and came across the error in the pic



    cant seam to find what causing this or a fix anyone know one?
    its problem my coding as i am only learning atm

    any help is much appreciated.

    [Code that i error with]

    Simba Code:
    program New;
    {$DEFINE SMART}
    {$i srl/srl.simba}
    {$i sps/sps.simba}
    Var
      MyPath:TPointArray;

    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;                                                                    
      FindNormalRandoms;
      case Random(8) of
       0:
       begin
         HoverSkill('Woodcutting', false);
         wait(2453+Random(432));
       end;
       1: PickUpMouse;
       2:
       begin
         MakeCompass('N');
         wait(100+random(133));
         MakeCompass('S');
         wait(50+random(133));
         MakeCompass('N');
         FindNormalRandoms;
       end;
      end;
    end;

    procedure walkto;
    begin
    SPS_Areas := ['0_0','1_0'];
    MyPath := [Point(243, 58), Point(243, 58), Point(258, 86), Point(258, 86),
     Point(307, 99), Point(307, 99), Point(357, 111), Point(357, 111),
     Point(367, 93), Point(367, 93), Point(399, 82), Point(399, 82)];
    end;
    procedure ChopTree;
    var x, y: integer;
    begin
        repeat
        FindNormalRandoms;
        if FindObj(x, y, 'hop', 4150111, 35) then
        begin
          Mouse(x, y, 0, 0, false);
          ChooseOption('Tree');
        end;
          repeat
          wait(400+random(250));
          AntiBan;
          Until not IsUpText('ew') or (InvFull);
      until(InvFull);
    end;

    begin

      Cleardebug;
      Smart_Server := 11;
      Smart_Members := false;
      Smart_Signed := false;
      Smart_SuperDetail := false;

      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
      SPS_Areas := ['10_9']
      SPS_Setup(RUNESCAPE_SURFACE, SPS_Areas);
      MouseSpeed := RandomRange(17, 22);

      SetUpSRL;
      ActivateClient;
      DeclarePlayers;
      LoginPlayer;
      SPS_WalkPath(MyPath);
      ChopTree;
    end.

    Tubs
    Attached Images Attached Images
    Last edited by NoUserName; 04-16-2012 at 08:19 PM.

  2. #2
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,279
    Mentioned
    2 Post(s)
    Quoted
    44 Post(s)

    Default

    Ok first, could you please tell us which include/script the script opened when you got this error? Because there is no line 96 in your script, meaning it must have opened up a different one.

    Also, is paster.sex and security.sex enabled/disabled? Have tried disabling/enabling them?

  3. #3
    Join Date
    Dec 2011
    Location
    Brampton, Ontario
    Posts
    6,024
    Mentioned
    53 Post(s)
    Quoted
    608 Post(s)

    Default

    Paster and Security don't give compiling errors..
    Here's your problem -
    Simba Code:
    procedure walkto;begin
    SPS_Areas := ['0_0','1_0'];
    MyPath := [Point(243, 58), Point(243, 58), Point(258, 86), Point(258, 86), Point(307, 99), Point(307, 99), Point(357, 111), Point(357, 111), Point(367, 93), Point(367, 93), Point(399, 82), Point(399, 82)];
    end;

    You're not declaring ``SPS_Areas" as a variable, and then you're calling it in your MAIN LOOP.

    Simba Code:
    SPS_Setup(RUNESCAPE_SURFACE, SPS_Areas);

    See what I mean?
    Solution -

    Declare ``SPS_Areas" as a TStringArray as a Global Variable and then it'll work.

  4. #4
    Join Date
    Apr 2007
    Location
    Rimmington
    Posts
    169
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Thumbs up

    cheers for the fix still having problems though have had a look at some other scripts and this is what i have now

    Simba Code:
    program New;
    {$DEFINE SMART}
    {$i srl/srl.simba}
    {$i sps/sps.simba}

    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;
      FindNormalRandoms;
      case Random(8) of
       0:
       begin
         HoverSkill('Woodcutting', false);
         wait(2453+Random(432));
       end;
       1: PickUpMouse;
       2:
       begin
         MakeCompass('N');
         wait(100+random(133));
         MakeCompass('S');
         wait(50+random(133));
         MakeCompass('N');
         FindNormalRandoms;
       end;
      end;
    end;

    procedure WalkTo;
    var
      MyPath:TPointArray;
    begin
      SPS_Areas := ['10_9'];
      MyPath := [Point(243, 58), Point(243, 58), Point(258, 86), Point(258, 86),
     Point(307, 99), Point(307, 99), Point(357, 111), Point(357, 111),
     Point(367, 93), Point(367, 93), Point(399, 82), Point(399, 82)];
      SPS_WalkPath(MyPath);

    end;


    procedure ChopTree;
    var x, y: integer;
    begin
        repeat
        FindNormalRandoms;
        if FindObj(x, y, 'hop', 4150111, 35) then
        begin
          Mouse(x, y, 0, 0, false);
          ChooseOption('Tree');
        end;
          repeat
          wait(400+random(250));
          AntiBan;
          Until not IsUpText('ew') or (InvFull);
      until(InvFull);
    end;

    begin

      Cleardebug;
      Smart_Server := 11;
      Smart_Members := false;
      Smart_Signed := false;
      Smart_SuperDetail := false;

      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
      MouseSpeed := RandomRange(17, 22);

      ActivateClient;
      DeclarePlayers;
      LoginPlayer;
      WalkTo;
      ChopTree;
    end.

    It gives out the error and opens sps file

    Simba Code:
    Error: Exception: Access violation at line 305
    The following DTMs were not freed: [SRL - Lamp bitmap, 1]
    The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap, 3]

    could some one give me a fix? really want to try and lean something i did follow the sps tut but im a idiot and still don't get it!

    Thanks for replys
    Last edited by NoUserName; 04-16-2012 at 07:57 AM.

  5. #5
    Join Date
    Dec 2011
    Location
    Brampton, Ontario
    Posts
    6,024
    Mentioned
    53 Post(s)
    Quoted
    608 Post(s)

    Default

    Line 305 Is?
    I'm not gonna open up Simba for that xD

  6. #6
    Join Date
    Apr 2007
    Location
    Rimmington
    Posts
    169
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    sorry forgot to add that 305 to 324 there.

    Simba Code:
    FoundMatches := SPS_FindMapInMap(P.x, P.y, SPS_AreaMaps, SmallMap, SPS_Tolerance);
      Searches := ((Minimap.Width / SPS_Accuracy) * (Minimap.Height / SPS_Accuracy));
    {
      writeln('fx: '+toStr(p.x)+' ~ on area: '+toStr(P.X * SPS_Accuracy + (Minimap.Width / 2)));
      writeln('fy: '+toStr(p.y)+' ~ on area: '+toStr(P.Y * SPS_Accuracy + (Minimap.Width / 2)));
      writeln('matches: '+toStr(foundMatches));
      writeln('searches: '+toStr(searches));
      writeln('percent: '+toStr(FoundMatches / Searches));
    }

      if ((FoundMatches / Searches) > SPS_MatchesPercent) then
        Result := SPS_LocalToGlobal(SPS_GetTopLeftCoords(SPS_Areas), // the top left of the total area
                                    P.x * SPS_Accuracy + (Minimap.Width / 2),
                                    P.y * SPS_Accuracy + (Minimap.Width / 2));

      Minimap.Free;

      t := (GetSystemTime - t);
      if (SPS_Debug) then
        Writeln('SPS_GetMyPos: Finished in '+ToStr(t)+' ms. Result = '+ToStr(Result));
    end;

  7. #7
    Join Date
    Mar 2012
    Location
    MW3
    Posts
    76
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    sorry to interrupt this conversation but I need help with my script



    Code:
    end; <---  line 54
    [Error] (55:1): Identifier expected at line 54
    Compiling failed.


    What did I do wrong?

  8. #8
    Join Date
    Dec 2011
    Location
    Brampton, Ontario
    Posts
    6,024
    Mentioned
    53 Post(s)
    Quoted
    608 Post(s)

    Default

    Update SPS =]

  9. #9
    Join Date
    Mar 2012
    Location
    MW3
    Posts
    76
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Assuming you were replying to me sin, I have the latest SPS <3

  10. #10
    Join Date
    Apr 2007
    Location
    Rimmington
    Posts
    169
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    anyone wiling to help?

  11. #11
    Join Date
    Aug 2007
    Location
    England
    Posts
    1,032
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by tubs-12 View Post
    anyone wiling to help?
    Here have a look at what I've done. I've tried to show you how you should setup SPS. It's much easier to put new paths in.

    Simba Code:
    program New;
    {$DEFINE SMART}
    {$i srl/srl.simba}
    {$i sps/sps.simba}


    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name :='';
      Players[0].Pass :='';
      Players[0].Nick :='';
      Players[0].Active:=True;
    end;

    // Your path is a TPointArray.
    // The function is asking which path(Array) do you want to use.
    // Example of using it: SPS_Path(WhichPath('ToBank'));
    function WhichPath(Which:String): TPointArray;
    begin
      if (not LoggedIn) then
        Exit;

      FindNormalRandoms;
      case Lowercase(Which) of
        'ToTrees' : Result := [Point(243, 58), Point(243, 58), Point(258, 86), Point(258, 86),
                                       Point(307, 99), Point(307, 99), Point(357, 111), Point(357, 111),
                                       Point(367, 93), Point(367, 93), Point(399, 82), Point(399, 82)];
        'ToBank'  : Result := [Point(3000, 3000), Point(3000, 3000), Point(3000, 3000), Point(3000, 3000), Point(3000, 3000)];
      end;
    end;

    procedure AntiBan;
    begin
      if(not(LoggedIn))then
      Exit;
      FindNormalRandoms;
      case Random(8) of
       0:
       begin
         HoverSkill('Woodcutting', false);
         wait(2453+Random(432));
       end;
       1: PickUpMouse;
       2:
       begin
         MakeCompass('N');
         wait(100+random(133));
         MakeCompass('S');
         wait(50+random(133));
         MakeCompass('N');
         FindNormalRandoms;
       end;
      end;
    end;

    // Similar to before but its a procedure which does not return anything.
    // This is what you will call in your main loop to say where you want to walk to.
    // Example: WalkTo('Bank');
    procedure WalkTo(Where:String);
    begin
      if (not LoggedIn) then
        Exit;

      case Lowercase(Where) of
        'trees' :
          begin
            SPS_WalkPath(WhichPath('ToTrees'));
          end;
        'bank' :
          begin
            SPS_WalkPath(WhichPath('ToBank'));
          end;
      end;
    end;

    procedure ChopTree;
    var x, y: integer;
    begin
      repeat
        FindNormalRandoms;
        if FindObj(x, y, 'hop', 4150111, 35) then
        begin
          Mouse(x, y, 0, 0, false);
          ChooseOption('Tree');
        end;
        repeat
          wait(400+random(250));
          AntiBan;
        until not IsUpText('ew') or (InvFull);
      until(InvFull);
    end;

    procedure TheMainLoop;
    begin
      if (not LoggedIn) then
        Exit;

      begin
        WalkTo('Trees');
        ChopTree;
      end;
    end;


    begin

      Cleardebug;
      Smart_Server := 11;
      Smart_Members := false;
      Smart_Signed := false;
      Smart_SuperDetail := false;

      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
     // SPS_Areas := ['10_9','0_0','1_0']   You don't need this
      SPS_Setup(RUNESCAPE_SURFACE, ['10_9','0_0','1_0']); // Put it here instead
      MouseSpeed := RandomRange(17, 22);

      ActivateClient;
      DeclarePlayers;
      LoginPlayer;
      MakeCompass('N');
      SetAngle(0);
      TheMainLoop;
      TerminateScript;
    end.

    You need to set the script out right and have things set into functions and procedures properly plus look up about standards.
    A function returns something like 'boolean' which is true or false, you can also set what the function is outputting like is it sending and integer, string or TPoint Array in your case.
    A procedure is all about do this do that and asking/using functions to find the result.
    If you want to find something or click it then you want to KNOW if you have found or clicked it right ? So you make a function to see weather it return true or false.
    In the procedure you want to be commanding the functions then saying what should happen if you find it/click it.
    If I was you I would put finding and clicking the tree into functions and calling them in a procedure.
    You also put SetUpSRL twice when it only has to be called once at the beging with all the other setups.
    One more thing, your path co-ords don't look right to me. Make sure you either use the SPS get my position or 'path creator 0.9'.
    This is just how I do it, there are prob easier ways but I thought I would try and help you out.

    P.S never leave your username or passwords in scripts. You never know who might see
    Last edited by Jakkle; 04-16-2012 at 08:30 PM.
    Today is the first day of the rest of your life

  12. #12
    Join Date
    Jul 2009
    Location
    Australia
    Posts
    668
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by Bobby Boo View Post
    sorry to interrupt this conversation but I need help with my script



    Code:
    end; <---  line 54
    [Error] (55:1): Identifier expected at line 54
    Compiling failed.


    What did I do wrong?
    Please do not hijack people's threads and start with your own issues if they have no relation with the OP's problem.
    We would need to see more of the code in order to solve your problem (unless that is the last end in the script, in which case it needs a . not a ; )

    ~Caotom

    ~Caotom

  13. #13
    Join Date
    Apr 2007
    Location
    Rimmington
    Posts
    169
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    thanks for your reply
    im using 'path creator 0.9' and was trying to learn from the nice little easy to get Tutorial SPS Walking Guide (The Basics) By Aligndude followed it a few time but still i dont walk can see what im doing wrong...

    ive had a look but im not on my main comp so i set simba up here and i get

    Simba Code:
    A new update of Simba is available!
    Current version is 980. Latest version is 984
    [Hint] C:\Simba\Includes\SRL/SRL/core/mapwalk.simba(1353:3): Variable 'BOX' never used at line 1352
    [Error] C:\Simba\Includes\sps/sps.simba(125:3): Unknown identifier 'sortTPAByX' at line 124
    Compiling failed.

    not sure if its my set-up though.

    Quote Originally Posted by Jakkle View Post
    P.S never leave your username or passwords in scripts. You never know who might see
    yea probley shouldn't i forgot it was on the image too.
    removed it now thanks

    tubs.
    Last edited by NoUserName; 04-16-2012 at 08:19 PM.

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
  •