ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Grandewd on July 25, 2014, 05:14:55 PM

Title: Picking a specific onscreen gump
Post by: Grandewd on July 25, 2014, 05:14:55 PM
Hi all,

First, I apologize if this is a really dumb question - but here goes.  Let's say I have 2 or more gumps currently on screen.  I know their ID's/names/types/etc.
How can I select one of these gumps to use contpos on?   :-[
Title: Re: Picking a specific onscreen gump
Post by: Crisis on July 25, 2014, 07:15:33 PM
I think you can set and name them at the beginning of the script.

Code: [Select]
set %tinkgump 530_497
set %othergump 180_250 ;or whatever size it is

and then call the one you want by name and use the contpos on it.

I may be way wrong too but it is worth a try  ;D
Title: Re: Picking a specific onscreen gump
Post by: Grandewd on July 25, 2014, 09:20:43 PM
I think you can set and name them at the beginning of the script.

Code: [Select]
set %tinkgump 530_497
set %othergump 180_250 ;or whatever size it is

and then call the one you want by name and use the contpos on it.

I may be way wrong too but it is worth a try  ;D

Good thinking, Crisis.... I'll give that a shot.   ;)
Title: Re: Picking a specific onscreen gump
Post by: Crome969 on July 25, 2014, 11:55:55 PM
I think you can set and name them at the beginning of the script.

Code: [Select]
set %tinkgump 530_497
set %othergump 180_250 ;or whatever size it is

and then call the one you want by name and use the contpos on it.

I may be way wrong too but it is worth a try  ;D

As i remember you only can move the onTop Gump. This means you must keep sure that your gump is ontop.

Your snippet doesnt should work in any case because you fill data to a variable and nothing more.
Title: Re: Picking a specific onscreen gump
Post by: manwinc on July 26, 2014, 11:43:10 AM
What Crome Said. If a gump isn't on top with EUO, euo Can't see it. you have to force it to be the last gump opened. 
Title: Re: Picking a specific onscreen gump
Post by: Alpha on July 26, 2014, 04:56:00 PM
If you have multiple gumps open you can only manipulate the focused 1 aka top one.   My quick and dirty fix for this was a subroutine where you input the specifics of the Gump you wanted to focus on focus on and then it would do  a certain number of mouse clicks around your screen looking for that gump.   Say the gump takes up 1/4 of your play area then with 4 clicks you can d focus on that gump or close out other gump covering it etc...
Title: Re: Picking a specific onscreen gump
Post by: Endless Night on July 26, 2014, 08:39:10 PM
easiest way is to open it again.   That makes it the top gump.

Alternatively if you know its location you can click it to maybe make it top gump again.
Title: Re: Picking a specific onscreen gump
Post by: Grandewd on July 27, 2014, 10:38:57 AM
Yes, it's that "top gump" thing that drives me crazy sometimes.
I should have mentioned that the gump I'm trying to focus on is one of the Heartwood Quest givers.  You have to double/click the npc, whereupon you get both the npc's PD and the quest gump (the one I want to position) at the same time.  I know the details of the quest gump, but trying to figure out how to move it.
Title: Re: Picking a specific onscreen gump
Post by: Crisis on July 27, 2014, 10:52:26 AM
Look at TM's heartwood quester and see how he handled the gumps. It may be the best way to figure out how to do it.  ;D

http://www.scriptuo.com/index.php?topic=374.0
Title: Re: Picking a specific onscreen gump
Post by: TrailMyx on July 27, 2014, 11:05:08 AM
Crisis is right, the HW quester gives you a method.  I had to come up with something that would re-focus the correct gump when UO changed the way the HW gump comes up and basically broke the current HW quest script implementation.  It's a TAD slower, but it works well.
Title: Re: Picking a specific onscreen gump
Post by: Grandewd on July 27, 2014, 11:30:26 AM
Yes, I have your Heartwood Quester TM, and will spend more time looking thru it for your method.
Mostly, I am constantly wondering about making sure the proper gump has the focus and ways to do that.
I mean, if the gump is onscreen (with other gumps) and you know all it's properties - then I would think that it would be easy to grab and move it... But sometimes, like this example, it's less than straightforward..
Thank you all for the input.  I do enjoy learning different aspects of UO scripting.....   ;)