ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Burnhazel88 on October 06, 2017, 01:07:11 PM

Title: IgnoreItem Issue
Post by: Burnhazel88 on October 06, 2017, 01:07:11 PM
I'm having an issue with ignoreitem
 
Code: [Select]
   finditem %item_list c_ #BACKPACKID
  while #FINDCNT > 0
  {
    exevent drag #FINDID
    wait 10
    exevent dropc %dropbag
    wait 10
    ignoreitem #FINDID 4
  }
%dropbag is inside backpack and open grabs first item from backpack drops in bag the keeps pulling and dropping same item to and from %dropbag.

what am i missing here. other than caffeine in my veins.
Title: Re: IgnoreItem Issue
Post by: BobOzarius on October 06, 2017, 01:50:21 PM
You can only ignore the item once. If you ignore it twice, you basically unignore it.  ;)  Plus while you're doing your while statement, and ignoring your items, #findcnt isn't changing, because it only changes when you do a finditem... doing a for #findindex 1 #findcnt might be a better solution to your problem.
Title: Re: IgnoreItem Issue
Post by: Burnhazel88 on October 06, 2017, 02:04:13 PM
ok then tried basic goto loop with success but really hate using them .
Code: [Select]
loop1:
 finditem %item_list c_ #BACKPACKID
  if #FINDCNT > 0
  {
    exevent drag #FINDID
    wait 10
    exevent dropc %dropbag
    wait 10
    ignoreitem #FINDID 4
goto loop1
  }
Title: Re: IgnoreItem Issue
Post by: The Ghost on October 06, 2017, 03:10:46 PM

   ignoreitem #FINDID 4   :   the 4 mean that you are going to execute the next 4 line.   Not sure why you have it their.      To ignore snake I only do ignoreitem %snake.   
Title: Re: IgnoreItem Issue
Post by: manwinc on October 06, 2017, 03:22:00 PM
The problem is you aren't doing another finditem after you ignore the item to find another one.

Code: [Select]
   finditem %item_list c_ #BACKPACKID
  while #FINDCNT > 0
  {
    finditem %item_list c_ #BACKPACKID
    exevent drag #FINDID
    wait 10
    exevent dropc %dropbag
    wait 10
    ignoreitem #FINDID 4
  }

Personally i would be using a repeat though to skip that initial finditem before you enter the while.

Code: [Select]
Repeat
Finditem %item_list C_ , #Backpackid
if #Findcnt > 0
  {
    exevent drag #FINDID
    wait 10
    exevent dropc %dropbag
    wait 10
    ignoreitem #FINDID 4
  }
Until #Findcnt <= 0
Title: Re: IgnoreItem Issue
Post by: The Ghost on October 06, 2017, 03:23:57 PM
I love it when Manwinc talk :)   So do we need the 4 in their
Title: Re: IgnoreItem Issue
Post by: manwinc on October 06, 2017, 03:27:21 PM
The 4 Specifies the Index for the Ignored items. This is useful later on when you want to use Ignoreitem Reset to clear out your ignoreitem filter.

Ignoreitem #Findid 4

Ignoreitem Reset 4 <- Unignores all items that were ignored using 4.

This is only really necessary when dealing in things in mass quantity like Looting Corpses.

Title: Re: IgnoreItem Issue
Post by: manwinc on October 06, 2017, 03:29:43 PM
And really what you are doing is no different than doing a for command using #Findindex.


Code: [Select]
   finditem %item_list c_ #BACKPACKID
if #Findcnt > 0
{
  For #Findindex 1 #Findcnt
  {
    exevent drag #FINDID
    wait 10
    exevent dropc %dropbag
    wait 10 
  }
}
Title: Re: IgnoreItem Issue
Post by: The Ghost on October 06, 2017, 03:33:31 PM
And really what you are doing is no different than doing a for command using #Findindex.


   finditem %item_list c_ #BACKPACKID
if #Findcnt > 0
{
  For #Findindex 1 #Findcnt
  {
    exevent drag #FINDID
    wait 10
    exevent dropc %dropbag
    wait 10 
}

Thx that explain alot.    I  use this type lot of mining and ofter drag sub.  I now learn a new way.
Title: Re: IgnoreItem Issue
Post by: manwinc on October 06, 2017, 03:34:31 PM
I somehow tabbed out and it posted too fast, proper number of brackets now :P
Title: Re: IgnoreItem Issue
Post by: BobOzarius on October 07, 2017, 08:52:08 AM
I see how it is. I give the answer and manw gets the credit.  Damn you manw! haha
Title: Re: IgnoreItem Issue
Post by: Burnhazel88 on October 09, 2017, 05:15:01 AM
The problem is you aren't doing another finditem after you ignore the item to

Yeah I saw that later on. I think I just had too many hours in front of the screen. Start over later and it all became clear.

Post Merge: October 09, 2017, 08:29:17 AM
I indexed the items cause later in my script I need to grab them id's again for another task