Results 1 to 5 of 5

Thread: scar error

  1. #1
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default scar error

    i keep on gettin this error

    Successfully compiled
    File access error
    SRL Compiled in 15 msec
    1 Players
    Creating the NickTPA.
    [Runtime Error] : Exception: Access violation at address 0071FDA0 in module 'scar.exe'. Read of address FFFFFFFC in line 227 in script C:\Program Files\SCAR 3.14\includes\SRL/SRL/Core/Login.scar
    then this comes up on another tab in scar
    SCAR Code:
    //-----------------------------------------------------------------//
    //--               Scar Standard Resource Library                --//
    //--               ยป Login Routines                              --//
    //-----------------------------------------------------------------//
    // * procedure Logout;                                // * by Starblaster100 and Raymond
    // * procedure LoginPlayer;                           // * by WT-Fakawi / Raymond
    // * procedure RandomNextPlayer(Active: Boolean);     // * by Dankness, Ron and Raymond
    // * procedure NextPlayer(Active: Boolean);           // * by Dankness, Ron and Raymond
    // * procedure CheckUserNicks;                        // * by Sumilion and Raymond

    { var SRL_Logs, SRL_Attempts: Integer;
      Description: Variables needed for some login functions. }

    var
      SRL_Logs, SRL_Attempts: Integer;
      RandomPlayer: Boolean;

    procedure NextPlayer(Active: Boolean); forward;

    {*******************************************************************************
    procedure Logout;
    By: Starblaster100 / Raymond
    Description: Logs you out.
    *******************************************************************************}


    function Logout: Boolean;
    var
      c, i: Integer;
    begin
      Result := (not (LoggedIn));
      if Result = True then
        Exit;
      if GameTab(14) = False then
        Exit;
      Wait(200 + Random(100));
      while (LoggedIn) or (c < 10) do
      begin
        Inc(c);
        if(ClickText('here', UpChars, MIX1, MIY1, MIX2, MIY2, True))then
          for i := 0 to 10 do
          begin
            Wait(1000);
            if not(LoggedIn)then
            begin
              Result := True;
              Exit;
            end;
          end;
      end;
    end;

    {*******************************************************************************
    procedure LoginPlayer;
    By: WT-Fakawi / Raymond
    Description: Logs in the Player[CurrentPlayer]. Detects most Client Login Errors
    *******************************************************************************}


    Function LoginPlayer : boolean;
    var
      ClickHereToPlay, i,
      CHx, CHy, c,  LastPlayer,Mark : Integer;
      Options : TStringArray;
      OneActive : Boolean;
      Actions : TVariantArray;
    begin
      Result := False;
      ClickHereToPlay := BitmapFromString(33, 1, 'z78DA758E510E80300843' +
        'AF54C0E2F6E94CB8FF9134123392693FFA41FA4A23A6F0888443D' +
        '26DC000A7DCE7F458F23EE444E721444B6A0F53D58FE44F4365B7' +
        '067D37AC3D95AADF2F50962C79');
      OneActive := False;
      if LoggedIn = False then
      begin;
        if (not (Players[CurrentPlayer].Active)) then
        begin;
          WriteLn('Current player is not Active...');
          Repeat
            For I := 0 to HowManyPlayers - 1 do
              if players[I].Active = true then
                OneActive := True;
            if OneActive = True then
              Break;
            Wait(60000);
          until false
        end;
        ActivateClient;
        Wait(900 + random(60));
        FindTextTpa(clwhite,0,194, 174,564, 367,'Cancel',UpChars,ClickLeft);
        Wait(100+random(50));
        FindTextTpa(clwhite,0,194, 174,564, 367,'xis',UpChars,ClickLeft);
        Wait(100+random(50));
        if  FindTextTpa(clwhite,0,194, 174,564, 367,'Username',UpChars, Clickleft) then
        begin
          Wait(150 + Random(75));
          WriteLn(Players[CurrentPlayer].Name);
          TypeSend(Players[CurrentPlayer].Name);
          Wait(100 + Random(100));
          if  FindTextTpa(clwhite,0,194, 174,564, 367,'Password',UpChars,ClickLeft) then
          begin;
            TypeSend(Players[CurrentPlayer].Pass);
            Wait(100 + Random(100));
          end;
        end;
        FindTextTpa(clwhite,0,194, 174,564, 367,'Login',UpChars,ClickLeft);
        Wait(250 + random(100));
        Mark := GetSystemTime;
        repeat
          Wait(Random(250) + 100);
          if (GetSystemTime - Mark) >  35000 then Break;
        until not FindTextTpa(65535,0,194, 174,564, 367,'...',UpChars,Nothing);
        Mark := GetSystemTime;
        Repeat
          if FindTextTpa(65535,0,194, 174,564, 367,'...',UpChars,Nothing) or //Still waiting to log in
             FindTextTpa(65535,0,194, 174,564, 367,'trans',UpChars,Nothing) then     //Your account is beeing transfered
          begin;
            Wait(1000 + random(500));
          end else
          begin;
            if (GetSystemTime - Mark) > 180000 then
            begin
              if (GetSystemTime - Mark) > 240000 then
              begin;
                NextPlayer(false);
                Exit;
              end;
              WriteLn('three minutes have passed');
              WriteFileString(TheFile, Chr(13) + 'THREE MINUTES HAVE PASSED!!!' +
                Chr(13));
              ActivateClient;
              FindTextTpa(clwhite,0,194, 174,564, 367,'Cancel',UpChars,ClickLeft);
              Wait(100+random(50));
              FindTextTpa(clwhite,0,194, 174,564, 367,'xis',UpChars,ClickLeft);
            end;
            Options := ['nter your','already','nvalid','excee','full','offl','rror','ontact','reject','reload',
                        'updat','disabled','member','elcom','incorrect'];
            OneActive := False;
            For I := 0 to High(Options) do
              if FindTextTpa(65535,0,194, 174,564, 367,Options[I],UpChars,Nothing) then
              begin;
                OneActive := True;
                Break;
              end;
            if OneActive then
            begin;
              FreeBitmap(ClickHereToPlay);
              SetLength(Actions,2);
              Case Options[I] of
                'reload'   : begin;   //Runescape updated
                               WriteLn('ERROR. RuneScape has been updated. Script Terminated.');
                               Terminatescript;
                             end;
                'disabled' : begin;  //Your account has been disabled..
                               WriteLn('Your account has been disabled');
                               Players[CurrentPlayer].loc := 'DISABLED';
                               NextPlayer(False);
                               Exit;
                             end;
                'member'   : begin;        // You need a Members account...
                               WriteLn('You need a Members account...');
                               Players[CurrentPlayer].loc := 'Non-Member';
                               NextPlayer(False);
                               exit;
                             end;
                'already'  : begin //Account already logged in
                               Actions := ['Your account is already logged in',0];
                               LastPlayer := CurrentPlayer;
                               repeat
                                 CurrentPlayer := (CurrentPlayer + 1) mod HowManyPlayers;
                                 Wait(200);
                               until (Players[CurrentPlayer].Active) and (CurrentPlayer <> LastPlayer);
                             end;
                'nvalid'   : begin;// Invalid Username. 3 attempts. If fails, username/pass incorrect
                               Actions := ['Invalid Username \ Password',0];
                               Inc(SRL_Attempts);
                               if SRL_Attempts > 3 then
                               begin;
                                 Players[CurrentPlayer].Loc := 'Login ERROR';
                                 SRL_Attempts := 0;
                                 Nextplayer(False);
                                 Exit;
                               end;
                             end;
                'excee'    : Actions := ['Login attempts exceeded. Please wait 1 minute and try again.',60000];
                'offl'     : Actions := ['Unable to connect Login Server offline.',(20000) + Random(6000)]; // Unable to connect. Login Server offline.
                'nter your': Actions := ['Enter your username and password',0];//Login failed
                'full'     : Actions := ['World is full.',5000]; //World is full =]
                'rror'     : Actions := ['Error Connecting.',10000]; //Error, connection timed out?
                'ontact'   : Actions := ['Error loading your profile.',2000]; // Error loading your profile. Will attempt to re-login 5 more times.)
                'reject'   : Actions := ['Login server rejected session.',1000];  // Login server rejected session.
                'updat'    : Actions := ['The Server is being updated.',60000]; // The Server is being updated. Please wait 1 minute.
                'elcom'    : Actions := ['Welcome.',0];
                'incorrect': Actions := ['To many incorrect logins.',60000 * 5]; //Wrong logins baby.
              end;
              Writeln(Actions[0]);
              Wait(Actions[1] + Random(100));
              LoginPlayer;
              Exit;
            end;
          end;
          Wait(1000);
        until (FindBitmapToleranceIn(ClickHereToPlay, CHx, CHy, 250, 270, 530, 390,
          5)) or FindColor(CHx, CHy, 723587, 522, 5, 560, 39);
        Wait(1000 + Random(500));
        if (FindBitmapToleranceIn(ClickHereToPlay, CHx, CHy, 250, 270, 530, 390, 5)) then
          Mouse(CHx, CHy, 50, 20, True) // Clicks randomly on the button
        else
          Writeln('Found Compass');
        repeat
          Wait(1000);
          c := c + 1;
        until ((LoggedIn = True) or (c >= 600));
      end;
      FreeBitmap(ClickHereToPlay);
      if LoggedIn then
      begin
        PlayerStartTime := (GetSystemTime div 1000); // PlayerStartTime
        if Length(Players[CurrentPlayer].NickTPA) < 2 then
        begin;
          Writeln('Creating the NickTPA.');
          if Players[CurrentPlayer].Nick <> '' then
            Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Nick, UpChars)
          else
          begin;
            Writeln('Nickname isnt set, taking the username instead..');
            Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Name, UpChars);
          end;
        end;
        WriteFileString(TheFile, Chr(13) + 'Current player: '+ UpperCase(Players[CurrentPlayer].Name) + Chr(13)); //* Save NAME to file
      end;
    end;

    {*******************************************************************************
    procedure RandomNextPlayer(Active: Boolean);
    By: Dankness based on WT-Fawki's NextPlayer and modified by Ron and by Raymond
    Description: Picks Random Player that is Active and Logs in
    *******************************************************************************}


    procedure RandomNextPlayer(Active: Boolean);
    var
      LastPlayer: Integer;
    begin
      WriteLn('NextPlayer');
      LastPlayer := CurrentPlayer;
      Players[CurrentPlayer].Active := Active;
      Logout;
      PlayerCurTime := (GetSystemTime div 1000);
      Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked +
        ((PlayerCurTime - PlayerStartTime) / 60);
      repeat
        CurrentPlayer := Random(HowManyPlayers);
        Wait(100);
      until (Players[CurrentPlayer].Active) and (CurrentPlayer <> LastPlayer);
      SRL_Logs := SRL_Logs + 1;
      LoginPlayer;
    end;

    {*******************************************************************************
    procedure NextPlayer(Active: Boolean);
    By: Dankness and modified by Ron and by Raymond
    Description: Logs in the next player.
    Boolean: True - Current player is ok. False - Current player is false.
    *******************************************************************************}


    procedure NextPlayer(Active: Boolean);
    var
      I : integer;
      OneActive : Boolean;
    begin
      if RandomPlayer then
        RandomNextPlayer(Active)
      else
      begin
        WriteLn('NextPlayer');
        Players[CurrentPlayer].Active := Active;
        Logout;
        PlayerCurTime := (GetSystemTime div 1000);
        Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked +
          ((PlayerCurTime - PlayerStartTime) / 60);
        CurrentPlayer := (CurrentPlayer + 1) mod HowManyPlayers;
        while Players[CurrentPlayer].Active = False do
        begin
          OneActive := False;
          CurrentPlayer := (CurrentPlayer + 1) mod HowManyPlayers;
          for I := 0 to HowManyPlayers - 1 do
            if Players[I].Active then
              OneActive := True;
          if OneActive = False then
            Wait(60000); // Everybody False. Endless Loop.
        end;
        SRL_Logs := SRL_Logs + 1;
        LoginPlayer;
      end;
    end;

    {*******************************************************************************
    procedure CheckUserNicks;
    By: Sumilion / Raymond
    Description: Checks if all nicks are set correct.
    *******************************************************************************}


    procedure CheckUserNicks;
    var
      CorrectString: string;
      i: Integer;
      Wrong : Boolean;
      Str : String;
    begin
      for i := 0 to HowManyPlayers - 1 do
      begin
        Wrong := False;
        if (Players[i].Nick = '') then
        begin
          Wrong := True;
          Str := 'WARNING : Please fill in your nickname.';
        end;
        if (Players[i].Nick <> LowerCase(Players[i].Nick)) then
        begin
          Wrong := True;
          Str := 'WARNING : Please Uncapitalise your nickname.';
        end;
        if (pos(Players[i].Nick, LowerCase(Players[i].Name)) = 1) then
        begin
          Wrong := True;
          Str := 'WARNING : Dont use the first letter in your nick.';
        end;
        if (pos(' ', Players[i].Nick) > 0) then
        begin
          Wrong := True;
          Str := 'WARNING : Dont use spaces in your Nick.';
        end;
        CorrectString := Capitalize(Players[i].Name);
        if not (Pos(LowerCase(Players[i].Nick), CorrectString) > 0) then
        begin
          Wrong := true;
          Str := 'WARNING : Nick does NOT match the name.';
        end;
        if Wrong then
        begin;
          Writeln('--');
          Writeln(Str);
          if (Length(Players[i].Name) > 0) then
            Writeln('Warning occured with player : ' + Players[i].Name);
          Writeln('For more information, visit http://www.villavu.com/forum/showthread.php?t=5410');
        end;
      end;
    end;

  2. #2
    Join Date
    Jan 2008
    Location
    Alberta
    Posts
    727
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    show your actual script? did you do LoginPlayer; and DeclarePlayers; right? You got Rev # 13?

    You should have DeclarePlayers; as the first procedure. at the end this and your other stuff should be there

    SCAR Code:
    begin
    DeclarePlayers;
    SetupSRL;
    If not LoggedIn then
    LoginPlayer;
    repeat
    yourstuff;
    end.

  3. #3
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    still does it

  4. #4
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    heres the script its my first script its a ess powerminer
    SCAR Code:
    program Ess_Power_Miner;
    {.include SRL/SRL.scar}

    var
      k1, k2 : integer;

    const
      rockcolor1= '8487307';
      rockcolor2= '6842480';
      Loads = 3;
      Version = '1';

    procedure DeclarePlayers;
    begin

      HowManyPlayers:= 1;
      CurrentPlayer:= 0;
      NumberOfPlayers(HowManyPlayers);

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

    end;

    procedure Antiban;
    begin
      MouseSpeed := 9 + Random(5);
       case random(7) of
       0: begin
       SleepAndMoveMouse(500 + random(500));
      SleepAndMoveMouse(1500);
     end;
       1: begin
        MMouse(Random (500), Random (500), 10 , 10);
       MMouse(Random (500), Random (500), 10 , 10);
     end;
       2: begin
      GameTab(1 + random(13));
        FTWait(RandomRange(2,4));
      GameTab(4);
     end;
       3: begin
      RandomMovement;
       ChooseOption('Cancel');
     end;
       4: begin
      GameTab(2);
       FTWait(RandomRange(2,4));
      GameTab(4);
     end;
       5: begin
     FTWait(RandomRange(2,4));
      RandomMovement;
     GameTab(4);
     end;
       6: begin
      Pickupmouse;
       BoredHuman;
      GameTab(4);
      end;
     end;
    end;

    Procedure Randoms;
    Begin
      FindTalk; //finds talkin randoms
      FindNormalRandoms; //finds normal randoms
      SolveChatRandom; //sloves chat randoms
      FindLamp('mining'); //solves lamp and then choses a skill to update
      SolvePinball; //solves pinball random
      DwarfItem; //dropes dawalf items
      If(FindFight)Then //runs away from fight
        Begin
          MakeCompass('N');
          RunTo('E', True);
          Wait(7000 +Random(3000));
          Runto('w', true);
        End;
    End;

    procedure Reports;
    begin
      writeln('----------ess power miner--------------------------');
      writeln('----------mined about '+IntToStr(k1)+' essence-----');
      writeln('----------Droped '+IntToStr(k2)+' inventorys-------');
      writeln('----------Worked For '+TimeRunning+' --------------');
      writeln('----------version 1--------------------------------');
    SRLRandomsReport;
    end;

    Procedure MineEss;
    var
      x, y : integer;
    begin
      Disguise('mining & droping');
    repeat
      if InvFull then
    begin
      gametab(4);
       Dropall;
     Reports;
     k1 := k1+ 28
      k2 := k2+ 1
     end else
      if FindObjCustom(x, y, ['Mine', 'ess'], [rockcolor1, rockcolor2], 3) then
     begin
      mouse(x, y, 10, 10, true);
       FindNormalRandoms;
     Antiban;
    randoms;
     wait(750 + random(750));
     end;
     until(false);
     end;

    begin
    DeclarePlayers;
    SetupSRL;
    Disguise('starting script');
    Getapplication.minimize;
    ActivateClient;
    if LoggedIn then Logout;
    LoginPlayer;
    Disguise('script started');
    repeat
    disguise('itunes')
    randoms;
    MineEss;
    if k2 = Loads then
    NextPlayer(True);
    until (false);
    end.
    thats it it compiles logs me in but just stays there its gt the same error again and again
    osmm helped me make it.

  5. #5
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    It's because for some reason it's not able to open this file:
    SCAR Code:
    TheFile := RewriteFile(ScriptPath + 'ChatLog.txt', False);
    when doing SetupSRL. (Also why you get a file access error).

    Then when it tries to save something to that file (in line 227 of Login.scar) you get an access violation..


    So either you don't have the script saved.. Then it wouldn't work as there is no 'ScriptPath'.. Or you didn't allow the file in the SCAR firewall.

    Is it saved?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Error in SRL.scar
    By Dervish in forum OSR Help
    Replies: 5
    Last Post: 03-22-2008, 05:14 PM
  2. Replies: 5
    Last Post: 02-26-2008, 04:14 PM
  3. Smart error and Some kind of Math.scar error
    By FagetHax0r in forum OSR Help
    Replies: 6
    Last Post: 02-24-2008, 10:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •