Results 1 to 8 of 8

Thread: Mouse doesn't click DTM

  1. #1
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default Mouse doesn't click DTM

    I've been making this auto-fletcher for quite some time now, but I have this problem where when it goes to click on the log, it doesn't and goes straight into the AntiBan procedure.

    Script is below if you can spot whats going wrong:

    SCAR Code:
    Program LongbowFletcher;
    {.include srl/srl.scar}
    {.include srl/srl/misc/Users.scar}
     
    var
      Loads, Tries, x, y, AntiBanned, Responded: integer;
      frmDesign : TForm;
      GroupBox1 : TGroupBox;
      Edit1 : TEdit;
      Edit2 : TEdit;
      Edit3 : TEdit;
      Edit4 : TEdit;
      Edit5 : TEdit;
      Button1 : TButton;
      Loads1 : Integer;
     
    Const
    SleepTimeInMin = 50;

    procedure StartClick(sender: TObject);
    begin
      frmDesign.ModalResult:= mrOk;
      Loads1:= StrToInt(Edit5.text)
    end;

    Procedure Form;
    Begin
    frmDesign := CreateForm;
    frmDesign.Left := 250;
    frmDesign.Top := 114;
    frmDesign.Width := 300;
    frmDesign.Height := 350;
    frmDesign.Caption := 'frmDesign';
    frmDesign.Color := clMaroon;
    frmDesign.Font.Color := clRed;
    frmDesign.Font.Height := -11;
    frmDesign.Font.Name := 'Comic Sans MS';
    frmDesign.Font.Style := [];
    frmDesign.Visible := False;
    frmDesign.PixelsPerInch := 96;
    GroupBox1 := TGroupBox.Create(frmDesign);
    GroupBox1.Parent := frmDesign;
    GroupBox1.Left := 16;
    GroupBox1.Top := 16;
    GroupBox1.Width := 249;
    GroupBox1.Height := 273;
    GroupBox1.Caption := 'DR'#39's any longbow maker setup';
    GroupBox1.Font.Color := clWindowText;
    GroupBox1.Font.Height := -11;
    GroupBox1.Font.Name := 'Comic Sans MS';
    GroupBox1.Font.Style := [];
    GroupBox1.ParentFont := False;
    GroupBox1.TabOrder := 0;
    Edit1 := TEdit.Create(GroupBox1);
    Edit1.Parent := GroupBox1;
    Edit1.Left := 144;
    Edit1.Top := 64;
    Edit1.Width := 73;
    Edit1.Height := 23;
    Edit1.TabOrder := 1;
    Edit1.Text := 'Password';
    Edit2 := TEdit.Create(GroupBox1);
    Edit2.Parent := GroupBox1;
    Edit2.Left := 16;
    Edit2.Top := 64;
    Edit2.Width := 73;
    Edit2.Height := 23;
    Edit2.TabOrder := 2;
    Edit2.Text := 'Username';
    Edit3 := TEdit.Create(GroupBox1);
    Edit3.Parent := GroupBox1;
    Edit3.Left := 16;
    Edit3.Top := 96;
    Edit3.Width := 73;
    Edit3.Height := 23;
    Edit3.TabOrder := 3;
    Edit3.Text := 'PIN';
    Edit4 := TEdit.Create(GroupBox1);
    Edit4.Parent := GroupBox1;
    Edit4.Left := 144;
    Edit4.Top := 96;
    Edit4.Width := 73;
    Edit4.Height := 23;
    Edit4.TabOrder := 4;
    Edit4.Text := 'Nickname';
    Edit5 := TEdit.Create(GroupBox1);
    Edit5.Parent := GroupBox1;
    Edit5.Left := 80;
    Edit5.Top := 136;
    Edit5.Width := 73;
    Edit5.Height := 23;
    Edit5.TabOrder := 5;
    Edit5.Text := 'Loads';
    Button1 := TButton.Create(GroupBox1);
    Button1.Parent := GroupBox1;
    Button1.Left := 48;
    Button1.Top := 200;
    Button1.Width := 145;
    Button1.Height := 41;
    Button1.Caption := 'Start Any Longbow Maker';
    Button1.TabOrder := 6;
    Button1.OnClick := @StartClick
    end;

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

    procedure ShowFormModal;
    begin
      frmDesign.ShowModal;
    end;

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


    Var
    Knife, Log, Longoption: integer;

    Procedure LoadDTMs;
    Begin
       Knife := DTMFromString('78DA6354626060906000036608C550535CCC2' +
              '007A41981F83F1030AA001952A86AD62F5E045703028C208E3CAA' +
              '9A504B2E54350A404201554DB6072FAA1A6920A18AAAA6A7A9115' +
              '50DC82DEAA86A4A737351D5A861FA0B248BAC06000BE50E33');
       Log := DTMFromString('78DA639CC9C4C0F088010514FAF2318832323'   +
              '00011C37F2060EC06AA79CC800618914820DD0154F386809A5940' +
              '35EF08A8590254F38A809AC940351FF0AB0100D0AD0DF2');
       Longoption := DTMFromString('78DA63D4606060906100036608C5E067CAC5F' +
              '010483302F17F20605403322451D584DB70C3D58000A3269090C7' +
              '6D0E588D2190D0465573F3E8625435CA40C20A55CD95837330D58' +
              '4A2AA01011435D240228C801A1B206187AA26D79B0F558D1990D0' +
              '4255E3ACC781AA461C4808A1AA89B1470B1F50F809A3AA4974E24' +
              '15103006C031A39');
    End;

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


      Players[0].Name := Edit2.text;
      Players[0].Pass := Edit1.text;
      Players[0].Nick := Edit4.text;
      Players[0].Integers[0] := Loads1;
      Players[0].Strings[0]  := Edit3.text;
      Players[0].Active := True;
     
    end;

    Procedure Fletch;
    Begin
      If not LoggedIn then
      Exit;
        If (FindDTM(Knife,x,y,MIX1,MIY1,MIX2,MIY2))then
          Begin
            Mouse(x, y, 1, 1, true);
            WriteLN('Clicked Knife');
            WriteLN('Clicking log');
            Exit;
          end;
        Wait (500 + random(300));
        If not (FindDTM(Knife,x,y,MIX1,MIY1,MIX2,MIY2))then
          Begin
            WriteLN('Couldnt find knife');
            WriteLN('Make sure one was in your inventory');
            WriteLN('Logging out and terminating script');
            Logout;
            TerminateScript;
            Exit;
          end;
        If (FindDTM(Log,x,y,MIX1,MIY1,MIX2,MIY2))then
          Begin
            Mouse(x, y, 2, 2, true);
            WriteLN('Clicked Log');
            WriteLN('Waiting to make longbow');
            Exit;
          end;
        If not (FindDTM(Log,x,y,MIX1,MIY1,MIX2,MIY2))then
          Begin
            WriteLN('Couldnt find any logs');
            WriteLN('Must have had an error banking');
            WriteLN('Logging out and terminating script');
            Logout;
            TerminateScript;
            Exit;
          end;
        Wait(500 + random(300));
        If (FindDTM(Longoption,x,y,MIX1,MIY1,MIX2,MIY2)) then
          Begin
            Mouse(x, y, 3, 3, false);
            ChooseOption('X');
            TypeSend('27');
            WriteLN('Making longs(u)');
          end;
        Wait(500 + random(300));
      Loads:=Loads+1;
    end;

    Procedure GetThingFromBank;
    Var
    Resultx : Boolean;
    Begin
     If not LoggedIn then
     Exit;
     Repeat
      If FindObjCustom(x,y,['Use','Bank','Booth'],[5405328,5339277,804444],5) then
        Mouse(x,y,0,0,False);
        ChooseOption('uickly');
        Wait(1000+Random(2000));
        Tries:=Tries+1;
      If PinScreen Then
        InPin(Players[CurrentPlayer].Strings[1]);
      FixBank;
      ResultX := BankScreen;
      Until(BankScreen) or (Tries >= 6);
          If BankScreen then
           Begin
           
            MMouse(95-Random(5), 77+Random(5),2,2);
             If IsUpText('ogs') then
              Begin
               Mouse(95-Random(5), 77+Random(5),2,2,False);
               ChooseOption('All');
               wait(1000+Random(200));
               CloseBank;
            end;
        end;
    end;

    Procedure AntiBan;
    Begin
      If not LoggedIn then
      Exit;
      Case random(9) of
       1: Begin
            KeyDown(VK_Down);
            Wait(random(1000));
            KeyUp(VK_Down);
            KeyDown(VK_Up);
            Wait(500 + random(1000));
            KeyUp(VK_Up);
            MakeCompass('n');
          end;
       2: Begin
            KeyDown(VK_Left);
            Wait(random(1000));
            KeyUp(VK_Left);
            KeyDown(VK_Right);
            Wait(random(1000));
            KeyUp(VK_Right);
            MakeCompass('n');
          end;
       3: Begin
            KeyDown(VK_Left);
            Wait(random(1000));
            KeyUp(VK_Left);
            KeyDown(VK_Right);
            Wait(random(1000));
            KeyUp(VK_Right);
            MakeCompass('n');
          end;
       4: Begin
            KeyDown(VK_Up);
            KeyDown(VK_Left);
            Wait(random(1000));
            KeyUp(VK_Up);
            Wait(random(800));
            KeyUp(VK_Left);
            MakeCompass('n');
          end;
       5: Begin
            HoverSkill('random', False);
          end;
       6: Begin
            HoverSkill('Fletching', False);
          end;
       7: Begin
            PickupMouse;
          end;
       8: Begin
            AlmostLogout;
          end;
       9: Begin
            BoredHuman;
          end;
        end;
      AntiBanned := AntiBanned + 1;
    end;

    Function InChatLine(myString: string): Boolean;
      Begin
        Result := ( pos(myString, TheLine) <> 0 );
      End;

    procedure LevelRespond;
    var
      Chats : TStringArray;
      I, L: Integer;
    Begin
      If not LoggedIn then
      Exit;
      Chats := ['tching l', 'hing lv', 'hing le', 'tchin lvl', 'etch lv'];
      for I := 0 to 4 do
      begin
        if InChat(Chats[i]) then
        begin
          inc(Responded);
          L := GetSkillInfo('fletching', False);
          case Random(11) of
            0: TypeSend(IntToStr(L)+', close to'+IntToStr(L+1));
            1: TypeSend('Me '+ IntToStr(L));
            2: TypeSend(IntToStr(L) + ' over here');
            3: Begin
                 TypeSend('Lemme check...');
                 Wait(500 + random(3000));
                 TypeSend('...' + IntToStr(L));
               end;
            4: TypeSend('Im ' + IntToStr(L));
            5: TypeSend('only ' + IntToStr(L));
            6: TypeSend('Pfft, only ' + IntToStr(L));
            7: begin
                 TypeSend('onky ' + IntToStr(L));
                 TypeSend('*only');
               end;
            8: TypeSend('My Fletching is only ' + IntToStr(L) + ' ...lol');
            9: TypeSend('Not very good...only '+IntToStr(L));
           10: TypeSend(IntToStr(L) + ', going for 99')
          end;
          wait(1000 + Random(500));
          Exit;
        end;
      end;
    end;


    Procedure Siggy;
    Begin
      ClearDebug;
      WriteLN('Dude_Richard.......')
      Wait(1000)
      WriteLN('Presents.......')
      Wait(1200)
      WriteLN('The One the Only.......')
      Wait(1300)
      WriteLN('Any Longbow Maker v1.0!')
      Wait(1500)
    End;


    Begin
      SetupSRL;
      LoadDTMs;
      Siggy;
      SafeInitForm;
      SafeShowFormModal;
      DeclarePlayers;
      ActivateClient;
      LoginPlayer;
      LevelRespond;
        Repeat
         GetThingFromBank;
         Fletch;
         Wait(550 + random(350));
        until (Loads >= Players[CurrentPlayer].Integers[0])
      FreeDTM(longoption);
      FreeDTM(log);
      FreeDTM(knife);
    end.

  2. #2
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    make sure all points of the dtm are in the black lines of the item.

    if you want to have the mainpoint in the center of the item, make sure you give it an tolerance of 255

    good luck scripting, and i hope this helped.

  3. #3
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    I don't think its a problem with it finding the DTM because it finds it when its in the bank, or are items slightly different when they are in the bank.

    Thanks anyway

    DR

  4. #4
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    how about this exit?

    SCAR Code:
    If (FindDTM(Knife,x,y,MIX1,MIY1,MIX2,MIY2))then
          Begin
            Mouse(x, y, 1, 1, true);
            WriteLN('Clicked Knife');
            WriteLN('Clicking log');
            Exit; // r u sure you want to exit?
          end;

  5. #5
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    Haha, well spotted, i must have done that when I copied and pasted the find DTM/ not find DTM and forgot to remove it.

    Thanks for noticing.

    DR

  6. #6
    Join Date
    Mar 2007
    Location
    Netherlands
    Posts
    206
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Does it works now? Because I had the problem aswell.

  7. #7
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    Quote Originally Posted by FNM View Post
    Does it works now? Because I had the problem aswell.
    Yeah it does, I'm just tesing it to find out how long it takes for one invent,

    Now what I have to find out is how you can get it to know when the whole invent is done.

    If you know how to do this the help would be apreciated

  8. #8
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    You can move the mouse to last inventory slot ('MMouseItem(28)') then check the uptext in a repeat loop - had to do checks when I was making a clay to bowl maker for the crafting guild. Otherwise you can check the chat text as well as it says 'You have run out of logs' or something like that when you run out of logs to fletch (I think).

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How do you click and hold mouse button?
    By Kasmember13 in forum OSR Help
    Replies: 1
    Last Post: 01-18-2009, 09:33 PM
  2. Click the mouse without moving it?
    By orange in forum OSR Help
    Replies: 5
    Last Post: 08-08-2008, 10:13 PM
  3. mouse click + tpa error
    By xelfarcherdv in forum OSR Help
    Replies: 5
    Last Post: 01-05-2008, 08:50 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
  •