Results 1 to 7 of 7

Thread: Taking Loot

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

    Default Taking Loot

    I am modifying combat script to take loot.

    I added procedure

    Code:
    Procedure CheckLoot;
    begin
      Writeln('CheckLoot');
      if  FindObjCustom(x,y,['ake','Take'],[7414386,7350664,6624140,5640311], 10) then
      begin
        Writeln('FOUND Loot');
        PlaySound('G:\rs\beep.wav');
        MMouse(x,y, 0, 0);
        ClickMouse2(mouse_left);
    
        while (IsMoving = True) do
        begin
          wait(100);
        end;
    
        ClickMouse2(mouse_left);
        wait(randomRange(100,450));
        ClickMouse2(mouse_left);
        wait(randomRange(100,450));
      end;
    end;
    Call it before attacking NPC.

    Now script find the loot. Click on it. My char walk over the loot stack.

    Since my char moved, x and y get changed. So next 2 ClickMouse2 miss click.

    Calling the CheckLoot procedure while standing on loot stack won't work as.. loot is not visible.

    How do i get the loot ? May be get my current x,y (where my char standing) and click to take loot. If there any function to do that ?

  2. #2
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    Why dont you take the item with the first click?
    Check for uptext, if its 'Take' then left click, if its not, right click and choose option 'Take'.

  3. #3
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by RuneDragon View Post
    I am modifying combat script to take loot.


    How do i get the loot ? May be get my current x,y (where my char standing) and click to take loot. If there any function to do that ?
    Why don't you just right click the loot and pick it up that way?

    Simba Code:
    Procedure CheckLoot;
    var
      x, y: Integer;

    begin
      Writeln('CheckLoot');
      if  FindObjCustom(x,y,['ake','Take'],[7414386,7350664,6624140,5640311], 10) then
      begin
        Writeln('FOUND Loot');
        PlaySound('G:\rs\beep.wav');
        MMouse(x,y, 0, 0);
        if IsUpTextMultiCustom(['rrow', 'oins']) then //you can add this uptext check if you don't want to pick up loot you don't want
        begin
          ClickMouse2(mouse_right);   // right click
          Wait(RandomRange(250, 500));
          ChooseOption('ake');        // select Take
        end;

        while (IsMoving = True) do
        begin
          wait(100);
        end;
      end;
    end;

    E: Ninjad

  4. #4
    Join Date
    Mar 2007
    Posts
    393
    Mentioned
    1 Post(s)
    Quoted
    98 Post(s)

    Default

    Quote Originally Posted by RuneDragon View Post

    Calling the CheckLoot procedure while standing on loot stack won't work as.. loot is not visible.

    How do i get the loot ? May be get my current x,y (where my char standing) and click to take loot. If there any function to do that ?

    I've combined this to loot taking procedure... after it doesn't find loot any more - it checks under yout feet:

    Simba Code:
    mmouse(259, 184, 5, 5);
         if IsUpTextMultiCustom(['ssence', 'rrow', 'icket', 'diamo', 'uby', 'Natu', 'Law', 'Coal','oins','ire']) then
        begin
          repeat
          clickmouse2(mouse_left);
          wait(100+random(50));
          until
          not IsUpTextMultiCustom(['ssence', 'rrow', 'icket', 'diamo', 'uby', 'Natu', 'Law', 'Coal']);

  5. #5
    Join Date
    Nov 2011
    Posts
    117
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by Shatterhand View Post
    Why dont you take the item with the first click?
    Check for uptext, if its 'Take' then left click, if its not, right click and choose option 'Take'.
    It take first item it click. But it won't take rest of the items in stack as x,y changed as player moved + they are below players leg.


    Quote Originally Posted by The Mayor View Post
    Why don't you just right click the loot and pick it up that way?

    Simba Code:
    Procedure CheckLoot;
    var
      x, y: Integer;

    begin
      Writeln('CheckLoot');
      if  FindObjCustom(x,y,['ake','Take'],[7414386,7350664,6624140,5640311], 10) then
      begin
        Writeln('FOUND Loot');
        PlaySound('G:\rs\beep.wav');
        MMouse(x,y, 0, 0);
        if IsUpTextMultiCustom(['rrow', 'oins']) then //you can add this uptext check if you don't want to pick up loot you don't want
        begin
          ClickMouse2(mouse_right);   // right click
          Wait(RandomRange(250, 500));
          ChooseOption('ake');        // select Take
        end;

        while (IsMoving = True) do
        begin
          wait(100);
        end;
      end;
    end;

    E: Ninjad
    Thanks @The Mayor, i used some of your code. But we have a stack of items as drop, not just one item. For one item, just clicking on it will work.

    Quote Originally Posted by t4q View Post
    I've combined this to loot taking procedure... after it doesn't find loot any more - it checks under yout feet:

    Simba Code:
    mmouse(259, 184, 5, 5);
         if IsUpTextMultiCustom(['ssence', 'rrow', 'icket', 'diamo', 'uby', 'Natu', 'Law', 'Coal','oins','ire']) then
        begin
          repeat
          clickmouse2(mouse_left);
          wait(100+random(50));
          until
          not IsUpTextMultiCustom(['ssence', 'rrow', 'icket', 'diamo', 'uby', 'Natu', 'Law', 'Coal']);
    @t4q i think this is what i need.

    But it is not working for me. as mouse is not correctly over the loot.

    In my code, i put a big wait after the mmmouse, so i can see the mouse is not over the loot, so i am not getting any uptext.

    Simba Code:
    mmouse(259, 184, 5, 5);
        wait(randomRange(1100,1500));

    I want to read mmmouse documentation to get it exactly over loot

    my current function

    Simba Code:
    Function CheckLoot:Boolean;
    begin
      Writeln('[CheckLoot] START');

      if  FindObjCustom(x,y,['ake','Take'],[7414386,7350664,6624140,5640311, 15000814], 10) then
      begin
        Writeln('[CheckLoot] FOUND Loot');
      //  playSound(ScriptPath  + 'beep.wav');
        MMouse(x,y, 0, 0);
        ClickMouse2(mouse_right);
        Wait(RandomRange(150, 300));
        ChooseOption('ake');

        mmouse(259, 184, 5, 5);

        wait(randomRange(1100,1500));

        if IsUpTextMultiCustom(['Grape', 'rape','ake']) then
        begin
          repeat
          Writeln('[CheckLoot] Taking Loots below you');
          ClickMouse2(mouse_left);
          Wait(RandomRange(150, 300));
          until not IsUpTextMultiCustom(['Grape', 'rape','ake']);
        end;    

        wait(200+ random(100));

      end;

      wait(randomRange(600,900));
      Writeln('[CheckLoot] END');
    end;

    IsUpTextMultiCustom(['Grape', 'rape','ake']) is always return FALSE as "mmouse(259, 184, 5, 5)" is not moving mouse over the loot.
    Last edited by RuneDragon; 05-17-2013 at 11:38 AM.

  6. #6
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    Quote Originally Posted by RuneDragon View Post
    It take first item it click. But it won't take rest of the items in stack as x,y changed as player moved + they are below players leg
    You should check the right click, store the wanted items in a list then click on avatar (make a box for the area and keep right clicking till you find it) for n-1 times (first item is walking there).

    I have a similar method in my fighting script, but it might be a litle bit too complicated.

  7. #7
    Join Date
    Nov 2011
    Posts
    117
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Thank you Shatterhand. That is little complicated for me, too bad at maths

    Now it take most of the drops, but it is bot like, take a grape, kill a guard, run back and take next.. some times it pick all loot, may be some camera angle make it possible.

    I tried your script, but i get some error. I will post it on your thread.

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
  •