Results 1 to 4 of 4

Thread: Procedure compiles but doesnt do anything

  1. #1
    Join Date
    Nov 2008
    Location
    Belgium
    Posts
    254
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Procedure compiles but doesnt do anything

    I guess the titel is self-explanatory;
    I think there is something wrong with If(invcount=28)
    but I just cant see what
    SCAR Code:
    procedure BuryBones;
    var i:integer;
    begin
      if not(Loggedin) then Exit;
      Gametab(4);
      MakeCompass('N');
      AntiRandom;
       begin
         case LowerCase(BoneType) of

           'normal bones':
           begin
             if (Invcount = 28) then
             begin
               if (not(FindDTM(BonesDTM, x, y, MIX1, MIY1, MIX2, MIY2))) then
                 Writeln('Could not find bones.');
             end else
             begin
             if(FindDTM(BonesDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
             for i := 1 to 28 do
             begin
               mouse(x, y, 2, 2, true);
               AntiRandom;
               wait(2000+random(300));
               TotalBones    := TotalBones + 1;
               ReportVars[0] := ReportVars[0] + 1;
             end;
             Writeln('Burying load of Normal Bones...');
             AntiRandom;
             AntiBan;
             end;
           end;

           'big bones':
           begin
            if (not(FindDTM(BigBonesDTM, x, y, MIX1, MIY1, MIX2, MIY2))) then
               Writeln('Could not find bones.');
            end else
             begin
               if  (Invcount = 28) then
               for i := 1 to 28 do
               begin
                 FindDTM(BigBonesDTM, x, y, MIX1, MIY1, MIX2, MIY2);
                 mouse(x, y, 2, 2, true);
                 wait(2000+random(50));
                 TotalBones    := TotalBones + 1;
                 ReportVars[0] := ReportVars[0] + 1;
               end;
               Writeln('Burying Load Of Big Bones...');
               AntiRandom;
               AntiBan;
               end;
             end;
           end;
           CurrentLoads:=CurrentLoads+1;
           ReportVars[1] := ReportVars[1] + 1;
      Inc(Loads);
      end;

  2. #2
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    just use InvFull
    and i think the mistake might be here:
    SCAR Code:
    (not(FindDTM(BonesDTM, x, y, MIX1, MIY1, MIX2, MIY2)))


    cus not sometimes acts strange; here's how i'd do it:

    SCAR Code:
    'normal bones':
           begin
             if InvFull then
             
               if(FindDTM(BonesDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
               begin //need it cus of later
                 for i := 1 to 28 do
                 begin
                   mouse(x, y, 2, 2, true);
                   AntiRandom;
                   wait(2000+random(300));
                   TotalBones    := TotalBones + 1;
                   ReportVars[0] := ReportVars[0] + 1;
                   Writeln('Burying load of Normal Bones...');
                   AntiRandom;
                   AntiBan;
                 end;
               end else begin
                 writeln('could not find bone dtm');
                 exit;
               end;
           end;

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  3. #3
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Quote Originally Posted by Rasta Magician View Post
    SCAR Code:
    'normal bones':
           begin
             if InvFull and (FindDTM(BonesDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
               begin //need it cus of later
                 for i := 1 to 28 do
                 begin
                   mouse(x, y, 2, 2, true);
                   AntiRandom;
                   wait(2000+random(300));
                   TotalBones    := TotalBones + 1;
                   ReportVars[0] := ReportVars[0] + 1;
                   Writeln('Burying load of Normal Bones...');
                   AntiRandom;
                   AntiBan;
                 end;
               end else begin
                 writeln('could not find bone dtm');
                 exit;
               end;
           end;

    ~RM
    Wouldn't that work?

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  4. #4
    Join Date
    Nov 2008
    Location
    Belgium
    Posts
    254
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I think that procedure is fixed .
    But when I tested it, it seemed that there was something wrong with my main loop(I added WriteLn everywhere, like someone on IRC told me xD).
    So that's why I added the whole script. Could someone take a look at it and fix it? If you can, please tell me how you did it so I can do it myself next time...


    SCAR Code:
    //Credits To:   -TorrentOfFlame (Help with Bank+Bury Procedure)
    //              -Simtoon (Signature)
    //              -SirLaughsAlot (Break Procedure)
    //              -x99__
    program BankBury;
    {.include SRL/SRL/Misc/SMART.scar}
    {.include SRL/SRL.scar}

    const
      SRLStatsID='6785';
      SRLStatsPass='bzFvCL2qxt';
      RunDirection = 'N';
      BoneType = 'bones'; //What do you want to bury?
                        //    Normal Bones     Big bones
      BankLoc = 'veb';  //List of banks:
                        //feb = Falador east bank        fwb = Falador west bank
                        //veb = Varrock east bank        vwb = Varrock west bank
                        //akb = al kharid bank           db = draynor bank
                        //eb = edgeville bank
      LoadsToDo = 5; //Amount of loads you want to bury
      SmartWorld=29;
      Signed=True;
      LoadsBeforeLogout=20;
      BreakTime=5;
      RandomBreak=5;

    var
    x, y, BonesDTM, BigBonesDTM, Loads, H, M, S, TotalBones, CurrentLoads, LoadBeforeLogout,TimeBreaking, TotalBreakTime,OldLevel, NewLevel : integer;

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


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

    {  Players[1].Name := '';
      Players[1].Pass := '';
      Players[1].Nick := '';
      Players[1].Active := True;
      Players[1].Pin := '';

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

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

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

      Players[5].Name := '';
      Players[5].Pass := 'Password';
      Players[5].Nick := '';
      Players[5].Active := True;
      Players[5].Pin := '';
    }

    end;




    procedure LoadDTM;
    begin
      BonesDTM := DTMFromString('78DA637CC4C8C0300588510023032B986460F' +
          '80F048C4F81AC69986A10249006993393809A2740D61C026AEE01' +
          '59F308A8B905642D24A0E6261176DD00B26610507311C89A4E843' +
          '953F1AB01007E5D12D1');
      BigBonesDTM := DTMFromString('78DA637461626078CA800242FDFD186C80342' +
                           '310FF0702466FA09AC70C6880118904D2BE4035AF08A8B101AA79' +
                           '41408D1511763900D53CC4AF06001FF60C38');
    end;

    procedure EndReport;
    begin
      WriteLn('[-----Impi-----]');
      WriteLn('[-----Buryied ' + IntToStr(Loads) + ' loads-----]');
      WriteLn('[-----Ran for ' + TimeRunning + '-----]');
      writeln('Old prayer level was ' +IntToStr(OldLevel));
      writeln('Current prayer level is ' +IntToStr(NewLevel));
      WriteLn('[-----Wimpi-----]');
      SRLRandomsReport;
    end;


    procedure StopScript;
    begin
     writeln('Error 1!');
     FreeDTM(BonesDTM);
     FreeDTM(BigBonesDTM);
     Newlevel:=GetSkillLevel('prayer');
     writeln('Terminating script!')
     EndReport;
     Logout;
     Players[CurrentPlayer].Active := False;
     NextPlayer(false);
    end;

    procedure AntiRandom;
    var i:integer;
    begin
      if not(LoggedIn) then Exit;
      begin
        for i:=1 to 4 do
        case i of
          1: if FindMod then
            begin
            writeln('Found Moderator.');
            StopScript;
            end;
          2: FindNormalRandoms;
          3: if FindFight then
            begin
            RunAway(RunDirection, true, 1, 5500+Random(1000));
            end;
          4: if FindDead then
             StopScript;
        end;
      end;
    end;

    procedure AntiBan;
    begin
      if not LoggedIn then Exit;
      case random(11) of
        0 : MMouse(0, 0, 700, 500);
        1 : Hoverskill('Prayer', false);
        2 : BoredHuman;
        3 : RandomMovement;
        4 : GameTab(1);
        5 : PickupMouse;
        6 : GameTab(2);
        7 : RandomMovement;
        8 : HoverSkill('random', false);
        9 : begin
            MakeCompass('N');
            Wait(10+random(5));
            MakeCompass('S');
            Wait(10+random(5));
            MakeCompass('N');
            end;
        10:RandomRClick;
      end;
    end;

    procedure WithdrawFromBank;
    var Tries : integer;
    result2 : boolean;

    begin
     if not LoggedIn then Exit;
      Wait(2000+Random(1000));
      OpenBank(BankLoc, True, True);

     if not BankScreen then
      begin
       NextPlayer(false);
       Writeln('Couldnt open bank. Terminated');
      end else
       if BankScreen then
        begin
         Wait(1000 + Random(200));
         InPin(Players[CurrentPlayer].Pin);
         Wait(400 + Random(200));
         DepositAll;
         begin
          case BoneType of
         
           'Normal Bones':
           begin
            repeat
             if(FindDTM(BonesDTM, x, y, MSX1, MSY1, MSX2, MSY2)) then
              begin
               Mouse(x, y, 1, 1, false);
               ChooseOption('ll');
               Writeln('Withdrawed Normal Bones.');
               CloseBank;
               result2 := True;
              end else
               begin
               Inc(Tries); Continue;
               Writeln('Couldnt find Normal Bones');
               end;
            until (result2) or (Tries >= 5);
           end;
           
          'Big Bones':
          begin
           repeat
            if(FindDTM(BigBonesDTM, x, y, MSX1, MSY1, MSX2, MSY2)) then
            begin
             Mouse(x, y, 1, 1, false);
             ChooseOption('ll');
             Writeln('Withdrawed Big Bones.');
             CloseBank;
             result2 := True;
            end else
             begin
             Inc(Tries); Continue;
             Writeln('Couldnt find Big Bones');
            end;
           until (result2) or (Tries >= 5);
        end;
      end;
    end;
    end;
    end;

    procedure BuryBones;
    var i:integer;
    begin
      if not(Loggedin) then Exit;
      Gametab(4);
      MakeCompass('N');
      AntiRandom;
       begin
         case LowerCase(BoneType) of

          'normal bones':
           begin
             if InvFull then

               if(FindDTM(BonesDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
               begin //need it cus of later
                 for i := 1 to 28 do
                 begin
                   mouse(x, y, 2, 2, true);
                   AntiRandom;
                   writeln('Error 2!');
                   wait(2000+random(300));
                   TotalBones    := TotalBones + 1;
                   ReportVars[0] := ReportVars[0] + 1;
                   Writeln('Burying load of Normal Bones...');
                   AntiRandom;
                   //AntiBan;
                 end;
               end else begin
                 writeln('could not find bone dtm');
                 exit;
               end;
           end;

           'big bones':
           begin
            if InvFull then
           
             if(FindDTM(BigBonesDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
             begin
              for i := 1 to 28 do
               begin
                 mouse(x, y, 2, 2, true);
                 AntiRandom;
                 wait(2000+random(50));
                 TotalBones    := TotalBones + 1;
                 ReportVars[0] := ReportVars[0] + 1;
                 AntiRandom;
                 //AntiBan;
               end;
             end else begin
               writeln('could not find bone dtm');
               end;
               end;
           end;
      end;
    end;
    Procedure TakeABreak;
    begin
      if not loggedin then exit;
      TimeBreaking:=RandomRange(BreakTime*60000+RandomBreak*60000,BreakTime*60000-RandomBreak*60000);
      Status ('Taking a break');
      Logout;
      ConvertTime(TimeBreaking,H,M,S);
      Writeln('Breaking '+IntToStr(H)+' Hours '+IntToStr(M)+' Minutes '+IntToStr(S)+' Seconds');
      Wait(TimeBreaking);
      LoginPlayer;
      TotalBreakTime:=TimeBreaking+TotalBreakTime;
      ConvertTime(TotalBreakTime,H,M,S);
      Status('Done with break');
      CurrentLoads:=0;
      LoadBeforeLogout:=RandomRange(LoadsBeforeLogout+LoadsBeforeLogout-5,LoadsBeforeLogout+LoadsBeforeLogout+5);
    end;


    procedure SetupSmart;
    begin
      SmartSetupEx(SmartWorld, False, Signed, False);
      SetTargetDC(SmartGetDC);
      WriteLn('Setting up Smart... ');
      While not(SmartActive) do Wait(100);
    end;

    procedure SetupScript;
    begin
      Cleardebug;
      LoadBeforeLogout:=RandomRange(LoadsBeforeLogout+LoadsBeforeLogout-5,LoadsBeforeLogout+LoadsBeforeLogout+5);
      writeln('__________                __   __________                        ');
      writeln('\______   \_____    ____ |  | _\______   \__ _________ ___.__.   ');
      writeln('|    |  _/\__  \  /    \|  |/ /|    |  _/  |  \_  __ <   |  |    ');
      writeln('|    |   \ / __ \|   |  \    < |    |   \  |  /|  | \/\___  |    ');
      writeln('|______  /(____  /___|  /__|_ \|______  /____/ |__|   / ____|    ');
      writeln('       \/      \/     \/     \/       \/              \/         ');
      writeln('                                          By Impiwimpi            ');
      SetupSmart;
      SetupSRL;
      ScriptID := '1153';
      SRLID:=SRLStatsID;
      SRLPassWord:=SRLStatsPass;
      Mousespeed := 13;
      Declareplayers;
      Activateclient;
      Wait(500);
      LoadDTM;
      AntiRandom;
    end;



    begin
      SetupScript;
      if (not (LoggedIn)) then
      begin
        LoginPlayer;
        SetAngle(true);
        Wait(500 + random(30))
        SetChat('on', 1);
        SetChat('friends', 2);
        SetChat('off', 3);
        AntiRandom;
      end;
      Oldlevel:=GetSkillLevel('prayer');
      repeat
       repeat
       AntiRandom;
       WithdrawFromBank;
       AntiRandom;
       BuryBones;
       writeln('Error 3!');
       AntiRandom;
       if CurrentLoads>=LoadBeforeLogout then
        begin
        Status('Taking a break');
        Writeln('Taking a break');
        TakeABreak;
        end;
       if(Loads >= LoadsToDo)then
       Players[CurrentPlayer].Active := False;
       StopScript;
       until(Loads >= LoadsToDo) or (not LoggedIn)
       NextPlayer(Players[CurrentPlayer].Active);
       writeln('Error 4!');
      until False;
    end.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 08-18-2008, 02:45 AM
  2. Function compiles, But nothing happens?
    By Macrosoft in forum OSR Help
    Replies: 19
    Last Post: 08-14-2008, 12:35 AM
  3. TPA Trouble [Compiles but does nothing]
    By Claymore in forum OSR Help
    Replies: 4
    Last Post: 07-08-2008, 06:00 PM
  4. Function Compiles and then...nothing?
    By Macrosoft in forum OSR Help
    Replies: 12
    Last Post: 06-07-2008, 10:40 PM
  5. need help, script compiles right but work?
    By shadowrec0n in forum OSR Help
    Replies: 9
    Last Post: 02-15-2008, 09:09 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
  •