Results 1 to 7 of 7

Thread: Help me please.

  1. #1
    Join Date
    Feb 2012
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    10 Post(s)

    Default Help me please.

    Here is my script. (The first I've ever written) I have been working on this script all day, and I'm done with it. I need someone to fix it, and help me out here. I've been driven crazy working on this, and the lack of help I was given has forced me to give up learning this language altogether.

    This line:
    If P07_FindObjCustom(X, Y, ['ickpocket'], [8564929, 1526883, 6066595] , 100) then
    seems to be terribly glitchy for me. The script will start up when I replace that line with the old code I used, but the old code won't detect the color of the farmer and begin to pickpocket him. The line above will spam click the form box that is opened after you click start, and then crashes simba, and continues to spam click. I had to restart my entire computer to fix this. The old line I used that didn't crash, but also never worked was:
    If FindColorSpiralTolerance(x, y, 8169656, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 7) then
    Simba Code:
    program AIOThiever; //Written by Im fkn rare
    {$I SRL/SRL.Simba}
    {$I SRL/SRL/Misc/Debug.Simba}
    {$I P07Include.Simba}

    var
      x, y, ManColor, FarmerColor, XPPH, noTimes, pickPH: Integer; PBox: TBox; DsgnForm: TForm; StartTime: Integer; NpcCombo: TComboBox;
      TLabel0,TLabel1,TLabel3,TLabel4: TLabel; TButton10: TButton; Username, Password: TEdit;
    const
      default = 'Times new roman';
      FONT = 9;
      Version = '1.0';

    procedure DTM;
    begin
    ManColor := 5982280;
    FarmerColor := 8169656;
    end;
    procedure WaitHumanClick;
    begin
      case random(600) of
        1..450: Wait(RandomRange(0, 100));
        451..570: Wait(RandomRange(0, 200));
        571..590: Wait(RandomRange(0, 600));
        591..600: Wait(RandomRange(400, 1100));
      end;
    end;

    Function isMoving1: Boolean;
      var
        PBox: TBox;
      begin
        PBox := IntToBox(237, 162, 282, 205);
        Result := (AveragePixelShift(PBox, 250, 500) > 90);
        Writeln(IntToStr(AveragePixelShift(PBox, 250, 500)));
      end;
    procedure Progress;
    begin
      pickPH := Round((noTimes * 3600) / (GetTimeRunning / 1000));
      XPPH := Round(((noTimes * 8) * 3600) / (GetTimeRunning / 1000));
      ClearDebug;
      Writeln('Pickpocketed: ' + IntToStr(noTimes) + ' (' + IntToStr(pickPH) + ' per hour)');
      Writeln('Experience earned: ' + IntToStr(noTimes * 8)+ ' (' + IntToStr(XPPH) + ' per hour)');
      Writeln('Total time running: ' + TimeRunning);
    end;
    procedure Thieve;
    var x, y: integer;
    begin
      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
        If P07_FindObj(x, y, 'Man', ManColor, 5) then
        begin
        WaitHumanClick

              if Random(2) = 1 then
              begin
                If FindColorSpiralTolerance(x, y, 5982280, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 7) then
                begin
                  MMouse(x, y, 1, 0);
                  ClickMouse2(mouse_Right);
                  wait(randomRange(200, 300));
                  P07_ChooseOptionMulti(['ickpocket']);
                repeat
                  wait(randomRange(200, 300));
                until AveragePixelShift(PBox, 250, 350) < 100;
                  noTimes := noTimes +  1;
                end;
                end;
              end
        else
        begin
          P07_MakeCompassDegree(30);
        end;
        P07_FFlag;
    end;
    procedure Thieve1;
    var x, y: integer;
    begin
      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
        If P07_FindObj(x, y, 'Farmer', FarmerColor, 5) then
        begin
        WaitHumanClick

              if Random(2) = 1 then
              begin
                If FindColorSpiralTolerance(x, y, 8169656, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 7) then
                writeln('Color has been Found.');
                begin
                  MMouse(x, y, 1, 0);
                  ClickMouse2(mouse_Right);
                  wait(randomRange(200, 300));
                  P07_ChooseOptionMulti(['ickpocket']);
                repeat
                  wait(randomRange(200, 300));
                until AveragePixelShift(PBox, 250, 350) < 100;
                  noTimes := noTimes +  1;
                end;
                end;
              end
        else
        begin
          P07_MakeCompassDegree(30);
        end;
        P07_FFlag;
    end;

    procedure ThieveNPC;
    var x, y: integer;
    begin
      case NpcCombo.ITEMINDEX of
        0:
          Begin
           //If P07_FindObjCustom(X, Y, ['ickpocket'], [8564929, 1526883, 6066595] , 100) then
           //writeln('Color found');
            Thieve;
          End;
        1:
          Begin
            If P07_FindObjCustom(X, Y, ['ickpocket'], [8564929, 1526883, 6066595] , 100) then
           writeln('Color found');
            Thieve1;
          End;
    End;
    End;
    procedure SaveFormInfo(Sender: TObject);
    begin
      DsgnForm.ModalResult := mrOk;
      StartTime := GetSystemTime;
      P07_PlayerName := Username.TEXT
      P07_PlayerPass := Password.TEXT                                                          // Saving the text, before we close the form
      DsgnForm.CLOSE;
      ThieveNPC;
    end;


      procedure InitForm;
    begin
     DsgnForm:=TForm.Create(nil);
      with DsgnForm do
        begin
          Caption:='AIO Thiever by: Im Fkn Rare';
          Left:=346;
          Top:=419;
          Width:=350;
          Height:=140;
          Font.Name:=default;
          Font.Color:=clDefault;
          Font.Size:=9;
      end;
     TLabel0:=TLabel.Create(DsgnForm);
      with TLabel0 do
        begin
          Parent:=DsgnForm;
          Caption:='AIO Thiever v1.0';
          Left:=50;
          Top:=10;
          Width:=41;
          Height:=14;
          Font.Name:=default;
          Font.Color:=clDefault;
          Font.Size:=13;
      end;
     TLabel1:=TLabel.Create(DsgnForm);
      with TLabel1 do
        begin
          Parent:=DsgnForm;
          Caption:='NPC';
          Left:=40;
          Top:=40;
          Width:=41;
          Height:=14;
          Font.Name:=default;
          Font.Color:=clDefault;
          Font.Size:=9;
      end;
      TLabel3:=TLabel.Create(DsgnForm);
      with TLabel3 do
        begin
          Parent:=DsgnForm;
          Caption:='Username';
          Left:=206;
          Top:=51;
          Width:=49;
          Height:=14;
          Font.Name:=default;
          Font.Color:=clDefault;
          Font.Size:=9;
      end;
     TLabel4:=TLabel.Create(DsgnForm);
      with TLabel4 do
        begin
          Parent:=DsgnForm;
          Caption:='Password';
          Left:=206;
          Top:=80;
          Width:=47;
          Height:=14;
          Font.Name:=default;
          Font.Color:=clDefault;
          Font.Size:=9;
      end;
     Username:=TEdit.Create(DsgnForm);
      with Username do
        begin
          Parent:=DsgnForm;
          Text:='Username';
          Left:=257;
          Top:=48;
          Width:=80;
          Height:=21;
          Font.Name:=default;
          Font.Color:=clDefault;
          Font.Size:=9;
          Username.MaxLength:=25;
      end;
     Password:=TEdit.Create(DsgnForm);
      with Password do
        begin
          Parent:=DsgnForm;
          Text:='Password';
          Left:=257;
          Top:=80;
          Width:=80;
          Height:=21;
          Font.Name:=default;
          Font.Color:=clDefault;
          Font.Size:=9;
          Password.MaxLength:=25;
          Password.PasswordChar:=#;
      end;
     TButton10:=TButton.Create(DsgnForm);
      with TButton10 do
        begin
          Parent:=DsgnForm;
          Caption:='Start';
          Left:=50;
          Top:=110;
          Width:=75;
          Height:=25;
          OnClick:=@SaveFormInfo;
      end;
     NpcCombo:=TComboBox.Create(DsgnForm);
      with NpcCombo do
        begin
          Parent:=DsgnForm;
          Left:=100;
          Top:=40;
          Width:=80;
          Height:=21;
          Items.Add('Man');
          Items.Add('Farmer');
          Text := Items[0];
          Font.Name:=default;
          Font.Color:=clDefault;
          Font.Size:=9;
      end;
    end;


    procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('InitForm', v);
    end;


    procedure ShowFormModal;
    begin
      DsgnForm.ShowModal;
    end;


    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      SetArrayLength(V, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;

    begin
      SafeInitForm;
      SafeShowFormModal;
      SetupP07Include;
      ActivateClient;
      DTM;
      ThieveNPC;
      Progress;
      Wait(100);

      If (Not P07_LoggedIn) Then
      begin
        P07_LogInPlayer;
      end;

      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
      DTM;

      repeat


    until (Not P07_LoggedIn)
      TerminateScript;
    end.

  2. #2
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    Probably just bad colors try using auto color aid to find the best colors
    Current Project: Retired

  3. #3
    Join Date
    Feb 2012
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    10 Post(s)

    Default

    Quote Originally Posted by Gucci View Post
    Probably just bad colors try using auto color aid to find the best colors
    Auto color aid? And it's not the colors mate, I've used just a snippet of that code and it worked fine pickpocketing the farmer, it's not starting up the finding of the color.

  4. #4
    Join Date
    Feb 2012
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    10 Post(s)

    Default

    Once again, no legitimate help given.

  5. #5
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Maybe your mainloop, seems dodgy. try this

    Simba Code:
    begin
      SafeInitForm;
      SafeShowFormModal;
      SetupP07Include;
      Wait(3000) // added wait to give it some time.
      ActivateClient;
      DTM;

      If (Not P07_LoggedIn) Then
      begin
        P07_LogInPlayer;
      end;

      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;

    repeat
        ThieveNPC;
        ClearDebug;
        Progress;
    until (Not P07_LoggedIn)
      TerminateScript;
    end.

    Don't forget to drag your crosshair to the RS client everytime you start the script. Just in case.

    Creds to DannyRS for this wonderful sig!

  6. #6
    Join Date
    Feb 2012
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    10 Post(s)

    Default

    Your edit caused this:
    Attached Images Attached Images

  7. #7
    Join Date
    Feb 2012
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    10 Post(s)

    Default

    Bump.

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
  •