Results 1 to 3 of 3

Thread: Script freezes while finding a stove

  1. #1
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Script freezes while finding a stove

    yes, the script freezes while finding a stove. why? here is the script:
    SCAR Code:
    //Start at al-kharid bank, food in first bank slot and start logged in.
    // the scripts runs with shrimps,anchovies,trots,salmons,lobbies and swordies.

    program MrCooker;
    {.include srl/srl.scar}
    {.include srl/srl/skill/Cooking.scar}
    var
      i,x,y,Tries,HowManyLoads,Banked,Cooked,Raw : integer;
      Food: Array[0..6] of Integer;
      Started,BankOpened,Cokked,GoBanking,TooTheStove : Boolean;
    const
      LoadsToDo = 10;
    Procedure DeclarePlayers;
    begin
    HowManyPlayers := 4;
    numberOfPlayers(howManyPlayers);
    CurrentPlayer := 0;

      Players[0].Name := 'breaker rs';  // Username
      Players[0].Pass := '741852963'; // Password
      Players[0].Nick := 'ker';   // 3-4 letters of your Username
      Players[0].Active := True;   // are u going to use this player ?

      Players[1].Name := '';
      Players[1].Pass := '';
      Players[1].Nick := '';
      Players[1].Active := False;

      Players[2].Name := '';
      Players[2].Pass := '';
      Players[2].Nick := '';
      Players[2].Active := False;

      Players[3].Name := '';
      Players[3].Pass := '';
      Players[3].Nick := '';
      Players[3].Active := False;
     
      NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
       
      end;

    procedure DTMS;
    begin
       Food[0] := DTMFromString('78DA632C656260B8C0C8800CCCF4D5C1344C9' +
           '4B103A8E631AA1A0F3B635435ED40351751D5E4E575A3AA01D9F5' +
           '00558DB8B81C8A1A00A2F5086A');

       Food[1] := DTMFromString('78DA632C65626038C7C8800A18914820DD055' +
           '4F300558D879D31A69A8BA86AD64FEF4255538169CEF4E60A1435' +
           '0088520991');
           
       Food[2] := DTMFromString('78DA632C676260B8CCC8800C3C1D4CC0344C9' +
           '4B115A8E63EAA1A375B235435CD40355750D5349497A1AAA902AA' +
           'B98BAAE6C2A993286A00D9CA0AB3');

       Food[3] := DTMFromString('78DA63AC606260B8C2C8800CDC6C8DC0344C9' +
           '4B10DA8E601AA1A0F3B635435AD40355751D52C488D4255530D54' +
           '731755CDAEFE76143500CF2F0A16');

       Food[4] := DTMFromString('78DA632C616260B8C0C8800C3C1D4CC0344C9' +
           '4B11BA8E631AA1A0F3B6354355D40359751D5484A48A0AAA900AA' +
           '7988AAE6E6E5CB286A00A54909BB');

       Food[5] := DTMFromString('78DA632C62626038C7C8800C3CEC8CC1344C9' +
           '4B11BA8E609AA1A4F071354359D40351750D5C064E16ACA806A1E' +
           'A0AA71B335425103007855079F');
           
       Food[6] := DTMFromString('78DA632C66626038C3C8800C3CEC8CC1344C9' +
           '4B107A8E61101355D40351751D5783A98A0AA2907AAB987AA66D7' +
           '9CFDA86ADA806A2EA3AA9994311B450D0052640CA9');

       Raw := DTMFromString('78DA636461606060624001378F2E06D38C503' +
           'EA32C90E0455573E5E01C543512408299801A0E2CE61C5E84A206' +
           '0087AA0945');
    end;

    procedure FindRandoms;
    begin
       if(not(LoggedIn))then
       Exit;
       FindNormalRandoms;
       if (FindFight) then
    begin
       Writeln(' Found Fight ')
       SetRun(true);
       RunTo('N',True);

    end;
    end;

    procedure AntiBannage;
    begin
       if(not(LoggedIn))then
       Exit;
     case Random(40) of

       0: SleepAndMoveMouse(1232+random(857));

       1:begin
          GetSkillInfo('Fishing', false);
          wait(2000+random(1000));
          GameTab(4);
         end;
         
       2:begin
          GetSkillInfo('Cooking', false);
          wait(2000+random(1000));
          GameTab(4);
         end;
         
       3:begin
           DoEmote(1+random(17));
           wait(2546+random(165))
           GameTab(1 +random(5))
           Gametab(4)
         end;
           
       4: MMouse(random(250), random(250), 10, 10);
       
       5: BoredHuman;
       
       6: PickUpMouse;
       
       7:begin
            GameTab(1 + Random(12));
            wait(1000+random(1000));
            GameTab(4);
        end;
    end;
    end;


    procedure Starting;
    begin
       Started := False;
       if(not(LoggedIn))then
       Exit;
       GameTab(1)
       wait(3000+random(421))
       GameTab(4)
       wait(1000+random(526))
       MakeCompass('E');
       Writeln('good')
       Started := True;
    end;

    Procedure OpenTheBank;
    begin
       if (Started) then
    begin
       if (not(LoggedIn)) then
       Exit;

       BankOpened := False;
       SetAngle(false);
       Writeln('Starting the script');
       MakeCompass('W');
       if OpenBankQuiet('akb') then
       Writeln('Opening the bank')
       wait(1000+random(548))
       if (BankScreen = False) then
    begin
       Writeln(' Could not find the Bank Screen...')
       Logout;
       NextPlayer(false)
       BankOpened := False;
       Exit;
    end;
       FixBank;
       Withdraw(1,1,28)
       Writeln('Yeah i found the food');
       wait(1205+random(632))
       CloseBank;
       BankOpened := True;

    end;
    end;

    procedure ToTheStove;
    var
     e,f: Integer;
    begin
       if(not(LoggedIn))then
       Exit;
       if (BankOpened = False) then
       Exit;
       if (BankOpened) then
    begin
       TooTheStove := False;
       SymbolAccuracy := 0.8;
       if (FindSymbol(x,y,'cook'))then
    begin
       Writeln('Found Symbol');

       if(not(FindSymbol(x,y,'cook'))) then
    begin
       Writeln('Couldnt find the sumbol...')
       Writeln(' Trying to find the kebab symbol')
       SymbolAccuracy := 0.8;
       if (FindSymbol(e,f,'Kebab shop'))then
    begin
       Writeln('Yeah kebab symbol found!')
       Mouse(e,f,3,3,True)
       
    end;
    end;

       Mouse(x,y,2,2,True);
       Wait(1500+random(11))
       Flag;
       FindRandoms;
       TooTheStove := True;
    end;
    end;
    end;

    Procedure AndCook;
     var
      a,b,c,d : Integer;
    begin
       if (not(LoggedIn)) then
       Exit;
       if (TooTheStove = False) then
       Exit;
       if (TooTheStove) then
    begin
       Cokked := False
       SetAngle(True);
       FindRange(x,y, MIX1,MIY1,MIX2,MIY2 );
      for i:= 0 to 7 do
    begin
       if (FindDTM(Food[i],a,b,MIX1,MIY1,MIX2,MIY2))then
    begin
       Writeln('Found food');

       if (not(FindDTM(Food[i],a,b,MIX1,MIY1,MIX2,MIY2))) then
    begin
       Writeln('Couldnt find the DTMs...')
       Logout;
       NextPlayer(false)
       Exit;
    end;

       Mouse(a,b,3,3,true);
       AntiBannage;
       FindRandoms;
       wait(2050+random(487))
       Mouse(x,y,3,3,true);
       if (FindDTM(Raw,c,d,MIX1,MIY1,MIX2,MIY2))then
    begin
       Writeln('Clicking To Cook')
       Mouse(c,d,2,2,false);
       ChooseOption('All');
       Cooked := Cooked+28
       if (Cooked = 28) then
       Cokked := True
       Exit;
    end;
    end;
    end;
    end;
    end;

    procedure ToTheBank;
    begin
       if (not(LoggedIn)) then
       Exit;
       if (Cokked = False) then
       Exit;
       if (Cokked) then
    begin
       GoBanking := False;
       SymbolAccuracy := 0.8;
       if (FindSymbol(x,y,'bank'))then
    begin
       Writeln('Found Symbol');
       AntiBannage;

       if(not(FindSymbol(x,y,'bank'))) then
    begin
       Writeln('Where is the bank? i cant find it ')
       Logout;
       NextPlayer(false);
       Exit;
    end;

       Mouse(x,y,3,3,True);
       Wait(1500+random(11))
       Flag;
       FindRandoms;
       SetAngle(false);
       MakeCompass('W');
       wait (999+random(999))
       OpenBankQuiet('akb');
       wait(1000+random(548))
       FixBank;
       DepositAll;
       Writeln('Depositing Food')
       wait(4000+random(632))
       Withdraw(1,1,28)
       Writeln('Yeah i found the food');
       wait(1205+random(632))
       CloseBank;
      Banked := Banked +1
       GoBanking := True;
    end;
    end;
    end;

    Procedure Proggy;
    begin
       if(not(LoggedIn))then
       Exit;
       ClearDebug;
       Writeln('___________________________________________');
       Writeln('-------------------------------------------');
       Writeln('  Maybe Cooked '+IntToStr(Cooked)           );
       Writeln('  Worked for: ' + TimeRunning               );
       Writeln('  Banked: ' + IntToStr(Banked)+ ' times    ');
       Writeln('__________Remember_To_Post_This_Proggy_____');
       Writeln('-------------------------------------------');
       Writeln('|||||||||||||||||||||||||||||||||||||||||||');
       Writeln('|||||||||||||||||||||||||||||||||||||||||||');

    end;

    begin
       SetupSRL;
       ActivateClient;
       ClearDebug;
       Writeln('Script made by: cazax')
       DeclarePlayers;
       if(not(LoggedIn))then
       LoginPlayer;
     repeat
       if(not(LoggedIn))then NextPlayer(True);
       Starting;
       OpenTheBank;
       FindRandoms;
       AntiBannage;
       ToTheStove;
       AndCook;
       ToTheBank;
       SRLRandomsReport;
       Proggy;
      until (HowManyLoads >= LoadsToDo )
    end.

    the script start fine, then, while finding the stove, the script freezes... the problem is in the procedure AndCook cuz the stove finding is there.


  2. #2
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    maybe its the FindRange function...

    test it by itself and see if thats it, and if it is just write your own stove finder with findobjcustom or something
    METAL HEAD FOR LIFE!!!

  3. #3
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by gerauchert View Post
    maybe its the FindRange function...

    test it by itself and see if thats it, and if it is just write your own stove finder with findobjcustom or something
    ok. thx again gerauchert


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 01-25-2008, 08:46 AM
  2. Script freezes when nextplayer is called
    By Killerdou in forum OSR Help
    Replies: 0
    Last Post: 09-04-2007, 08:37 AM
  3. Script Freezes while using forms
    By Yakman in forum OSR Help
    Replies: 1
    Last Post: 10-07-2006, 08:40 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
  •