Results 1 to 3 of 3

Thread: Breaking..

  1. #1
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Breaking..

    Of course! The system I had in place decides to do some random things. It was working perfectly, and would only break after waiting a certain amount of time. However, all of a sudden, it decides to bug up on me and just goes to sleep once it logs in! I have no clue what's going on, and have tried many things once again. I can't seem to find the issue!
    Simba Code:
    program DPP;
    {$DEFINE SMART}
    {$i srl\srl.scar}
    {$i reflection\reflection.simba}
    {$i srl/srl/misc/PaintSmart.scar}

    const
      WORLD = 32;
      MEMBERS = false;
      SIGNED = true;

    var
      Break: Integer;
      MyStatus: String;
      Location: TStringArray;

    //Proggy Vars
    var
      Item, ExpGain: Integer;

    procedure DeclarePlayers;
    begin

      HowManyPlayers := 1; //How many players in the script.
      CurrentPlayer := 0; //Current player in the Players array.
      NumberOfPlayers(HowManyPlayers); //Don't change.

      with Players[0] do
      begin
        Name := ''; {Username}
        Pass := ''; {Password}
        Active := True; {Use This Player?}

        Integers[0] := 40; //How long until you sleep (in minutes)
        Strings[0] := ''; //What skill do you want it to check?
        Booleans[0] := False; //Using -?
      end;
    end;

    Procedure AntiBan;
    var
      c: Integer;
    begin
      MyStatus := 'Antiban';
      c := random(500);
      if (c = 100) or (c = 500) then
      case random(3) of
        0:
          RandomMovement;
        1:
          PickUpMouse;
        2:
          HoverSkill(Players, False);
      end;
    end;

    Procedure Randoms;
    begin
      r_FindRandoms;
      Writeln('Scanned for randoms.');
    end;

    Function DetectBank: Boolean;
    var
      Booth: TRSObject;
    begin
      if not(LoggedIn) then
        Exit;
      Booth := GetObjectByID(20325, 0, 10);
      Result := (Booth = NULL_RSOBJECT);
      if (Result) then
        Writeln('FAILED TO FIND BANK BOOTH!')
      else
      begin
        Writeln('Found bank booth!');
      end;
    end;

    Function DetectLocation: Boolean;
    begin
      if not(LoggedIn) then
        Exit;

      if (DistanceFrom(Tile(3288, 2802)) <= 5) then
        Location := ['Pyramid', 'Entering Pyramid'];
      if ((DistanceFrom(Tile(2800, 5168)) <= 5) and (DetectBank)) then
        Location := ['Bank', 'Walking to pyramid'];
      Result := (Length(Location) > 0);
    end;


    procedure ClearSmart;
    var
      drawing : TBitmap;
    begin
      drawing := TBitmap.Create;
      drawing.canvas.handle := SmartGetDebugDC;

      ClearRSCanvas(drawing.canvas);

      try
        FreeBitmap(drawing);
      except end;
    end;

    Procedure ScriptSetup;
    var
      Lvl: Integer;
    begin
      Writeln('Setting script up!');
      Lvl := R_GetSkillLevel('Thieving');
      if (Lvl > 20) then
      begin
        Writeln('Checking current location..');
        if (DetectLocation) then
          Writeln('Checked location!');
      end;
    end;

    procedure SMARTProggy;
    begin
      ClearSmart;
      SMART_DrawText(95, 460, 'FriendChars', 'Our Script', clRed);
      SMART_DrawText(400, 305, 'CharsNPC', MyStatus, clGreen);
    end;

    Procedure Proggy;
    var
      Time: Integer;
    begin
      Writeln('Our Script.');
      Writeln('We get ' + ToStr((GetTimeRunning/3600000) * ExpGain) + ' xp per hour');
    end;

    Procedure TakeBreak;
    var
      c: Integer;
    begin
      MyStatus := 'Sleeping';
      SMARTProggy;
      Writeln('Sleeping...');
      case random(2) of
        0:
          LogOut;
        1:
          ExitToLobby;
      end;
      c := RandomRange(60000, 7200000); //1 minute to 120 minutes
      Writeln('Sleeping for ' + IntToStr(c/60000) + ' minutes.');
      Wait(c);
      Writeln('Sleep over! Logging in.');
      MyStatus := 'Logging in';
      SMARTProggy;
      LogInPlayer;
    end;

    begin
      AddOnTerminate('Proggy');
      Smart_Members := MEMBERS;
      Smart_Server := WORLD;
      Smart_Signed := SIGNED;

      SetupSRL;
      SetupReflectionEx(true);
      DeclarePlayers;
      LoginPlayer;
      ScriptSetup;
      MarkTime(Break);
      ClearDebug;
      SMARTProggy;
      ExpGain := 20;//only a test
      repeat
        if TimeFromMark(Break) > (Players[CurrentPlayer].Integers[0]+random(20) * 60000) then
          TakeBreak;
      until(AllPlayersInActive);
    end.

  2. #2
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Try this:
    Simba Code:
    if TimeFromMark(Break) > ((Players[CurrentPlayer].Integers[0]+random(20)) * 60000) then
    Ce ne sont que des gueux


  3. #3
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Floor66 View Post
    Try this:
    Simba Code:
    if TimeFromMark(Break) > ((Players[CurrentPlayer].Integers[0]+random(20)) * 60000) then
    Thanks, that worked.

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
  •