Author Topic: [Module] Gumps - Stealth 4.0.3  (Read 7252 times)

0 Members and 1 Guest are viewing this topic.

Offline Crome969Topic starter

  • Moderator
  • *
  • *****
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
[Module] Gumps - Stealth 4.0.3
« on: April 28, 2012, 10:55:33 AM »
0
Module Gumps
Index
  • Purpose
  • How to Use
  • Function Overview
  • Some Examples

Purpose
Gumps 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 Use
To work with Modules you will be needed to copy the attached file into StealthFolder\Scripts\ .
Then write following after initiate the program :
Quote
Uses Gumps;
If you followed these steps right you wont get any Syntax Errors.

Function Overview
Quote
function 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.

Quote
function GetLastSerial():Cardinal;

Returns the Serial (Number of the Gump received from Shard) of Toplayer Gump (Newest)

Quote
function GetLastGumpID():Cardinal;
Returns the GumpID(Static "Type" of Gump) of Toplayer Gump (Newest)

Quote
function GetLastGump():TGumpInfo;
Returns the Toplayer Gump as Object (Newest);

Quote
procedure WaitGumpID(GumpID:Cardinal);
Will wait until Toplayer GumpID is GumpID. On Liveshard it means -> Incoming Packet with GumpID + 1ms delay (Speedy or Not?)

Quote
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?)

Quote
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.
Quote
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".

Quote
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.

Quote
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 ;)

Quote
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 Examples
Crafting a Skirt :
Code: [Select]
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

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
Gumps.pas

Offline b@ndito

  • Jr. Member
  • **
  • Posts: 48
  • Activity:
    0%
  • Reputation Power: 0
  • b@ndito has no influence.
  • Respect: +5
  • Referrals: 0
    • View Profile
Re: [Module] Gumps - Stealth 4.0.3
« Reply #1 on: May 06, 2012, 10:17:21 PM »
0
sounds great, im going to play with some new code asap. thank you crome !

*log the worker character and try*

« Last Edit: May 06, 2012, 10:41:21 PM by b@ndito »

Tags: Stealth Module