[EasyUO] Reading [buffs with EasyUO

Discussion about the technical aspects of scripting. Ask about all issues involving your freelance projects here.
Post Reply
Shindaril
Grandmaster Scribe
Posts: 96
Joined: Tue Jul 01, 2014 12:11 pm

[EasyUO] Reading [buffs with EasyUO

Post by Shindaril »

Hiya,

Time for another incomplete script. This time it's about the [buffs gump and how to get your scripts able to read it. I will only show the principles here. I might do a header file or just a couple of subs for [buffs handling later on, if I find a need for those on my own projects.

First off, as you might have noticed, the [buffs gump is a fixed layout container, it can be accessed like any other container in the game. It's hidden and located on your paperdoll, so you will need to have your paperdoll open for EasyUO to be able to find the [buffs container.

Secondly, the [buffs container's ItemType is CKF, so searching for CKF in open paperdoll finds the [buffs container's ItemID.

And lastly, you have to have the [buffs container open to find what's inside it. For example, regen rates are stored in an item with type of JNJ while hunger is stored inside MGG type item. You can use any item id finding tool to find the rest types. But the difference is, if a buff is active and listed in the [buffs, it's type can be found while non-active buffs cannot. Where hunger and regens can always be found, it's their #Property that's interesting to us, should we need the values.

Here's a short and simple example on how to do this in practice:

Code: Select all

set %BuffType CKF
set %RegenType JNJ
set %HungerType MGG
set %ProtectionType NQD

event macro 8 1
event macro 1 0 [buffs
wait 10
finditem %BuffType C_ , #CharID
if #FindKind <> -1
{
    set %Buffs #FindID
    finditem %RegenType C_ , %Buffs
    if #FindKind <> -1
    {
        event Property #FindID
        display ok #Property
    }
    finditem %HungerType C_ , %Buffs
    if #FindKind <> -1
    {
        event Property #FindID
        display ok #Property
    }
    finditem %ProtectionType C_ , %Buffs
    if #FindKind <> -1
    {
        display ok Protection Spell is on
    }
}
halt
Post Reply