Results 1 to 5 of 5

Thread: [Runtime Error] : Exception: Access violation at address 0071FFAC in module 'scar.exe

  1. #1
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default [Runtime Error] : Exception: Access violation at address 0071FFAC in module 'scar.exe

    ok so it start up fine but when i finsihes the dropping ores procedure i get the error it never had any problems until now i didnt even change it exept for the freedtm thing.

    Code:
    {So here my first script it runs pretty well
    
    only bugs so far is thta sumtimes it clicks sumwhere else and doesnt drop allt he ore
    (ong thts not to bad)
    
    ty tickyy i looked on to your miner for proggy help and antibans and more
    ____________________setup__________________________
    1. set up declareplayers
    2. set ore type in line 38
    3. setup player by rock you want to mine
    3. save
    4. run
    5. post proggies and any bugs
    
    
    btw it posts proggies all the way though so only post them t the end and takes 5-10 minute breaks every 50 loads
    
    and enjoy   :0
    ______________________________________________________}
    
    
    program SimplePowerMiner;
    {.Include SRL\SRL\Misc\SMART.SCAR}
    {.include SRL\SRL.scar}
    
    {agenda
     0. fix DTMs
     3. anti randoms
     4. multi ores???
     5. release it}
    
    var
      u,l,j,x,y,g,i,y,z,f,switches,oredtm,gemdtm: Integer;
    
    const
      NumOfPlayers = 1;
      StartPlayer = 0;
      useagain = true;// use players again
      world = 49;// world to auto in
      
    procedure DeclarePlayers;//add more if needed
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      
      Players[0].Name       := '';
      Players[0].Pass       := '';
      Players[0].Nick       := 'jphm';
      Players[0].Active     := True;    // Use this account??
      Players[0].Integers[1]:= 100; // How many Loads??
      Players[0].Booleans[0]:= false//drop gems??
      Players[0].strings[0]:='iron';//what ore??
      Players[0].BoxRewards := ['Xp', 'ostume', 'gem', 'mote', 'ithril', 'oal'];//What do u want out of randomns
      //must be perfect EX. capitalazation and spelling
      
    {  Players[1].Name       := '';
      Players[1].Pass       := '';
      Players[1].Nick       := '';
      Players[1].Active     := True;    // Use this account??
      Players[1].Integers[1]:= 150; // How many Loads??
      Players[1].Booleans[0]:= false//drop gems??
      Players[1].strings[0]:='iron';//what ore??
      Players[1].BoxRewards := ['Xp', 'ostume', 'gem', 'mote', 'ithril', 'oal']; }
    end;
    
    procedure antibanz;
    begin
      If(not LoggedIn)then Exit;
      Case Random(9) of
        1:  PickupMouse;
        2:  SleepAndMoveMouse(500+Random(1500));
        3:  RandomMovement;
        4:  boredhuman;
        5:  hoverskill('Mining', false);
        6..8:  Exit;
        9:
        begin
          keydown(VK_Right);
          wait(100 + random (30));
          keyup(VK_Right);
        end;
      end;
    end;
    
    
    procedure loaddtms;
    begin
         OreDTM := DTMFromString('78DA637463626078C28002FC0C54181E02694' +
         '620FE0F048CEE40353718D000231209A403816AEE1350E30D54F3' +
         '86801A7BA09A4F04D49800D53C26C29CEBF8D5000045B70DB0');
         
         
         GemDTM := DTMFromString('78DA8DD2510E82300C06E06E814C144C500E0' +
         '3461F603199E869B83127C17F3324F3616BFBB026DB97656BAB46' +
         '4D6414C5715E2EB422FBDD0DA15E30EADFFC4EF71579862918F38' +
         '6A904C630E603734A9BC2670BD3A54DE9F324307DFE5FC10C304D' +
         'DA1CF67B8E02A31933E47B11CC4347D54A182B30BE3E1BE58D13B' +
         'C87998D60EE3057C6DC605A410D6BC68CF9BE7782F909E629308E' +
         '375FE5310F20');
    end;
    
      
    procedure Setup;
    begin
      disguise('TY for using jps powerminer')
      ClearDebug;
      SMARTSetupEx(world, False, True, False);
      Wait(5000);
      SetTargetDC(SmartGetDC);
      repeat
        wait(100);
      until(SmartGetColor(253, 233)<>1118604);
      SetupSRL;
      activateclient;
    end;
    
    
    procedure MineTheOre;
    var
      x, y, H, m, cts, i, maincolor, basecolor, inv, invset: integer;
      TreeUptext: string;
      MainPoints, BasePoints, TPA: TPointArray;
      ATPA: T2DPointArray;
    
    begin
      disguise('mining')
      if not LoggedIn then exit;
      case Lowercase(Players[CurrentPlayer].Strings[0]) of
        'tin':
        begin
          maincolor := 10197927;
          basecolor := 10000805;
        end;
        'copper':
        begin
          maincolor := 3430801;
          basecolor := 3495029;
        end;
        'iron':
        begin
          maincolor := 2503507;
          Basecolor := 2767197;
        end;
        'coal':
        begin
          maincolor := 2768447;
          basecolor := 2241074;
        end;
        'mithril':
        begin
          maincolor := 5913916;
          basecolor := 6505283;
        end;
        'adamentite':
        begin
          maincolor :=  4741960;
          basecolor :=  6454114;
        end;
      end;
      repeat
        if not LoggedIn then exit;
        CTS := GetColorToleranceSpeed;
        ColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(0.2, 0.2);
        FindColorsTolerance(MainPoints, maincolor, MSX1, MSY1, MSX2, MSY2, 5);
        FindColorsTolerance(BasePoints, Basecolor, MSX1, MSY1, MSX2, MSY2, 5);
        TPA := CombineTPA(MainPoints, BasePoints);
        if (Length(TPA) = 0) then Exit;
        ATPA := SplitTPAEx(TPA, 9, 9);
        SortATPAFrom(ATPA, Point(MSCX, MSCY));
        H := High(ATPA) - 1;
        for I := 0 to H do
        begin
          MiddleTPAEx(ATPA[i], x, y);
          MMouse(x, y, 3, 3);
          Wait(100 + Random(200));
          if IsUpText('Mine') then
          begin
            Marktime(m);
            Mouse(x, y, 1, 1, True);
            invset:=invcount;
            repeat
              inv:=invcount;
              wait (100);
              FindNormalRandoms;
            until ((invset < Inv) or (TimeFromMark(m) > 15000) or FindChatBoxText('availa', 8, 0));
            AntiBanz;
            FindNormalRandoms;
          end;
        end;
      until invfull
    end;
    
    
    procedure OreDropping;
    var
      OreDTM,drops:integer;
    begin
     drops:=0;
      If Not LoggedIn then exit;
      repeat
        Disguise('dropping ores');
        If FindDTM(OreDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
        Begin
          Mouse(x,y,2,2,False);
          wait(random(200));
          ChooseOption('Drop');
          wait(500 + random(100))
          FindNormalRandoms;
          Inc(drops);
        end;
      Until not FindDTM(OreDTM,x,y,MIX1,MIY1,MIX2,MIY2);
      FreeDTM(oreDTM);
    end;
    
    
    procedure GemDroping;
    var GemDrops,GemDTM:integer;
    begin
    If Not LoggedIn then exit;
      GemDrops:=0;
      repeat
        Disguise('dropping gems');
        if  findDTM(GemDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
        Begin
          Mouse(x,y,2,2,False);
          wait(random(200));
          ChooseOption('Drop');
          wait(500 + random(100))
          FindNormalRandoms;
          inc(gemdrops)
          Inc(f);
        end;
     Until not FindDTM(GemDTM,x,y,MIX1,MIY1,MIX2,MIY2) or (gemdrops = 5);//dont think your gonna get more than 1 a tie but just incase
     FreeDTM(GemDTM);
    end;
    
    procedure Proggy;
    begin
      WriteLn('             _____  ______')
      WriteLn('            |     ||      \')
      WriteLn('            |     ||      |')
      WriteLn('            |     ||   ___/')
      WriteLn('           /_____/ |__|   ')
      writeLn('____________________________________________')
      writeln('Script has been running for ' +TimeRunning);
      WriteLn('Player '+ Players[CurrentPlayer].Nick);
      WriteLn('loads done '+ IntToStr(g));
      WriteLn('ores mined ' +inttostr(g *27)) ;
      WriteLn('gems dropped ' + IntToStr(f));
      WriteLn('plsyers used ' +inttostr(switches));
      writeLn('plz post the proggie here http://www.villavu.com/forum/showthr...565#post542565');
    end;
    
    procedure break;
    begin
      disguise('breaking now')
      logout;
      wait(300000+random(300000));
    end;
    
    
    
    begin
      g:= 0;
      l:=0;
      u:=0;
      j:=0;
      f:=0;
      Setup;
      DeclarePlayers;
      GraphicsSet := true;
      LoginPlayer;
      repeat
        repeat
          loaddtms;
          FindNormalRandoms;
          GetTimeRunning;
          ClearDebug;
          Proggy;
          if g = 25 + random(25) then
          break;
          findnormalrandoms;
          MineTheore;
          findnormalrandoms;
          OreDropping;
          findnormalrandoms;
          if Players[CurrentPlayer].Booleans[0]=true then
          Gemdroping;
          FindNormalRandoms;
          Inc(g);
        until (g= (Players[CurrentPlayer].Integers[1])) or (not LoggedIn);
        NextPlayer(Useagain);
      until(AllPlayersInactive);
    end.

  2. #2
    Join Date
    Mar 2008
    Location
    In a cave
    Posts
    345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    {Just delete the FreeDTM(OreDTM); from your dropping proc and add it to the end of your mainloop

    ATM you free the DTM after the first dropping and then it doesn't have it anymore for the next droppings}

    EDIT: Never mind the stupidity I wrote above. Just don't declare OreDTM as a var in the dropping proc as you already have it as a global var
    Last edited by bugger0001; 06-07-2009 at 05:55 AM.
    A Chinese wiseman once said: "Shu ciu!", it was considered very smart, but now people know it means: "Something stinks here!"
    FalBuggySmelter v.1.31
    [Updated on the 1st of March 2010]
    RimmBugger BETA V1.8

  3. #3
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay, try loading the DTM's only when they are needed (i.e in the procedure). You repeat the loaddtms procedure in the main loop. I understand why you do that (since you free them in the procedure even though they are global).

    I will edit it a bit hold on.

    Edit: Bugger, it will have it since it performs the loaddtm procedure in the main loop.

    Hmm, you declared the same variable within the procedure so it looks like it is using the local variable and not the global one.
    SCAR Code:
    {So here my first script it runs pretty well

    only bugs so far is thta sumtimes it clicks sumwhere else and doesnt drop allt he ore
    (ong thts not to bad)

    ty tickyy i looked on to your miner for proggy help and antibans and more
    ____________________setup__________________________
    1. set up declareplayers
    2. set ore type in line 38
    3. setup player by rock you want to mine
    3. save
    4. run
    5. post proggies and any bugs


    btw it posts proggies all the way though so only post them t the end and takes 5-10 minute breaks every 50 loads

    and enjoy   :0
    ______________________________________________________}



    program SimplePowerMiner;
    {.Include SRL\SRL\Misc\SMART.SCAR}
    {.include SRL\SRL.scar}

    {agenda
     0. fix DTMs
     3. anti randoms
     4. multi ores???
     5. release it}


    var
      u,l,j,x,y,g,i,y,z,f,switches,oredtm,gemdtm: Integer;

    const
      NumOfPlayers = 1;
      StartPlayer = 0;
      useagain = true;// use players again
      world = 49;// world to auto in

    procedure DeclarePlayers;//add more if needed
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name       := '';
      Players[0].Pass       := '';
      Players[0].Nick       := 'jphm';
      Players[0].Active     := True;    // Use this account??
      Players[0].Integers[1]:= 100; // How many Loads??
      Players[0].Booleans[0]:= false//drop gems??
      Players[0].strings[0]:='iron';//what ore??
      Players[0].BoxRewards := ['Xp', 'ostume', 'gem', 'mote', 'ithril', 'oal'];//What do u want out of randomns
      //must be perfect EX. capitalazation and spelling

    {  Players[1].Name       := '';
      Players[1].Pass       := '';
      Players[1].Nick       := '';
      Players[1].Active     := True;    // Use this account??
      Players[1].Integers[1]:= 150; // How many Loads??
      Players[1].Booleans[0]:= false//drop gems??
      Players[1].strings[0]:='iron';//what ore??
      Players[1].BoxRewards := ['Xp', 'ostume', 'gem', 'mote', 'ithril', 'oal']; }

    end;

    procedure antibanz;
    begin
      If(not LoggedIn)then Exit;
      Case Random(9) of
        1:  PickupMouse;
        2:  SleepAndMoveMouse(500+Random(1500));
        3:  RandomMovement;
        4:  boredhuman;
        5:  hoverskill('Mining', false);
        6..8:  Exit;
        9:
        begin
          keydown(VK_Right);
          wait(100 + random (30));
          keyup(VK_Right);
        end;
      end;
    end;

    procedure Setup;
    begin
      disguise('TY for using jps powerminer')
      ClearDebug;
      SMARTSetupEx(world, False, True, False);
      Wait(5000);
      SetTargetDC(SmartGetDC);
      repeat
        wait(100);
      until(SmartGetColor(253, 233)<>1118604);
      SetupSRL;
      activateclient;
    end;


    procedure MineTheOre;
    var
      x, y, H, m, cts, i, maincolor, basecolor, inv, invset: integer;
      TreeUptext: string;
      MainPoints, BasePoints, TPA: TPointArray;
      ATPA: T2DPointArray;

    begin
      disguise('mining')
      if not LoggedIn then exit;
      case Lowercase(Players[CurrentPlayer].Strings[0]) of
        'tin':
        begin
          maincolor := 10197927;
          basecolor := 10000805;
        end;
        'copper':
        begin
          maincolor := 3430801;
          basecolor := 3495029;
        end;
        'iron':
        begin
          maincolor := 2503507;
          Basecolor := 2767197;
        end;
        'coal':
        begin
          maincolor := 2768447;
          basecolor := 2241074;
        end;
        'mithril':
        begin
          maincolor := 5913916;
          basecolor := 6505283;
        end;
        'adamentite':
        begin
          maincolor :=  4741960;
          basecolor :=  6454114;
        end;
      end;
      repeat
        if not LoggedIn then exit;
        CTS := GetColorToleranceSpeed;
        ColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(0.2, 0.2);
        FindColorsTolerance(MainPoints, maincolor, MSX1, MSY1, MSX2, MSY2, 5);
        FindColorsTolerance(BasePoints, Basecolor, MSX1, MSY1, MSX2, MSY2, 5);
        TPA := CombineTPA(MainPoints, BasePoints);
        if (Length(TPA) = 0) then Exit;
        ATPA := SplitTPAEx(TPA, 9, 9);
        SortATPAFrom(ATPA, Point(MSCX, MSCY));
        H := High(ATPA) - 1;
        for I := 0 to H do
        begin
          MiddleTPAEx(ATPA[i], x, y);
          MMouse(x, y, 3, 3);
          Wait(100 + Random(200));
          if IsUpText('Mine') then
          begin
            Marktime(m);
            Mouse(x, y, 1, 1, True);
            invset:=invcount;
            repeat
              inv:=invcount;
              wait (100);
              FindNormalRandoms;
            until ((invset < Inv) or (TimeFromMark(m) > 15000) or FindChatBoxText('availa', 8, 0));
            AntiBanz;
            FindNormalRandoms;
          end;
        end;
      until invfull
    end;


    procedure OreDropping;
    var
      OreDTM,drops:integer;
    begin
      If Not LoggedIn then exit;
      OreDTM := DTMFromString('78DA637463626078C28002FC0C54181E02694' +
        '620FE0F048CEE40353718D000231209A403816AEE1350E30D54F3' +
        '86801A7BA09A4F04D49800D53C26C29CEBF8D5000045B70DB0');
      repeat
        Disguise('dropping ores');
        If FindDTM(OreDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
        Begin
          Mouse(x,y,2,2,False);
          wait(random(200));
          ChooseOption('Drop');
          wait(500 + random(100))
          FindNormalRandoms;
          Inc(drops);
        end;
      Until not FindDTM(OreDTM,x,y,MIX1,MIY1,MIX2,MIY2);
      FreeDTM(oreDTM);
    end;


    procedure GemDroping;
    var
      GemDrops,GemDTM:integer;
    begin
      If Not LoggedIn then exit;
      GemDTM := DTMFromString('78DA8DD2510E82300C06E06E814C144C500E0' +
        '3461F603199E869B83127C17F3324F3616BFBB026DB97656BAB46' +
        '4D6414C5715E2EB422FBDD0DA15E30EADFFC4EF71579862918F38' +
        '6A904C630E603734A9BC2670BD3A54DE9F324307DFE5FC10C304D' +
        'DA1CF67B8E02A31933E47B11CC4347D54A182B30BE3E1BE58D13B' +
        'C87998D60EE3057C6DC605A410D6BC68CF9BE7782F909E629308E' +
        '375FE5310F20');
      repeat
        Disguise('dropping gems');
        if  findDTM(GemDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
        Begin
          Mouse(x,y,2,2,False);
          wait(random(200));
          ChooseOption('Drop');
          wait(500 + random(100))
          FindNormalRandoms;
          inc(gemdrops)
          Inc(f);
        end;
     Until not FindDTM(GemDTM,x,y,MIX1,MIY1,MIX2,MIY2) or (gemdrops = 5);//dont think your gonna get more than 1 a tie but just incase
     FreeDTM(GemDTM);
    end;

    procedure Proggy;
    begin
      WriteLn('             _____  ______')
      WriteLn('            |     ||      \')
      WriteLn('            |     ||      |')
      WriteLn('            |     ||   ___/')
      WriteLn('           /_____/ |__|   ')
      writeLn('____________________________________________')
      writeln('Script has been running for ' +TimeRunning);
      WriteLn('Player '+ Players[CurrentPlayer].Nick);
      WriteLn('loads done '+ IntToStr(g));
      WriteLn('ores mined ' +inttostr(g *27)) ;
      WriteLn('gems dropped ' + IntToStr(f));
      WriteLn('plsyers used ' +inttostr(switches));
      writeLn('plz post the proggie here [url]http://www.villavu.com/forum/showthr...565#post542565');[/url]
    end;

    procedure break;
    begin
      disguise('breaking now')
      logout;
      wait(300000+random(300000));
    end;



    begin
      Setup;
      DeclarePlayers;
      GraphicsSet := true;
      LoginPlayer;
      repeat
        repeat
          FindNormalRandoms;
          GetTimeRunning;
          ClearDebug;
          Proggy;
          if g = 25 + random(25) then
          break;
          findnormalrandoms;
          MineTheore;
          findnormalrandoms;
          OreDropping;
          findnormalrandoms;
          if Players[CurrentPlayer].Booleans[0]=true then
          Gemdroping;
          FindNormalRandoms;
          Inc(g);
        until (g= (Players[CurrentPlayer].Integers[1])) or (not LoggedIn);
        NextPlayer(Useagain);
      until(AllPlayersInactive);
    end.

    Try that.
    Last edited by Da 0wner; 06-07-2009 at 05:56 AM.

  4. #4
    Join Date
    Mar 2008
    Location
    In a cave
    Posts
    345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol, Was editing mine when you posted yours
    A Chinese wiseman once said: "Shu ciu!", it was considered very smart, but now people know it means: "Something stinks here!"
    FalBuggySmelter v.1.31
    [Updated on the 1st of March 2010]
    RimmBugger BETA V1.8

  5. #5
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well, I posted a fix (should work as I have it).

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
  •