Results 1 to 24 of 24

Thread: Exception in Script: Unknown procedure

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

    Default Exception in Script: Unknown procedure

    I get this error:
    Exception in Script: Unknown procedure

    When my script runs. (I wrote it myself)

    Script:
    Simba Code:
    program RareAIOThiever; //Written by Im Fkn Rare (Credits to PowerChop & WordPocket for Snippets!)

    {$i srl/srl.simba}
    {$I SRL/SRL/Misc/Debug.Simba}
    {$i P07Include.simba}

    var
      ManColor1, ManColor, FarmerColor, FarmerColor1, x, y, XPPH, noTimes, pickPH: Integer; PBox: TBox; xz: Integer; xyz, xzy : Integer; lol : String; woMan: Integer;
      DsgnForm:TForm;
      StartTime:Integer;
      NPCCombo,AxeCombo: TComboBox;
      TLabel0,TLabel1,TLabel3,TLabel4,TLabel2: TLabel;
      TButton10: TButton;
      Username,Password: TEdit;

    const
      default = 'Times new roman';
      FONT = 9;
      Version = '1.0';

      procedure DTM;
    begin
    ManColor := 5982280;
    ManColor1 := 4545382;
    FarmerColor := 8564671;
    FarmerColor1 := 6132646;
    end;


    Function AntiBan: Boolean;
    begin
      case random(300) of
      0: P07_HoverSkill('thieving', random(5000));
      end;
    End;
    //woman is: 5572950.
    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;
    Function arewePocketing: Boolean;
    var
      PBox: TBox;
    Begin
      PBox := IntToBox(240, 158, 285, 198);
      Result := (AveragePixelShift(PBox, 250, 350) > 90);
    End;
    procedure Thieve;
    var x, y: integer;
    begin
      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
      PBox := IntToBox(240, 158, 285, 198);
      If AveragePixelShift(PBox, 250, 350) < 100 then
      If FindColorSpiralTolerance(x, y, 5982280, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 7) then
      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;
    procedure Thieve1;
    var x, y: integer;
    begin
      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
      PBox := IntToBox(240, 158, 285, 198);
      If AveragePixelShift(PBox, 250, 350) < 100 then
      If FindColorSpiralTolerance(x, y, 8564671, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 7) then
      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;
    procedure ThieveNPC;
    var x, y: integer;
    begin
      case NPCCombo.ITEMINDEX of
        0:
          Begin
            Thieve;
          End;
        1:
          Begin
            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;
    end;
    procedure InitForm;
    begin
     DsgnForm:=TForm.Create(nil);
      with DsgnForm do
        begin
          Caption:='AIO Thiever from 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;
      Wait(100);

      If (Not P07_LoggedIn) Then
      begin
        P07_LogInPlayer;
      end;
    begin
      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
      DTM;
      AddOnTerminate('FreeDTMss')
      AntiBan;
      TerminateScript;
    end;
    End.
    Last edited by Im fkn rare; 03-04-2013 at 04:49 PM.

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

    Default

    Quote Originally Posted by Im fkn rare View Post
    I get this error:
    Exception in Script: Unknown procedure

    When my script runs. (I wrote it myself)
    Could u post your script please?

    Put [SIMBA][./SIMBA] tags around your script.

    So it would look like the following example
    Simba Code:
    program new;
    {$i srl/srl.simba}

    procedure simbatags;
    begin
    end;

    begin
    end.

    Easier for people to read

    Creds to DannyRS for this wonderful sig!

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

    Default

    Quote Originally Posted by Sjoekeloe View Post
    Could u post your script please?

    Put [SIMBA][./SIMBA] tags around your script.

    So it would look like the following example
    Simba Code:
    program new;
    {$i srl/srl.simba}

    procedure simbatags;
    begin
    end;

    begin
    end.

    Easier for people to read
    Added, this is probably extremely messy. It's my first script.

  4. #4
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Which line gets highlighted?

  5. #5
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

    Default

    What is the exact error it gives you? It should highlight the failing line making it easier to find your issue.

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

    Default

    Quote Originally Posted by BMWxi View Post
    Which line gets highlighted?
    Error while playing script.
    I don't know how forms work

    Creds to DannyRS for this wonderful sig!

  7. #7
    Join Date
    Feb 2012
    Location
    Discord
    Posts
    3,114
    Mentioned
    37 Post(s)
    Quoted
    538 Post(s)

    Default

    AddOnTerminate('FreeDTMss');
    there isn't a procedure called FreeDTMss :P
    O and btw, you don't have any dtms, so you don't need to free any :P

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

    Default

    Quote Originally Posted by The Killer View Post
    AddOnTerminate('FreeDTMss');
    there isn't a procedure called FreeDTMss :P
    O and btw, you don't have any dtms, so you don't need to free any :P
    LOL I missed something so obvious.

    Creds to DannyRS for this wonderful sig!

  9. #9
    Join Date
    Feb 2012
    Location
    Discord
    Posts
    3,114
    Mentioned
    37 Post(s)
    Quoted
    538 Post(s)

    Default

    Quote Originally Posted by Sjoekeloe View Post
    LOL I missed something so obvious.
    Some times I wonder if its OP or you that wants to know more

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

    Default

    Quote Originally Posted by The Killer View Post
    Some times I wonder if its OP or you that wants to know more
    I wanted to de-rep this but



    Damnit

    Creds to DannyRS for this wonderful sig!

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

    Default

    Alright, I fixed it like I was told, now when I select Farmer, enter username and password, and hit start nothing happens.

    (Well, it does the login protocol and then stands there.)

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

    Default

    Quote Originally Posted by Im fkn rare View Post
    Alright, I fixed it like I was told, now when I select Farmer, enter username and password, and hit start nothing happens.

    (Well, it does the login protocol and then stands there.)
    U did not call Thieve; or Thieve1; in your mainloop

    Creds to DannyRS for this wonderful sig!

  13. #13
    Join Date
    Feb 2012
    Location
    Discord
    Posts
    3,114
    Mentioned
    37 Post(s)
    Quoted
    538 Post(s)

    Default

    Simba Code:
    begin
      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
      DTM;
      AddOnTerminate('FreeDTMss')
      AntiBan;
      TerminateScript;
    end; //this end shouldn't be here
    End.
    this is your mainloop, here is where you call your procedures and functions. Without calling them in your mainloop they won't be used.

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

    Default

    Main Loop:
    Simba Code:
    begin
      SafeInitForm;
      SafeShowFormModal;
      SetupP07Include;
      ActivateClient;
      Wait(100);
    If (Not P07_LoggedIn) Then
      begin
        P07_LogInPlayer;
      end;

      repeat
    until (Not P07_LoggedIn)
    TerminateScript;
    End.

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

    Default

    If they have an option, shouldn't the SafeInitForm/SafeShowFormModal work for initiating the procedures that are Thieve1 and Thieve2?

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

    Default

    Quote Originally Posted by Im fkn rare View Post
    If they have an option, shouldn't the SafeInitForm/SafeShowFormModal work for initiating the procedures that are Thieve1 and Thieve2?
    Thought someone would reply, so I didn't.

    Anyway it doesnt' work that way I believe, gotta call it in the mainloop

    Simba Code:
    begin
      SafeInitForm;
      SafeShowFormModal;
      SetupP07Include;
      ActivateClient;
      Wait(100);
    If (Not P07_LoggedIn) Then
        P07_LogInPlayer;

      repeat
       ThieveNPC; // Put all the functions u want here
    until (Not P07_LoggedIn)
    TerminateScript;
    End.

    Well I don't know what u want between the loop, since it's your script.
    U know it better

    Creds to DannyRS for this wonderful sig!

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

    Default

    Quote Originally Posted by Sjoekeloe View Post
    Thought someone would reply, so I didn't.

    Anyway it doesnt' work that way I believe, gotta call it in the mainloop

    Simba Code:
    begin
      SafeInitForm;
      SafeShowFormModal;
      SetupP07Include;
      ActivateClient;
      Wait(100);
    If (Not P07_LoggedIn) Then
        P07_LogInPlayer;

      repeat
       ThieveNPC; // Put all the functions u want here
    until (Not P07_LoggedIn)
    TerminateScript;
    End.

    Well I don't know what u want between the loop, since it's your script.
    U know it better
    I've tried numerous things, take a look at the script I looked at for reference:
    Simba Code:
    program PowerChop;
    {$I SRL/SRL.Simba}
    {$I SRL/SRL/Misc/Debug.Simba}
    {$I P07Include.Simba}

    var
      ChopWaitT,invcount1, invcount2,ChopWaitTime,OakColor1,TreeColor1,YewColor1, TreeColor,WillowColor,WillowColor1,MapleColor, YewColor, OakColor,Lagg: integer;
      DsgnForm:TForm;
      StartTime:Integer;
      LogCombo,AxeCombo: TComboBox;
      WieldAxe:Boolean;
      TLabel0,TLabel1,TLabel3,TLabel4,TLabel2: TLabel;
      TButton10: TButton;
      Username,Password: TEdit;
    const
      default = 'Times new roman';
      FONT = 9;
      Version = '1.0';

    procedure DTM;
    begin
    Lagg := 750;
    ChopWaitTime := 99999999999;
    TreeColor := 4162679;
    TreeColor1 := 2645590;
    OakColor := 1589301;
    OakColor1 := 2184264;
    WillowColor := 2506563;
    WillowColor1 := 3565920;
    MapleColor := 12910;
    YewColor := 1986631;
    YewColor1 := 1853512;
    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 IsWcing: Boolean;
      var
        PBox: TBox;
      Begin
      PBox := IntToBox(238, 149, 286, 186);
      Result := (AveragePixelShift(PBox, 250, 350) > 150);
      Writeln(IntToStr(AveragePixelShift(PBox, 500, 650)));
    End;

    Procedure DropLogs;
    Begin
      If (Not P07_LoggedIn) Then
      Begin
        P07_LogInPlayer;
      End;
      if (WieldAxe = True) then
      Begin
        P07_DropAll;
      End;
      if (WieldAxe = False) then
      Begin
        P07_DropAllExcept([1]);
      End;
    End;
    Function AntiBan: Boolean;
    begin
      case random(300) of
      0: P07_HoverSkill('woodcutting', random(5000));
      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 SetAxe;
    begin
      case LogCombo.ITEMINDEX of
        0:
          Begin
            WieldAxe := True;
          End;
        1:
          Begin
            WieldAxe := False;
          End;
       End;
    End;
    procedure Chop;
    var x, y: integer;
    begin
      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
        If P07_FindObj(x, y, 'Tree', TreeColor, 5) or
           P07_FindObj(x, y, 'Tree', TreeColor, 5) Then
        begin
        WaitHumanClick
          //writeln( CountColorTolerance(13093380, 0, 0, 243, 20, 30));

              if Random(2) = 1 then
              begin
                if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
                begin
                  Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
                end;
              end
              else
              begin
                if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
                begin
                  Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
                  P07_ChooseOptionMulti(['hop']);
                 end;
                end;
        end
        else
        begin
          P07_MakeCompassDegree(30);
        end;
        P07_FFlag;
        wait (lagg);
    end;
    procedure Chop1;
    var x, y: integer;
    begin
      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
        If P07_FindObj(x, y, 'Oak', OakColor1, 5) or
           P07_FindObj(x, y, 'Oak', OakColor, 5) then
        begin
          WaitHumanClick
          //writeln( CountColorTolerance(13093380, 0, 0, 243, 20, 30));

              if Random(2) = 1 then
              begin
                if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
                begin
                  Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
                end;
              end
              else
              begin
                if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
                begin
                  Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
                  P07_ChooseOptionMulti(['hop']);
                 end;
                end;
        end
        else
        begin
          P07_MakeCompassDegree(30);
        end;
        P07_FFlag;
        wait (lagg);
    end;
    procedure Chop2;
    var x, y: integer;
    begin
      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
        If P07_FindObj(x, y, 'Willow', WillowColor1, 5) or
           P07_FindObj(x, y, 'Willow', WillowColor, 5) Then
        begin
          WaitHumanClick
          //writeln( CountColorTolerance(13093380, 0, 0, 243, 20, 30));

              if Random(2) = 1 then
              begin
                if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
                begin
                  Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
                end;
              end
              else
              begin
                if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
                begin
                  Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
                  P07_ChooseOptionMulti(['hop']);
                 end;
                end;
        end
        else
        begin
          P07_MakeCompassDegree(30);
        end;
        P07_FFlag;
        wait (lagg);
    end;
    procedure Chop3;
    var x, y: integer;
    begin
      If not IsWcing then
      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
        If P07_FindObj(x, y, 'Maple', MapleColor, 5) Then
        begin
          WaitHumanClick
          //writeln( CountColorTolerance(13093380, 0, 0, 243, 20, 30));

              if Random(2) = 1 then
              begin
                if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
                begin
                  Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
                end;
              end
              else
              begin
                if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
                begin
                  Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
                  P07_ChooseOptionMulti(['hop']);
                 end;
                end;
        end
        else
        begin
          P07_MakeCompassDegree(30);
        end;
        P07_FFlag;
        wait (lagg);
    end;
    procedure Chop4;
    var x, y: integer;
    begin
      If not IsWcing then
      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
        If P07_FindObj(x, y, 'Yew', YewColor, 5) or
           P07_FindObj(x, y, 'Yew', YewColor, 5) Then
        begin
          WaitHumanClick
          //writeln( CountColorTolerance(13093380, 0, 0, 243, 20, 30));

              if Random(2) = 1 then
              begin
                if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
                begin
                  Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
                end;
              end
              else
              begin
                if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
                begin
                  Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
                  P07_ChooseOptionMulti(['hop']);
                 end;
                end;
        end
        else
        begin
          P07_MakeCompassDegree(30);
        end;
        P07_FFlag;
        wait (lagg);
    end;

    procedure ChopTree;
    var x, y: integer;
    begin
      case LogCombo.ITEMINDEX of
        0:
          Begin
            If P07_FindObj(x, y, 'Tree', TreeColor, 10) or
               P07_FindObj(x, y, 'Tree', TreeColor1, 10) Then
            Chop;
          End;
        1:
          Begin
            If P07_FindObj(x, y, 'Oak', OakColor, 10) or
               P07_FindObj(x, y, 'Oak', OakColor1, 10) Then
            Chop1;
          End;
        2:
          Begin
            If P07_FindObj(x, y, 'Willow', WillowColor, 10) or
               P07_FindObj(x, y, 'Willow', WillowColor1, 10) Then
            Chop2;
          End;
        3:
          Begin
            If P07_FindObj(x, y, 'Maple', MapleColor, 10) Then
            Chop3;
          End;
        4:
          Begin
            If P07_FindObj(x, y, 'Yew', YewColor, 10) or
               P07_FindObj(x, y, 'Yew', YewColor1, 10) Then
            Chop4;
          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;
      SetAxe;
      ChopTree;
    end;


      procedure InitForm;
    begin
     DsgnForm:=TForm.Create(nil);
      with DsgnForm do
        begin
          Caption:='PowerChop From Grand01';
          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:='PowerChop 1.3';
          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:='Tree';
          Left:=40;
          Top:=40;
          Width:=41;
          Height:=14;
          Font.Name:=default;
          Font.Color:=clDefault;
          Font.Size:=9;
      end;
     TLabel2:=TLabel.Create(DsgnForm);
      with TLabel2 do
        begin
          Parent:=DsgnForm;
          Caption:='Wield Axe';
          Left:=40;
          Top:=80;
          Width:=48;
          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:=12;
      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:=21;
          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;
     LogCombo:=TComboBox.Create(DsgnForm);
      with LogCombo do
        begin
          Parent:=DsgnForm;
          Left:=100;
          Top:=40;
          Width:=80;
          Height:=21;
          Items.Add('Tree');
          Items.Add('Oak');
          Items.Add('Willow');
          Items.Add('Maple');
          Items.Add('Yew');
          Text := Items[0];
          Font.Name:=default;
          Font.Color:=clDefault;
          Font.Size:=9;
      end;
     AxeCombo:=TComboBox.Create(DsgnForm);
      with AxeCombo do
        begin
          Parent:=DsgnForm;
          Left:=100;
          Top:=80;
          Width:=80;
          Height:=21;
          Items.Add('Yes');
          Items.Add('No');
          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;
      SetAxe;
      Wait(100);

      If (Not P07_LoggedIn) Then
      begin
        P07_LogInPlayer;
      end;

      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
      DTM;
      AddOnTerminate('FreeDTMss')
      MarkTime(ChopWaitT);
      invcount2 := 28;

      AntiBan;

      repeat


        if(P07_InvFull) then
        begin
        DropLogs;
        end;
        begin
          if((invcount2 >= invcount1) or not isMoving1) then
          begin
            ChopTree;
            invcount2 := 0;
          end;
          begin
                if(random(10) = 1) then
                begin
                  MMouse(random(800), random(550), 0, 0);
                end;
              end;
            end;

    until (Not P07_LoggedIn)
      TerminateScript;
    end.

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

    Default

    The most effective way is to make some debug lines then
    If FindColorSpiralTolerance(x, y, 8564671, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 7) then
    Writenln(' found the color')

    Do that for most of the if then statements.
    See where your script cramps up!
    And then u know where your script malfunctions.

    Creds to DannyRS for this wonderful sig!

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

    Default

    I think I've figured it out. If you explain to me what a DTM is a little further than what was given in the guide I read, I can fix this. A DTM is a variable?

  20. #20
    Join Date
    Feb 2012
    Location
    Discord
    Posts
    3,114
    Mentioned
    37 Post(s)
    Quoted
    538 Post(s)

    Default

    Quote Originally Posted by Im fkn rare View Post
    I think I've figured it out. If you explain to me what a DTM is a little further than what was given in the guide I read, I can fix this. A DTM is a variable?
    There's loads of DTM tutorials, in the scripting tutorial section here.
    Just a few I like:
    http://villavu.com/forum/showthread.php?t=68018
    http://villavu.com/forum/showthread.php?t=24858

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

    Default

    Here is the final version, it still doesn't work, and I can't figure out what's wrong with it.
    Simba Code:
    program RareAIOThiever; //Written by Im Fkn Rare (Credits to PowerChop & WordPocket for Snippets!)

    {$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 := 1460062;
    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;
    //Where I began adding things is below this line
    procedure Thieve;      //Man
    var x, y: integer;
    begin
      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
      PBox := IntToBox(240, 158, 285, 198);
      If AveragePixelShift(PBox, 250, 350) < 100 then
      If FindColorSpiralTolerance(x, y, 5982280, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 7) then
      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;
    procedure Thieve1; //Farmer
    var x, y: integer;
    begin
      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
      PBox := IntToBox(240, 158, 285, 198);
      If AveragePixelShift(PBox, 250, 350) < 100 then
      If FindColorSpiralTolerance(x, y, 8103863, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 7) then
      Writeln('found the color');
      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;
    procedure ThieveNPC;
    begin
      case NPCCombo.ITEMINDEX of
        0:
          Begin
            If P07_FindObj(x, y, 'Man', ManColor, 10) then
            Thieve;
          End;
        1:
          Begin
            If P07_FindObj(x, y, 'Farmer', FarmerColor, 10) then
            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;
    end;
    procedure InitForm;
    begin
     DsgnForm:=TForm.Create(nil);
      with DsgnForm do
        begin
          Caption:='AIO Thiever from 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;
      ThieveNPC;
      Wait(100);

      If (Not P07_LoggedIn) Then
      begin
        P07_LogInPlayer;
      end;

      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
      DTM;


      repeat

    until (Not P07_LoggedIn)
      TerminateScript;
    end.

  22. #22
    Join Date
    Feb 2012
    Location
    Discord
    Posts
    3,114
    Mentioned
    37 Post(s)
    Quoted
    538 Post(s)

    Default

    Quote Originally Posted by Im fkn rare View Post
    Here is the final version, it still doesn't work, and I can't figure out what's wrong with it.
    Simba Code:
    program RareAIOThiever; //Written by Im Fkn Rare (Credits to PowerChop & WordPocket for Snippets!)

    {$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 := 1460062;
    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;
    //Where I began adding things is below this line
    procedure Thieve;      //Man
    var x, y: integer;
    begin
      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
      PBox := IntToBox(240, 158, 285, 198);
      If AveragePixelShift(PBox, 250, 350) < 100 then
      If FindColorSpiralTolerance(x, y, 5982280, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 7) then
      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;
    procedure Thieve1; //Farmer
    var x, y: integer;
    begin
      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
      PBox := IntToBox(240, 158, 285, 198);
      If AveragePixelShift(PBox, 250, 350) < 100 then
      If FindColorSpiralTolerance(x, y, 8103863, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 7) then
      Writeln('found the color');
      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;
    procedure ThieveNPC;
    begin
      case NPCCombo.ITEMINDEX of
        0:
          Begin
            If P07_FindObj(x, y, 'Man', ManColor, 10) then
            Thieve;
          End;
        1:
          Begin
            If P07_FindObj(x, y, 'Farmer', FarmerColor, 10) then
            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;
    end;
    procedure InitForm;
    begin
     DsgnForm:=TForm.Create(nil);
      with DsgnForm do
        begin
          Caption:='AIO Thiever from 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;
      ThieveNPC;
      Wait(100);

      If (Not P07_LoggedIn) Then
      begin
        P07_LogInPlayer;
      end;

      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
      DTM;


      repeat

    until (Not P07_LoggedIn)
      TerminateScript;
    end.
    You still don't call actual thieving in your script.
    repeat

    until (Not P07_LoggedIn)
    does nothing :/ go back over basics some more tutorials if you're unsure

    edit: you also load your colours during the end when they should be before you need them (should be before theiveNPC)

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

    Default

    Also Call DTM; at the beginning of the script, to load the colors for ThieveNPC;
    If the are not called before they are used. They will have a value of 0.

    Creds to DannyRS for this wonderful sig!

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

    Default

    That doesn't work, it's not doing anything. It logs in, and sits there.

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
  •