Results 1 to 9 of 9

Thread: runtime error with antirandom please look and help!

  1. #1
    Join Date
    Jan 2007
    Location
    The Netherlands!
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    runtime error with antirandom please look and help!

    hello, im new to srl.. and im trying to make a script that works properly, with this i mean it's hard to detect, not very simple (although i called it simpleautocurser) and solves randoms...but the last part brings some weird errors...


    this is the script:
    SCAR Code:
    program SimpleAutocurser;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\skill\magic.scar}
    ////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////
    //////             Made by: jellehier0                //////
    //////             This is my first script            //////
    //////             so please, don't flame me          //////
    //////             if you have any comments,          //////
    //////             please PM me and can someone       //////
    //////             explain me how to insert anti-     //////
    //////             randoms, how to include the mage   //////
    //////             skill of srl into my script?       //////
    //////             Thnx alot!                         //////
    ////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////
    // How to use: fill in everything.. stand next to the zamorak mage
    //             in varrock castle with enough runes to cast 'curse'

    var
    zammonk: integer;
    i: Integer;
    x,y: Integer;
    castedspells: Integer;
    g,p: Integer;
    randomsfound: Integer;





    const
    skilll= 'prayer'; // same, but for failsave
    spelll= 'curse'; // change curse into weaken, curse of confuse or any other spell
    monstername= 'onk'; // part of the name of the monk
    ZammonkColor1= 2172254; //colour of 'monk of zamorak'
    ZammonkColor2= 3488915; //second colour of the monk
    ZammonkColor3= 4212913; //third color of the monk
    Runs= 0; // times you want to run the script ( 0 = unlimited)

    procedure declareplayers;
    begin
         HowManyPlayers :=2;
         NumberOfPlayers(HowManyPlayers);
         CurrentPlayer:=0;

         Players[0].Name :='name'; //name
         Players[0].Pass :='pass'; // password
         Players[0].Nick :='nick'; // nickname, abriviation of your name.
         Players[0].Skill:='Magic';// skill doing is magic
         players[0].loc:='varrock castle';// location
         Players[0].Active:=True;

         Players[1].Name :='name'; //name
         Players[1].Pass :='pass'; // password
         Players[1].Nick :='nick'; // nickname, abriviation of your name.
         Players[1].Skill:='Magic';// skill doing is magic
         players[0].loc:='varrock castle';// location
         Players[1].Active:=false;  // change to true if you use 2 accounts
    end;


    Function FindFastRandoms: Boolean;    // By WT-Fakawi.

    begin
      for g:=1 to 10 do
      begin
        case g of
           1:  If FindMod then
                 Result := True;
           2:  If FindDead then
                 Result := True;
           3:  If FindMime then
                 Result := True;
           4:  If FindMaze then
                 Result := True;
           5:  If FindQuiz then
                 Result := True;
           6:  If FindDemon then
                  begin
                  result := true;
                  logout;
                  end;

           7: if FindLamp(skilll) then Result := True;
           8: If FindTalk Then Result := True;
           9: If SolveChatRandom Then Result := True;
           10: ClickToContinue;
           end;
           begin
           if findfastrandoms= True then
           begin
           Randomsfound:=Randomsfound + 1;
           end;
        end;
        end;
        end;


    procedure runaway;
    begin
    if (FindFight= true) then
    begin
    MakeCompass ('n')
    RunAwayDirection('s');
    wait(10000);
    RunBack;
    end;
    end;

    procedure antiiban;
    begin
    case (7) of


    0: begin
       GameTab(2);
       Hoverskill('magic',false);
       end;
    1: SendKeys('good way of training magic!'+chr(13));
    2: SendKeys('lool...'+chr(13));
    3: SendKeys('Booooring!!!!!'+chr(13));
    4: SendKeys (+chr(13));
    5: SendKeys (+chr(13));
    6: ;
    7: ;
    end;
    end;




    procedure Curse; //select the curse spell

    Begin
    cast(spelll);
    end;

    procedure Findmage; //find the mage of zamorak

    Begin
    if (FindObj(x,y,monstername,zammonkcolor1,10))
    or (FindObj(x,y,monstername,zammonkcolor2,10))
    or (FindObj(x,y,monstername,zammonkcolor3,10)) then
     begin
     Writeln('Found Zamorak Monk');
     MMouse( x,y,5,2);
     mouse(x,y,1,1,true);
     castedspells:= castedspells + 1;
     end else
    if (not(findcolor(x,y,ZammonkColor1,0,0,600,600)))
    or (not(findcolor(x,y,ZammonkColor2,0,0,600,600)))
    or (not(findcolor (x,y,ZammonkColor3,0,0,600,600))) then
    begin
    p:= 1;
    begin
    p:= p + 1;
     Writeln ('Did not found zamorak monk');
     Case random (3) Of
     0: Makecompass ('s')
     1: Makecompass ('n')
     2: Makecompass ('w')
     3: Makecompass ('e')
     end;
     if p = 10 then
     begin
     logout;
     writeln('logging out...')

     end;
    end;
    end;
    end;

    procedure report;
    begin
    cleardebug;
    writeln('>---------------------------<');
    writeln('jellehier0s simpleautocurser!');
    writeln('running time:' + (timerunning) + '');
    writeln('curses casted:' + inttostr(castedspells) +'');
    writeln('randoms found:' + inttostr(randomsfound) +'');
    end;


    begin //mainloop
    SetupSRL;
    SetupMagic;
    DeclarePlayers;
    if (not (loggedin)) then
    begin
    loginplayer;
    HighestAngle;
    setchat('hide',1)
    makecompass ('w')
    end;
    begin
     i:= 0;
     repeat
     i:= i + 1;
     Curse;
     ftwait(1+random(1));
     Findmage;
     Runaway;
     FindFastRandoms;
     wait(1000+random(114));
     antiiban;
     report;
     until(i = runs)
     nextplayer(false)
     logout;
     end;
    end.


    here is the part that gives errors... im not sure how to use it...
    can somebody please help with this?
    SCAR Code:
    Function FindFastRandoms: Boolean;    // By WT-Fakawi.

    begin
      for g:=1 to 10 do
      begin
        case g of
           1:  If FindMod then
                 Result := True;
           2:  If FindDead then
                 Result := True;
           3:  If FindMime then
                 Result := True;
           4:  If FindMaze then
                 Result := True;
           5:  If FindQuiz then
                 Result := True;
           6:  If FindDemon then
                  begin
                  result := true;
                  logout;
                  end;

           7: if FindLamp(skilll) then Result := True;
           8: If FindTalk Then Result := True;
           9: If SolveChatRandom Then Result := True;
           10: ClickToContinue;
           end;
           begin
           if findfastrandoms= True then
           begin
           Randomsfound:=Randomsfound + 1;
           end;
        end;
        end;
        end;

    it gives this error:
    [Runtime Error] : Exception: Access violation at address 0053BCEE in module 'scar.exe'. Write of address 0BFAE420 in line 112 in script C:\Program Files\SCAR 3.11\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar
    can anybody help me solving this.. im really stuck here..

    thnx alot!
    Derp.

  2. #2
    Join Date
    Sep 2007
    Location
    newcastle australia
    Posts
    240
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    im getting a similar problem, but mine is a problem wiht findobjdeformed :/

    im just happy at least one other person is having the same problem, proves im not insane

  3. #3
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    im getting a similar problem, but mine is a problem wiht findobjdeformed :/

    im just happy at least one other person is having the same problem, proves im not insane
    Hmm, I had a problem with FindDeformed, it was because I freed a bitmap in a place where it should not make any problems, anyways, try removing a free bitmap if you have ther..

  4. #4
    Join Date
    Sep 2007
    Location
    newcastle australia
    Posts
    240
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i dont have any free bitmaps, unless they are inbuilt into some SRL suntctions i have been using :/

  5. #5
    Join Date
    Jan 2007
    Location
    The Netherlands!
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Is it possible that because of srl 4.0 BETA that there are still minor mistakes? because if i copy functions directly i sometimes still get errors (no example at the moment) ....(with the problem i have now, I think it's due to some mistake i have made tho.....)
    Derp.

  6. #6
    Join Date
    Oct 2006
    Posts
    1,071
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    SCAR Code:
    7: if FindLamp(skilll) then Result := True;

    I dunno if this is why, but I know skill doesn't have 3 l's

  7. #7
    Join Date
    Jan 2007
    Location
    The Netherlands!
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    no it refers to a constant,,

    SCAR Code:
    const
    skilll= 'prayer'; // same, but for failsave

    so you can set the skill the lampsolver needs to choose, get it?
    yeah
    Derp.

  8. #8
    Join Date
    Jan 2007
    Location
    The Netherlands!
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    I think i have solved the problem, i use another way to detect randoms now.. hope it works =\

    thnx everybody
    Derp.

  9. #9
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    if findfastrandoms= True then
           begin
           Randomsfound:=Randomsfound + 1;
           end;

    Say if result=true. maybe thats the problem(lol)

    Join the fastest growing merchanting clan on the the net!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Yet another Runtime Error!
    By Sandstorm in forum OSR Help
    Replies: 7
    Last Post: 02-15-2009, 06:40 AM
  2. [Runtime Error] : Exception: buffer error
    By GasMan in forum OSR Help
    Replies: 11
    Last Post: 05-13-2007, 02:07 PM

Posting Permissions

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