ScriptUO

Scripting Resources & Utilities => Orion UO Client => Topic started by: The Ghost on May 24, 2022, 09:00:28 PM

Title: MoveItemType
Post by: The Ghost on May 24, 2022, 09:00:28 PM
So trying to make little function once again and can't seen to figure that one out.   
I can move items from a bag to my backpack , I decide to move items from backpack to bag and that didn't go well.


function EggToBag()  :  Do not work, getting Error online 25  Orion.MoveItem.     I'm sure it a little mistake so anyone can point me to the right direction.


Code: [Select]
var eggbag = "0x413DB0DD"

function EggToBackpack()
    {
    while(true)
        {
        var egg = Orion.FindTypeEx('0x9F13|0x9F14|0x9F15|0x9F16|0x9F17|0x9F18', any, eggbag, '', 24)[0];
        if(egg)
            {
               Orion.MoveItem(egg.Serial());
          Orion.Wait(500);     
            }
        Orion.Wait(500);
        }
    }

   function EggToBag()
    {
    while(true)
        {
        var egg = Orion.FindTypeEx('0x9F13|0x9F14|0x9F15|0x9F16|0x9F17|0x9F18', any, 'backpack', '', 24)[0];
        if(egg)
            {
           Orion.MoveItem(eggbag.Serial());
          Orion.Wait(500);     
            }
        Orion.Wait(500);
        }
    }
   
Title: Re: MoveItemType
Post by: altiric on May 24, 2022, 09:37:02 PM
MoveItem needs a count and destination

Orion.MoveItem(egg.Serial(), 0, container.Serial); 

0 will move all in a stack, or use a number to move up to that amount, since its just an egg 1 will work the same since they don't stack.

Title: Re: MoveItemType
Post by: The Ghost on May 25, 2022, 06:28:49 AM
Nice,  That make lot of sense.  That remove the error.
Now trying to figure why it grab the egg and drop it in my backpack.
 
Title: Re: MoveItemType
Post by: altiric on May 25, 2022, 10:58:38 AM
Maybe try MoveItemType as an alternative, see if it works better for you.

Orion.MoveItemType('graphic', 'color', 'containerFrom', count, 'container'); //Can add multiple graphics as usual seperating with |
Title: Re: MoveItemType
Post by: The Ghost on May 25, 2022, 03:57:32 PM
WoW would though that a simple function will take so most of my time.    wasted 6 hrs coding 6 lines to move those damm egg to bag.  still no joy :(     My head hurt, so time to do something lucrative. 

Title: Re: MoveItemType
Post by: altiric on May 27, 2022, 01:25:13 AM
If it helps, this is one i wrote for a friend to do the same thing.

Quote
function moveEggsToContainer(){
    var eggTypes = '0x9F13|0x9F14|0x9F15|0x9F16|0x9F17|0x9F18';
    Orion.CharPrint(self, 0x43, "Select new Egg Container");
    Orion.WaitForAddObject('eggContainer');
    Orion.FindType(eggTypes, any, backpack).forEach(function(egg){
        Orion.MoveItem(egg, 0, 'eggContainer');
        Orion.Wait('moveitemdelay');
    });
    Orion.CharPrint(self, 0x43, "Move Complete");
}
Title: Re: MoveItemType
Post by: The Ghost on May 27, 2022, 04:13:49 PM
nice,    All this make sense,   Let see if I can use it.

not a plug and play.
Got an error, referenceerror   Can't find variable: moveitem

Let see if I can use that nice function and make it work :0 
Title: Re: MoveItemType
Post by: altiric on May 27, 2022, 04:58:42 PM
yeah... just throw an Orion. infront of MoveItem lol sorry...
Title: Re: MoveItemType
Post by: The Ghost on May 27, 2022, 07:29:16 PM
How did I miss that,   Thx, 
This little function is a great example. I can really see the similarity of a sub here.   
Title: Re: MoveItemType
Post by: Black Widow on September 10, 2023, 02:19:26 PM
Thanks for the awesome input @The Ghost and @Altric