ISXEQ:switch (Data Type)

From ISMods Wiki

Contents

Description

Does the same thing as Case Select does in Visual Basic. You creat a group of choices and select from them based on matches found.

Members

Methods

Returns

Examples

LazyMage
contains the following example of a switch (thanks to Lax for helping with this)
the string is the invslot ID of an item in inventory. As you can see, it looks computes a number between 25 and 32, which is not a bag inventory slot, but uses that number to decide which bag to pick.
To get a better idea of it in use, look at the function MoveFood in the linked script.

        switch ${Math.Calc[(${PickItUp}-1)/10].Int}
        {
        case 25
           ThisBag:Set[22]
           break
        case 26
           ThisBag:Set[23]
           break
        case 27
           ThisBag:Set[24]
           break
        case 28
           ThisBag:Set[25]
           break
        case 29
           ThisBag:Set[26]
           break
        case 30
           ThisBag:Set[27]
           break
        case 31
           ThisBag:Set[28]
           break
        case 32
           ThisBag:Set[29]
           break
        }

See Also