Results 1 to 12 of 12

Thread: DragItemTo(FromSlot,ToSlot:Integer):Boolean;

  1. #1
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default DragItemTo(FromSlot,ToSlot:Integer):Boolean;

    Simba Code:
    function DragItemTo(FromSlot,ToSlot:Integer):Boolean;
    var
      x,y:Integer;
    begin
    Result := False;
      if not LoggedIn then
        exit;
      if ExistsItem(FromSlot) then
      begin
        MouseItem(FromSlot,3);
        Wait(50 + random(50));
        GetMousePos(x,y);
        HoldMouse(x,y,mouse_Left);
        MouseItem(ToSlot,3);
        GetMousePos(x,y);
        ReleaseMouse(x,y,mouse_Left);
        Wait(50 + random(50));
        if ExistsItem(ToSlot) then
          Result := True;
      end else exit;
    end;

  2. #2
    Join Date
    Dec 2011
    Location
    Berlin
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Cool function
    +rep

    I will try to answer all Runescape related questions!

  3. #3
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Are your MouseItem parameters correct?
    Simba Code:
    MouseItem(FromSlot,3); // '3' should be 0, 1 or 2 no?


    What does 3 represent? As far as I'm concerned:

    mouse_Right = 0
    mouse_Left = 1
    mouse_Middle = 2


    So 3 is doing nothing?

  4. #4
    Join Date
    Nov 2011
    Posts
    1,532
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Is it mouse_move?
    Current activity: Recovering from vacation
    - Nulla pars vitae vacare officio potest -
    SRL membership? Can I buy that?
    Scripts - AGS - SWF - WAR - EMS - W100S-EM
    If you need scripting help, you can pm me. Remember, if you need help you have to ask for it properly though

  5. #5
    Join Date
    Jan 2012
    Posts
    713
    Mentioned
    3 Post(s)
    Quoted
    9 Post(s)

    Default

    This function is already in the SRL includes? I don't see how yours is any different.

  6. #6
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    I don't think it is?

  7. #7
    Join Date
    Jan 2012
    Posts
    713
    Mentioned
    3 Post(s)
    Quoted
    9 Post(s)

    Default

    Simba Code:
    {*********************************************
    Procedure DragM;
    By: NaumanAkhlaQ
    Description: Leftclicks StartX, StartY and
    drags mouse to EndX, EndY..
    **********************************************}

    Procedure DragM(StartX, StartY, SRandX, SRandY, EndX, EndY, ERandX, ERandY: Integer);
    begin
      MMouse(StartX, StartY, SRandX, SRandY);
      Wait(150 + Random(20));
      GetMousePos(StartX, StartY);
      HoldMouse(StartX, StartY, mouse_left);
      Wait(250 + Random(320));
      MMouse(EndX, EndY, ERandX, ERandY);
      Wait(250 + Random(120));
      GetMousePos(EndX, EndY);
      ReleaseMouse(EndX, EndY, mouse_left);
    end;

    This is what I've been using in all my scripts for the past month, instead of the coords you use the slot?

  8. #8
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Well the function is different, it's DragItem.

  9. #9
    Join Date
    Jan 2012
    Posts
    713
    Mentioned
    3 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by Sin View Post
    Well the function is different, it's DragItem.
    Whatever nevermind they both do the same thing.
    Last edited by Google; 05-08-2012 at 08:16 PM.

  10. #10
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by GOOGLE View Post
    Whatever nevermind they both do the same thing.
    Using your logic, we mine as well get rid of MouseItem() too, cause we've already got Mouse().

    The point is, this is for inventory specific endeavors. If you're using DragM() alot in your inventory, then DragItemTo() would save alot of time since you only need to identify inventory slots instead of using all sorts of static coordinates.

  11. #11
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Simba Code:
    function DragItemTo(FromSlot, ToSlot :Integer):Boolean;
    var
      ItemPoint :TPoint;
    begin
      If ExistsItem(FromSlot) then
      begin
        ItemPoint := MiddleBox(InvBox(FromSlot));
        MMouse(ItemPoint.X, ItemPoint.Y, 0, 0);
        HoldMouse(ItemPoint.X, ItemPoint.Y, mouse_Left);
        ItemPoint := MiddleBox(InvBox(ToSlot));
        MMouse(ItemPoint.X, ItemPoint.Y, 0, 0);
        ReleaseMouse(ItemPoint.X, ItemPoint.Y, mouse_Left);
      end;
    end;


    What I have noticed that above OP Function misses items. This will use Middle of the InvSlot.

    ~Home

  12. #12
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    <3 +rep
    Quote Originally Posted by Runaway View Post
    Using your logic, we mine as well get rid of MouseItem() too, cause we've already got Mouse().

    The point is, this is for inventory specific endeavors. If you're using DragM() alot in your inventory, then DragItemTo() would save alot of time since you only need to identify inventory slots instead of using all sorts of static coordinates.

    Has it really? It's never missed an item for me
    Quote Originally Posted by Home View Post
    Simba Code:
    function DragItemTo(FromSlot, ToSlot :Integer):Boolean;
    var
      ItemPoint :TPoint;
    begin
      If ExistsItem(FromSlot) then
      begin
        ItemPoint := MiddleBox(InvBox(FromSlot));
        MMouse(ItemPoint.X, ItemPoint.Y, 0, 0);
        HoldMouse(ItemPoint.X, ItemPoint.Y, mouse_Left);
        ItemPoint := MiddleBox(InvBox(ToSlot));
        MMouse(ItemPoint.X, ItemPoint.Y, 0, 0);
        ReleaseMouse(ItemPoint.X, ItemPoint.Y, mouse_Left);
      end;
    end;


    What I have noticed that above OP Function misses items. This will use Middle of the InvSlot.

    ~Home

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
  •