Results 1 to 8 of 8

Thread: Help on MouseItem

  1. #1
    Join Date
    Dec 2009
    Location
    Next to my PC
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help on MouseItem

    Okay, I need to do something which moves the mouse to inv slots and clicks them. There is MouseItem, I know. I could do it like

    Code:
    for i := 1 to 28 do
      MouseItem(i,True);
    But I need something which doesn't click from 1-28 but like

    Code:
    function ClickFromTopToBottomAndBack;
      begin
        MouseItem(1,True);
        MouseItem(5,True);
        MouseItem(9,True);
        MouseItem(13,True);
        MouseItem(17,True);
        MouseItem(21,True);
        MouseItem(25,True);
        MouseItem(26,True);
        MouseItem(22,True);
        MouseItem(18,True);
        MouseItem(14,True);
        MouseItem(10,True);
        MouseItem(6,True);
        MouseItem(2,True);
        MouseItem(3,True);
        MouseItem(7,True);
        MouseItem(11,True);
        MouseItem(15,True);
        MouseItem(19,True);
        MouseItem(23,True);
        MouseItem(27,True);
        MouseItem(28,True);
        MouseItem(24,True);
        MouseItem(20,True);
        MouseItem(16,True);
        MouseItem(12,True);
        MouseItem(8,True);
        MouseItem(4,True);
    end;
    How would I do this? Thanks for your help!

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Some snippits from my powerminer.
    SCAR Code:
    Var RockPattern: Array Of TIntegerArray;

    Procedure BasicSetup;
    Begin
      SetArrayLength(RockPattern, 2);
      RockPattern[0]:=[1, 5, 9, 13, 17, 21, 25, 2, 6, 10, 14, 18, 22, 26, 3, 7, 11, 15, 19, 23, 27, 4, 8, 12, 16, 20, 24, 28];
      RockPattern[1]:=[1, 5, 9, 13, 17, 21, 25, 26, 22, 18, 14, 10, 6, 2, 3, 7, 11, 15, 19, 23, 27, 28, 24, 20, 16, 12, 8, 4];
    End;


    For I:=0 to 27 Do
      Begin
        If Not(LoggedIn) Then Break;
        StatsGuise('Dropping Ores: ' + IntToStr(InvCount));
        RT:=GetSystemTime;
        If FindNormalRandoms Then
         IncEx(WeMined, GetSystemTime - RT);
        SlotBox:=InvBox(RockPattern[R][I]);
        If FindDTm(OreMid, x, y, SlotBox.X1, SlotBox.Y1,  SlotBox.X2,  SlotBox.Y2) Then
        Begin
          MouseItem(RockPattern[R][I], False);

    Is how I did it, let me know if you need any more clarification about the code.

  3. #3
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    only other way I can think of is..
    SCAR Code:
    procedure ClickFromTopToBottomAndBack;
    var
      Clicks: TIntegerArray;
      i, h: Integer;
    begin
      Clicks := [1, 5, 9, 13, 17, 21, 25, 26, 22, 18, 14, 10, 6, 2, 3, 7, 11, 15, 19, 23, 27, 28, 24, 20, 16, 12, 8, 4];
      h := High(Clicks);
      for i := 0 to h do
        MouseItem(i, True);
    end;

    EDIT:

  4. #4
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Timer, that doesn't work correctly actually
    Run this and see:
    SCAR Code:
    Program Bla;

    var
      Clicks: TIntegerArray;
      i, h: Integer;
    begin
      Clicks := [1, 5, 9, 13, 17, 21, 25, 26, 22, 18, 14, 10, 6, 2, 3, 7, 11, 15, 19, 23, 27, 28, 24, 20, 16, 12, 8, 4];
      h := High(Clicks);
      for i := 0 to h do
        WriteLn(IntToStr(i));
    end.

    You want it like this
    SCAR Code:
    Program Bla;

    var
      Clicks: TIntegerArray;
      i, h: Integer;
    begin
      Clicks := [1, 5, 9, 13, 17, 21, 25, 26, 22, 18, 14, 10, 6, 2, 3, 7, 11, 15, 19, 23, 27, 28, 24, 20, 16, 12, 8, 4];
      h := High(Clicks);
      for i := 0 to h do
        WriteLn(IntToStr(Clicks[i]));
    end.


  5. #5
    Join Date
    Dec 2009
    Location
    Next to my PC
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay, Timer, your Code seems to do the same as
    Code:
    for i := 1 to 28 do
      MouseItem(i,True);
    And YoHoJo, let me try to catch you on irc or something (Are you online atm?)
    (setting up the stoof now)

    Thanks for the fast responses
    ~Swiss

  6. #6
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    DropPattern is already in SRL, isn't it?

  7. #7
    Join Date
    Dec 2009
    Location
    Next to my PC
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay, woot thanks alot :P

    I just had an epicly funny moment as I saw the result!

    ~Swiss

  8. #8
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sorry, i meant Clicks[i], not just i.. shit.

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
  •