/Useitem

Discussion in 'E3' started by Hive, Jan 26, 2019.

  1. Hive

    Hive Froglok Krup Watcher

    Messages:
    340
    I can't find the /Useitem event in the newest E3. Was it left out on purpose? If anyone has the code for the event I'd love to use it.

    Thanks.
    EDIT: spelling
     
    Last edited: Jan 26, 2019
  2. YirranPEQ

    YirranPEQ Orc Pawn

    Messages:
    39
    Here's the sub from e3 5.1 for underfoot if you can't get another version from rof2. I haven't tried this so if may require some tweaking.

    #EVENT useItem "[MQ2] Use Item #1#"
    SUB EVENT_useItem(line, itemToUse)
    /if (${Debug} || ${Debug_Basics}) /echo |- EVENT_useItem ==>

    /if (${Bool[${Cursor}]}) /call ClearCursor

    :TryAgain
    | if I cant find the item
    /if (!${FindItemCount[=${itemToUse}]}) {

    | check ini for an alias
    /if (${Ini[${Character_Ini},Use Items,${itemToUse}].Length}) {
    /varset itemToUse ${Ini[${Character_Ini},Use Items,${itemToUse}]}
    /goto :TryAgain
    } else {
    /echo Could not find [${itemToUse}].
    }
    } else {

    | check item timers
    /if (${FindItem[=${itemToUse}].Timer} || ${itemTimer_${FindItem[=${itemToUse}].ID}}) {
    /echo [${itemToUse}] is not ready! [${If[${FindItem[=${itemToUse}].Timer},${FindItem[=${itemToUse}].Timer} ticks,${Math.Calc[${itemTimer_${FindItem[=${itemToUse}].ID}}/10].Int} sec]}]
    } else {

    | cast the item
    /if (${Me.Casting.ID}) /call Interrupt
    /if (${Cursor.ID}) /call clearCursor
    /if (${Target.ID}) /declare oldTarget int local ${Target.ID}

    /call e3_Cast ${Me.ID} "${itemToUse}" item
    /if (${oldTarget}) /call TrueTarget ${oldTarget}
    }
    }

    /if (${Debug} || ${Debug_Basics}) /echo <== EVENT_useItem -|
    /RETURN



    /Cheers
     
    • Agree Agree x 1
  3. mackal

    mackal Pyrilen Fireblade

    Messages:
    2,267
    MQ2 has a built in /useitem, don't alias to it.
     
  4. Hive

    Hive Froglok Krup Watcher

    Messages:
    340
    I didn't change my alias and it's just
    Code:
    /useitem=/useitem
    I want to be able to give items a name and then /useitem name, like with shrink items, or coa bp clicks.
    Creamo had this in his samples
    Code:
    [Use Items]
    Shrink=Bracelet of the Shadow Hive
     
  5. cream

    cream GM Staff Member

    Messages:
    239
    thats legacy stuff. you can just directly create a mq alias, or a hotkey

    upload_2019-5-31_7-54-35.png
     
  6. clippy

    clippy A Griffin

    Messages:
    229
    Sorry for necroing an old thread, but recently found myself wishing for this to work.

    the older e3 functionality seem to have allowed you to set up an per-character alias, such as

    on my ogre shd:
    [Use Items]
    Shrink=Wand of Imperceptibility

    on my ogre war:
    [Use Items]
    Shrink=Cobalt Bracer


    and then just "/useitem Shrink" to shrink my ogres