Module GumpsIndex- Purpose
- How to Use
- Function Overview
- Some Examples
PurposeGumps are a major theme for every Coder. In Easyuo you may thought "oh those are hard to handle" but you could not say this for Stealth. Coming up with Version 4.0.3 you will have the Opportunity to work with Gumps like regular Objects.
You can find an Overview about
Here.
How to UseTo work with Modules you will be needed to copy the attached file into StealthFolder\Scripts\ .
Then write following after initiate the program :
Uses Gumps;
If you followed these steps right you wont get any Syntax Errors.
Function Overviewfunction CountGumps():Integer;
Returns the Amount of Opened Gumps. Since they Start with 0 and end with Amount - 1 i simple wrote this function to avoid Problems by Users for trying functions out of range.
function GetLastSerial():Cardinal;
Returns the Serial (Number of the Gump received from Shard) of Toplayer Gump (Newest)
function GetLastGumpID():Cardinal;
Returns the GumpID(Static "Type" of Gump) of Toplayer Gump (Newest)
function GetLastGump():TGumpInfo;
Returns the Toplayer Gump as Object (Newest);
procedure WaitGumpID(GumpID:Cardinal);
Will wait until Toplayer GumpID is GumpID. On Liveshard it means -> Incoming Packet with GumpID + 1ms delay (Speedy or Not?)
procedure WaitSerial(Serial:Cardinal);
Will Wait until Toplayer Serial is no Longer Serial. On Liveshard it means -> Incoming Packet with new Serial + 1ms delay (Speedy or Not?)
procedure ClickButton(ButtonValue:Integer;GumpID:Cardinal;UseWait:Boolean);
Its an extension to "WaitGump" from Stealth. Will convert the ButtonValue to String and send it to Server. You need to set a GumpID (0 if you wanna skip but you will need to fill anything if you wait or not) and modify the UseWait. If UseWait is False it will skip Waiting for new Serial and the GumpID. Else it will use "WaitGumpID" and "WaitSerial" from Module for waiting.
procedure ClickObject(ObjectID:Integer;GumpID:Cardinal;UseWait:Boolean);
Similar to "ClickButton" but using ObjectID instead of Packet (NPC,Items as example) to get a gump. Options are same then "ClickButton".
ClickClilocButton(Cliloc:Integer;RangeX,RangeY:Integer;GumpID:Cardinal;UseWait:Boolean);
This function is special. Do you Remember Craft Buttons? Did you ever wanted to make those stuff dynamicly? If you want to click the button left of a text you can use this function. Cliloc means the ID of the Text(Server sends Cliloc and Client reads Text). This means no matter wich languange you will be able to click the button in left of Text.
RangeX and RangeY is the Range from TextStart. So if Button is +- 40 pixel from Text.X Range X will be 40 and when Button +- pixel from TextY and both is true then it will click this Button. Please be Aware that if you make a big range it "may " click the wrong Button. On my Runuo Example Buttons were about 35,3 from Text. So no other Button were be found in this Range and it were 100% recognized.
GumpID and UseWait are Similar to "ClickButton". It uses Clickbutton if recognize the Button.
procedure CloseGump(Simple:Boolean);
Want to Close a Gump? Some Gumps can be closed by rightclick (then Simple = true) or need to be forced by packet (Simple = false). Gump will Close and wait until Serial Changed again.
procedure ClickTileButton(TileArt:Integer;GumpID:Cardinal;UseWait:Boolean);
This function is an alternate to ClickButton. If your Button has a unique Design (Heartwooquests like Accept,Close,Refuse) you can click the Button for Searching the TileArt. Tilearts are like Clilocs. Server sends a number and Client reads the Button from files. It will check if TileArt is pressed or released as Button and use the "ClickButton" with the Value of the Button. Perfect for Heartwood

function SearchClilocText(Cliloc:Integer):Boolean;
Simple function to Compare Texts in Gumps by using Cliloc.
Will check all Cliloc Texts and return true if exist and false if not. (Heartwood Questlog as example)
Some ExamplesCrafting a Skirt :
program test;
Uses Gumps;
begin
ClickObject($400005C7,$77567887,true);
ClickClilocButton(1015279,35,3,$77567887,true)
ClickClilocButton(1025398,35,3,$77567887,true);
CloseGump(false);
end.
Replace $400005C7 with ID of your Tool (Sewing Kit). Will Craft you a Skirt once

Enjoy