ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Nuscheltier on October 26, 2014, 12:56:07 PM

Title: Finding an item by an atribute and not its ID
Post by: Nuscheltier on October 26, 2014, 12:56:07 PM
Hi there,

I know this must be a trivial thing for you, but I couldnt find the command for it

I would like to just take out major and legendary artifacts of the corpses (as it is possible to do with trailmixs autolooter) with a simple gold looter script. However this script only allows to define the items by their three letter code...

what command do I need here ?

thx alot!
Title: Re: Finding an item by an atribute and not its ID
Post by: NObama on October 26, 2014, 12:56:39 PM
#property and parse the string.
Title: Re: Finding an item by an atribute and not its ID
Post by: Nuscheltier on October 26, 2014, 01:41:51 PM
ok thank you :) but what do you mena by parse the string ? isnt it possible to just set the property in the "set %LootTypes POF"instead of the findID ?

Title: Re: Finding an item by an atribute and not its ID
Post by: Crome969 on October 27, 2014, 05:50:35 AM
ok thank you :) but what do you mena by parse the string ? isnt it possible to just set the property in the "set %LootTypes POF"instead of the findID ?

Event Property (http://wiki.easyuo.com/index.php?title=Event_Property) saves the Tooltip Data of an Item to #Property. For Linebreaks it uses $.
So an Item wich would be like :

MyItem
SUPERARTIFACT
Weight : 0

would be "MyItem $ SUPERARTIFACT $ Weight : 0".
In the World of development, this is called a String ( a Chain of Characters) and parsing describes to transform informations into suitable informations. In your case you need a suiteable method to check if "SUPERARTIFACT" is in the #Property after you used the Event Property onto it. You could look onto : http://www.easyuo.com/forum/viewtopic.php?f=2&t=4564&start=0

This is now almost only theory, iam out of euo scripting since 4 years
Title: Re: Finding an item by an atribute and not its ID
Post by: Nuscheltier on October 27, 2014, 06:00:08 AM
hi,

cheers for your answer, however until I would be able to write this sub and implement it into my goldlooter script, the haloween event would be over :) thanks anyway


Title: Re: Finding an item by an atribute and not its ID
Post by: Crome969 on October 27, 2014, 06:28:29 AM
hi,

cheers for your answer, however until I would be able to write this sub and implement it into my goldlooter script, the haloween event would be over :) thanks anyway




Code: [Select]
Sub IsHalloweenArtifact
event property %1
if artifact in #property 1
return #true
return #false

Snippet
Code: [Select]

IsHalloweenArtifact TESTID
if #Result = true
{
  ;run lootcode
}
else
{
 ;ignore
}


Untested but that could be your direction


Title: Re: Finding an item by an atribute and not its ID
Post by: Nuscheltier on October 27, 2014, 06:39:39 AM
I actually understand your code :o (at least that :) )

However I cant implement it in the script I use, because it seems as the sub for looting the gold and open the corpse are one and the same, so if I do another loop for looting the script will have allready closed the corpse

thx anyways
Title: Re: Finding an item by an atribute and not its ID
Post by: The Ghost on October 27, 2014, 11:09:38 AM
The Doom artifact drop on your mainpack.   If you are trying to loot every Major artifact, will will loot lot of them.   I'm sure TM lotter can set  string to loot like
MR 3 && LCR 10  Not cursed. 

If you want to loot all the corpse  U can try OpenUO.  Kal Ex have one that empty the corpse in sec ok 5 sec and put it in bag.   
Title: Re: Finding an item by an atribute and not its ID
Post by: Nuscheltier on October 27, 2014, 12:05:44 PM
Hi there

well its not about the artis that drop into your backpack, its more about the lesser, greater, major and legendary artis. I tried trailMyx auto looter for that, but that leads to crashes about every 5 minutes becasue it seems not to be able to handle the tons of corpses in the guardian room...

cheers, Nuscheltier
Title: Re: Finding an item by an atribute and not its ID
Post by: TrailMyx on October 27, 2014, 12:27:38 PM
Most looters need you to stand still a bit until the looter is finished doing its thing.  Once you get into a rhythm, then the crashing will drop to nearly 0.  Just don't fight it.
Title: Re: Finding an item by an atribute and not its ID
Post by: The Ghost on October 27, 2014, 12:46:21 PM
I wil have to assume that you ar running two script.
1) that Tm looter
2) auto attack

It that correct, your autoattack make the autolooter crash because you are trying to perform an action and interfer with the loorter.   I had the same problem until a someone point that fact to me.  Now I don't crash anymore. 
Title: Re: Finding an item by an atribute and not its ID
Post by: TrailMyx on October 27, 2014, 12:53:58 PM
I wil have to assume that you ar running two script.
1) that Tm looter
2) auto attack

It that correct, your autoattack make the autolooter crash because you are trying to perform an action and interfer with the loorter.   I had the same problem until a someone point that fact to me.  Now I don't crash anymore. 

There is a busy status indicator built into the looter that can be used to make any script play nicely with it.  Look through the CLAw thread to see information about TM_loot_in_progress.  Here's the code you can put into your code to basically wait until the looter is free:

Code: [Select]
  repeat
    namespace copy TM_loot_in_progress from global TM_loot
  until !TM_loot_in_progress <> #TRUE
Title: Re: Finding an item by an atribute and not its ID
Post by: Nuscheltier on October 27, 2014, 01:08:32 PM
Yes indeed, Im running an autotargeter...

so should I put this code line at the end of my autotargeter ?

thank you !!
Title: Re: Finding an item by an atribute and not its ID
Post by: TrailMyx on October 27, 2014, 01:22:16 PM
Put the code in the autotarget script so that it prevents it from running if the CLAw is busy.  Probably in the main loop somewhere right before you target something.
Title: Re: Finding an item by an atribute and not its ID
Post by: TrailMyx on October 27, 2014, 03:01:39 PM
If you want to have even finer control over the CLAw, you can turn it on and off:

To turn it off:
Code: [Select]
 set !TM_loot_enable #FALSE
  namespace copy TM_loot_enable to global TM_loot

To turn it on:
Code: [Select]
 set !TM_loot_enable #TRUE
  namespace copy TM_loot_enable to global TM_loot

Don't forget to turn it back on.. ;)