Gumps

The Gumps class is used to read and interact with in-game gumps, via scripting. NOTE ---- During development of scripts that involves interacting with Gumps, is often needed to know gumpids and buttonids. For this purpose, can be particularly useful to use *Inspect Gumps* and *Record*, top right, in the internal RE script editor.

Table of Contents

Methods

AddAlphaRegion

Syntax: Gumps.AddAlphaRegion(gd, x, y, width, height)
Parameters:
  • gd (Gumps.GumpData&@)
  • x (Int32)
  • y (Int32)
  • width (Int32)
  • height (Int32)
Returns: Void

AddBackground

Syntax: Gumps.AddBackground(gd, x, y, width, height, gumpId)
Parameters:
  • gd (Gumps.GumpData&@)
  • x (Int32)
  • y (Int32)
  • width (Int32)
  • height (Int32)
  • gumpId (Int32)
Returns: Void

AddButton

Syntax: Gumps.AddButton(gd, x, y, normalID, pressedID, buttonID, type, param)
Parameters:
  • gd (Gumps.GumpData&@)
  • x (Int32)
  • y (Int32)
  • normalID (Int32)
  • pressedID (Int32)
  • buttonID (Int32)
  • type (Int32)
  • param (Int32)
Returns: Void

AddCheck

Syntax: Gumps.AddCheck(gd, x, y, inactiveID, activeID, initialState, switchID)
Parameters:
  • gd (Gumps.GumpData&@)
  • x (Int32)
  • y (Int32)
  • inactiveID (Int32)
  • activeID (Int32)
  • initialState (Boolean)
  • switchID (Int32)
Returns: Void

AddGroup

Syntax: Gumps.AddGroup(gd, group)
Parameters:
  • gd (Gumps.GumpData&@)
  • group (Int32)
Returns: Void

AddHtml

Syntax: Gumps.AddHtml(gd, x, y, width, height, text, background, scrollbar)
Parameters:
  • gd (Gumps.GumpData&@)
  • x (Int32)
  • y (Int32)
  • width (Int32)
  • height (Int32)
  • text (String)
  • background (Boolean)
  • scrollbar (Boolean)
Returns: Void

AddHtmlLocalized

Syntax: Gumps.AddHtmlLocalized(gd, x, y, width, height, number, args, color, background, scrollbar)
Parameters:
  • gd (Gumps.GumpData&@)
  • x (Int32)
  • y (Int32)
  • width (Int32)
  • height (Int32)
  • number (Int32)
  • args (String)
  • color (Int32)
  • background (Boolean)
  • scrollbar (Boolean)
Returns: Void

AddImage

Syntax: Gumps.AddImage(gd, x, y, gumpId, hue)
Parameters:
  • gd (Gumps.GumpData&@)
  • x (Int32)
  • y (Int32)
  • gumpId (Int32)
  • hue (Int32)
Returns: Void

AddImageTiled

Syntax: Gumps.AddImageTiled(gd, x, y, width, height, gumpId)
Parameters:
  • gd (Gumps.GumpData&@)
  • x (Int32)
  • y (Int32)
  • width (Int32)
  • height (Int32)
  • gumpId (Int32)
Returns: Void

AddImageTiledButton

Syntax: Gumps.AddImageTiledButton(gd, x, y, normalID, pressedID, buttonID, type, param, itemID, hue, width, height, localizedTooltip)
Parameters:
  • gd (Gumps.GumpData&@)
  • x (Int32)
  • y (Int32)
  • normalID (Int32)
  • pressedID (Int32)
  • buttonID (Int32)
  • type (Gumps.GumpButtonType)
  • param (Int32)
  • itemID (Int32)
  • hue (Int32)
  • width (Int32)
  • height (Int32)
  • localizedTooltip (Int32)
Returns: Void

AddItem

Syntax: Gumps.AddItem(gd, x, y, itemID, hue)
Parameters:
  • gd (Gumps.GumpData&@)
  • x (Int32)
  • y (Int32)
  • itemID (Int32)
  • hue (Int32)
Returns: Void

AddLabel

Syntax: Gumps.AddLabel(gd, x, y, hue, text)
Parameters:
  • gd (Gumps.GumpData&@)
  • x (Int32)
  • y (Int32)
  • hue (Int32)
  • text (String)
Returns: Void

AddLabelCropped

Syntax: Gumps.AddLabelCropped(gd, x, y, width, height, hue, text)
Parameters:
  • gd (Gumps.GumpData&@)
  • x (Int32)
  • y (Int32)
  • width (Int32)
  • height (Int32)
  • hue (Int32)
  • text (String)
Returns: Void

AddPage

Syntax: Gumps.AddPage(gd, page)
Parameters:
  • gd (Gumps.GumpData&@)
  • page (Int32)
Returns: Void

AddRadio

Syntax: Gumps.AddRadio(gd, x, y, inactiveID, activeID, initialState, switchID)
Parameters:
  • gd (Gumps.GumpData&@)
  • x (Int32)
  • y (Int32)
  • inactiveID (Int32)
  • activeID (Int32)
  • initialState (Boolean)
  • switchID (Int32)
Returns: Void

AddSpriteImage

Syntax: Gumps.AddSpriteImage(gd, x, y, gumpId, spriteX, spriteY, spriteW, spriteH)
Parameters:
  • gd (Gumps.GumpData&@)
  • x (Int32)
  • y (Int32)
  • gumpId (Int32)
  • spriteX (Int32)
  • spriteY (Int32)
  • spriteW (Int32)
  • spriteH (Int32)
Returns: Void

AddTextEntry

Syntax: Gumps.AddTextEntry(gd, x, y, width, height, hue, entryID, initialText)
Parameters:
  • gd (Gumps.GumpData&@)
  • x (Int32)
  • y (Int32)
  • width (Int32)
  • height (Int32)
  • hue (Int32)
  • entryID (Int32)
  • initialText (String)
Returns: Void

AddTooltip

Syntax: Gumps.AddTooltip(gd, cliloc, text)
Parameters:
  • gd (Gumps.GumpData&@)
  • cliloc (Int32)
  • text (String)
Returns: Void

AllGumpIDs

Syntax: Gumps.AllGumpIDs()
Returns: List[UInt32]

CloseGump

Syntax: Gumps.CloseGump(gumpid)

Close a specific Gump.

Parameters:
  • gumpid (UInt32): ID of the gump
Returns: Void

CreateGump

Syntax: Gumps.CreateGump(movable, closable, disposable, resizeable)

Creates an initialized GumpData structure

Parameters:
  • movable (Boolean): allow the gump to be moved
  • closable (Boolean): allow the gump to be right clicked to close
  • disposable (Boolean): allow the gump to be disposed (beats me what it does)
  • resizeable (Boolean): allow the gump to be resized
Returns: Gumps.GumpData

CurrentGump

Syntax: Gumps.CurrentGump()

Return the ID of most recent, still open Gump.

Returns: UInt32

GetGumpData

Syntax: Gumps.GetGumpData(gumpid)
Parameters:
  • gumpid (UInt32)
Returns: Gumps.GumpData

GetGumpRawLayout

Syntax: Gumps.GetGumpRawLayout(gumpid)

Get the Raw layout (definition) of a specific gumpid

Parameters:
  • gumpid (UInt32)
Returns: String

GetGumpText

Syntax: Gumps.GetGumpText(gumpid)

Get the Text of a specific Gump. It is the cliloc translation of the #s in the gump

Parameters:
  • gumpid (UInt32)
Returns: List[String]

GetLine

Syntax: Gumps.GetLine(gumpId, line_num)

Get a specific DATA line from the gumpId if it exists. Filter by line number. The textual strings are not considered

Parameters:
  • gumpId (UInt32): gump id to get data from
  • line_num (Int32): Number of the line.
Returns: String

GetLineList

Syntax: Gumps.GetLineList(gumpId, dataOnly)

Get all text from the specified Gump if still open

Parameters:
  • gumpId (UInt32): gump id to get data from
  • dataOnly (Boolean)
Returns: List[String]

GetTextByID

Syntax: Gumps.GetTextByID(gd, id)
Parameters:
  • gd (Gumps.GumpData)
  • id (Int32)
Returns: String

HasGump

Syntax: Gumps.HasGump(gumpId)

Get status if have a gump open or not.

Parameters:
  • gumpId (UInt32)
Returns: Boolean

IsValid

Syntax: Gumps.IsValid(gumpId)

Validates if the gumpid provided exists in the gump file

Parameters:
  • gumpId (Int32): The id of the gump to check for in the gumps.mul file
Returns: Boolean

LastGumpGetLine

Syntax: Gumps.LastGumpGetLine(line_num)

Get a specific line from the most recent and still open Gump. Filter by line number. The text constants on the gump ARE included in indexing

Parameters:
  • line_num (Int32): Number of the line.
Returns: String

LastGumpGetLineList

Syntax: Gumps.LastGumpGetLineList()

Get all text from the most recent and still open Gump.

Returns: List[String]

LastGumpRawLayout

Syntax: Gumps.LastGumpRawLayout()

Get the raw layout (definition) of the most recent and still open Gump.

Returns: String

LastGumpTextExist

Syntax: Gumps.LastGumpTextExist(text)

Search for text inside the most recent and still open Gump.

Parameters:
  • text (String): Text to search.
Returns: Boolean

LastGumpTextExistByLine

Syntax: Gumps.LastGumpTextExistByLine(line_num, text)

Search for text, in a spacific line of the most recent and still open Gump.

Parameters:
  • line_num (Int32): Number of the line.
  • text (String): Text to search.
Returns: Boolean

LastGumpTile

Syntax: Gumps.LastGumpTile()

Get the list of Gump Tile (! this documentation is a stub !)

Returns: List[Int32]

ResetGump

Syntax: Gumps.ResetGump()

Clean current status of Gumps.

Returns: Void

SendAction

Syntax: Gumps.SendAction(gumpid, buttonid)

Send a Gump response by gumpid and buttonid.

Parameters:
  • gumpid (UInt32): ID of the gump.
  • buttonid (Int32): ID of the Button to press.
Returns: Void

SendAdvancedAction

Syntax: Gumps.SendAdvancedAction(gumpid, buttonid, inSwitches, textlist_id, textlist_str)

Send a Gump response, with gumpid and buttonid and advanced switch in gumps. This function is intended for more complex Gumps, with not only Buttons, but also Switches, CheckBoxes and Text fileds. This method can also be used only Text fileds, without Switches. This method can also be used only Switches, without Text fileds.

Parameters:
  • gumpid (UInt32)
  • buttonid (Int32)
  • inSwitches (List[Int32])
  • textlist_id (List[Int32])
  • textlist_str (List[String])
Returns: Void

SendGump

Syntax: Gumps.SendGump(gumpid, serial, x, y, gumpDefinition, gumpStrings)

Sends a gump using an existing GumpData structure

Parameters:
  • gumpid (UInt32)
  • serial (UInt32)
  • x (UInt32)
  • y (UInt32)
  • gumpDefinition (String)
  • gumpStrings (List[String])
Returns: Void

WaitForGump

Syntax: Gumps.WaitForGump(gumpid, delay)

Waits for a specific Gump to appear, for a maximum amount of time. If gumpid is 0 it will match any Gump.

Parameters:
  • gumpid (UInt32): ID of the gump. (0: any)
  • delay (Int32): Maximum wait, in milliseconds.
Returns: Boolean