Results 1 to 4 of 4

Thread: Inventory Error; Will not click on first 4 slots.

  1. #1
    Join Date
    Jan 2013
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default Inventory Error; Will not click on first 4 slots.

    I'm trying to make a script which moves to a DTM, right clicks and drop the item. (I'm using this method as I cannot find a DropInv procedure that works on a RSPS.)
    The script executes as it should, it moves the mouse to the Iron ore. However, if I place Iron ore in the first 4 horizontal inventory slots, the mouse doesn't pick up the item.

    Suggestions? Thanks.


    Code:
    program new;
    {$i SRL/SRL.Simba}
    var
      x, y, IronOre, IronBit:Integer;
    
    
    
    procedure DropInv;
    begin
    If FindBitmapToleranceIn(IronBit, x, y, MIX1, MIY1, MIX2, MIY2, 30) then
      begin
        MoveMouse(x, y);
        WriteLn('We Found Iron');
      end;
    end;
    
    begin
    SetupSRL;
    IronOre := DTMFromString('mrAAAAHic42BgYGhgZWCoBeIuIO4D4jYgrgbiIiAuA+JtjAwMR4F4FxBvAOLVULwZiPcBsb2aLNAURjwYP8CnE1k3AHZxCnQ=');
    IronBit := BitmapFromString(12, 9, 'meJxdkMEGw0AURdNlF1mULCKMxKi' +
            'RRUXIpnQxtDRUS2n0CyJfUfrrPXF5RrlGzDvuO5Pr/BmX7ybLlG1e' +
            '7cq28kfXXvb9k/jurlHT9IQPgLIeXIgCwvDiPN0mAefHGyZtAFC4Z' +
            'yqA1IfRpiagRZx54Sn5uzcHM1kXhcguA+hHxpjCdZJZE6I5pAzPUQ' +
            '9KSqoqBkA9/BAFeYn9AIFQLDs=');
    DropInv;
    FreeDTM(IronOre);
    FreeBitmap(IronBit);
    end.

  2. #2
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    However, if I place Iron ore in the first 4 horizontal inventory slots, the mouse doesn't pick up the item.
    What do you mean by this?
    Also from the code it will merely hover over the first iron ore it found.

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

    Default

    Yep, MoveMouse just move the mouse, still gotta add clickmouse(mouse_right)(I think this is the correct parameter?) and chooseoption('Drop').

    Creds to DannyRS for this wonderful sig!

  4. #4
    Join Date
    Dec 2012
    Posts
    86
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    Quote Originally Posted by Dynam0 View Post
    I'm trying to make a script which moves to a DTM, right clicks and drop the item. (I'm using this method as I cannot find a DropInv procedure that works on a RSPS.)
    The script executes as it should, it moves the mouse to the Iron ore. However, if I place Iron ore in the first 4 horizontal inventory slots, the mouse doesn't pick up the item.

    Suggestions? Thanks.


    Code:
    program new;
    {$i SRL/SRL.Simba}
    var
      x, y, IronOre, IronBit:Integer;
    
    
    
    procedure DropInv;
    begin
    If FindBitmapToleranceIn(IronBit, x, y, MIX1, MIY1, MIX2, MIY2, 30) then
      begin
        MoveMouse(x, y);
        WriteLn('We Found Iron');
      end;
    end;
    
    begin
    SetupSRL;
    IronOre := DTMFromString('mrAAAAHic42BgYGhgZWCoBeIuIO4D4jYgrgbiIiAuA+JtjAwMR4F4FxBvAOLVULwZiPcBsb2aLNAURjwYP8CnE1k3AHZxCnQ=');
    IronBit := BitmapFromString(12, 9, 'meJxdkMEGw0AURdNlF1mULCKMxKi' +
            'RRUXIpnQxtDRUS2n0CyJfUfrrPXF5RrlGzDvuO5Pr/BmX7ybLlG1e' +
            '7cq28kfXXvb9k/jurlHT9IQPgLIeXIgCwvDiPN0mAefHGyZtAFC4Z' +
            'yqA1IfRpiagRZx54Sn5uzcHM1kXhcguA+hHxpjCdZJZE6I5pAzPUQ' +
            '9KSqoqBkA9/BAFeYn9AIFQLDs=');
    DropInv;
    FreeDTM(IronOre);
    FreeBitmap(IronBit);
    end.
    the coordinates are different on the private server because the globals for SRL moves the coordinates a bit because of the Navigation bar on the real RS, which is nonexistent on ProjectRS06. open /simba/includes/srl/srl/core/globals.simba and see for yourself. you also can't use the variables MIX1, MIY1 etc. for that same reason.

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
  •