Author Topic: Click Gump Size? Or whatever.  (Read 4779 times)

0 Members and 1 Guest are viewing this topic.

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +57
  • Referrals: 1
    • View Profile
Click Gump Size? Or whatever.
« on: November 24, 2009, 03:38:44 AM »
0
Okay, moving gumps piss me off!

Someone mentioned to me to use the WINDOW size and not a position on the screen.  So it always targets the x/y on the gump only.  Doing this by recording the button locations on the gump while its at 0/0 x/y.

I can do that easy.  Here is my question and remember I am still a newb kinda.

How do I setup the script to click those locations on the gump window only?

Can someone explain this to me in very slow simple terms?

set %cgumpsize 100 100

and clicks would be something like

click %cgumpsiz %cgumpx %cgumpy ?

I dont know, but I dont wanna contpos 50 50 every single sub for a gump.  I could really use some help here.
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: Click Gump Size? Or whatever.
« Reply #1 on: November 24, 2009, 04:39:31 AM »
0
Actually, I would suggest the opposite. You never use screen coordinates for the gump, you want to use #gumpposx and #gumpposy - these coordinates mark the upper, lefthand corner of said gump. Your click locations should always be #gumpposx + number and #gumpposy + number. this way it doesn't matter where the gump lands. This is why you will find gump wait and gump click subs in most reputable scripter's scripts, you would typically sub the clicking like:

Code: [Select]
gosub GumpClick 50 50

sub Gumpclick
   set %clickx #contposx + %1
   set %clicky #contposy + %2
   click %clickx %clicky
return

XII
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +57
  • Referrals: 1
    • View Profile
Re: Click Gump Size? Or whatever.
« Reply #2 on: November 24, 2009, 05:00:14 AM »
0
so it would basicly be if click last were at 325 400 look like this with gumpwait

Code: [Select]
gosub gumpwait
gosub gumpclick 325 400

sub Gumpclick
   set %clickx #contposx + %1
   set %clicky #contposy + %2
   click %clickx %clicky
return

And the two sets are actually gosub gumpclick 350 (set %clickx #contposx + %1) 400 (set %clicky #contposy + %2)

setclickx setting 350 click on the contain position 1% is the number I input in the call in this case 325? And %2 is the second number, in this case 400?
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: Click Gump Size? Or whatever.
« Reply #3 on: November 24, 2009, 05:03:56 AM »
0
I once had the ultimate tutorial on gump usage. Pictures showing a gump with measurements to show you exactly whats going on.

That was on another forum, one run by a twit who shut the doors one day and deleted a TON of useful information.

If I have some time over the holiday I'll recreate that tutorial.

Gosub a gump waiting sub, make sure you include what size the gump is that your waiting for. And some gump waits have a timeout.

Then gosub that clicker, which tells UO to click at that location relative to that particular gump
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +57
  • Referrals: 1
    • View Profile
Re: Click Gump Size? Or whatever.
« Reply #4 on: November 24, 2009, 05:13:21 AM »
0
I once had the ultimate tutorial on gump usage. Pictures showing a gump with measurements to show you exactly whats going on.

That was on another forum, one run by a twit who shut the doors one day and deleted a TON of useful information.

If I have some time over the holiday I'll recreate that tutorial.

Gosub a gump waiting sub, make sure you include what size the gump is that your waiting for. And some gump waits have a timeout.

Then gosub that clicker, which tells UO to click at that location relative to that particular gump

The ultimate goal I am trying to do here is place the following subs in one file for universal use...

gumpwait
cursorwait
gumpclick

I think that would be great for scripters who are learning, such as myself and other.  Plus those are redundant subs used in a ton of scripts.
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: Click Gump Size? Or whatever.
« Reply #5 on: November 24, 2009, 07:10:46 AM »
0
so it would basicly be if click last were at 325 400 look like this with gumpwait

Code: [Select]
gosub gumpwait
gosub gumpclick 325 400

sub Gumpclick
   set %clickx #contposx + %1
   set %clicky #contposy + %2
   click %clickx %clicky
return

And the two sets are actually gosub gumpclick 350 (set %clickx #contposx + %1) 400 (set %clicky #contposy + %2)

setclickx setting 350 click on the contain position 1% is the number I input in the call in this case 325? And %2 is the second number, in this case 400?
Well I think I understand what you are driving at and, basically yes. If you are thinking of Gump basics they have a name, a size, and sometimes locations within them that you want to click something or place something.

Your basic logic would be something like:

Use item
Wait for the gump
When gump is open
   Do something

When "Do Something" is to click a button within a menu then you sometimes have to wait for the gump again or sometimes you don't.

When you are waiting for the gump you need logic to tell the code what you are waiting for - ie, a gump name or gump size. Preferably you will use both of these as there are a lot of gumps with the same gump name for example.

As for creating a set of subs, these do already exist however don't let that stop you! You want a Gump Wait and a  Click sub. Make sure your Gump Wait takes in criteria for what gump you are waiting for and the Click takes in your Click coordinates.

Hey Cerv, some of those tutorials can still be pulled out of the internet archive. Not all but some. If I remember correctly C2's old Menu tutorial is still out there. We'll have to see what else is there ;)

X
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline Paulonius

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Click Gump Size? Or whatever.
« Reply #6 on: November 24, 2009, 07:51:54 AM »
0
Cor, Look in "Script Snippets" and download TM's Offset Click Finder.  It has a gump click sub posted with it and you can use it to find the correct values to send to the gump click sub.  You can go through all of your gump using scripts and replace the coordinate clicks with gump clicks that roll through the gumpclick sub. Its really easy to use and will make sense in two minutes with your experience finding click coords.
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: Click Gump Size? Or whatever.
« Reply #7 on: November 24, 2009, 07:53:21 AM »
0
Yeah that one is a nice snippet.

Alternatively, you can line up you gump using #gumpposx/y to 0/0 then look at your cursor position when you hover over your location.

X
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline Paulonius

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Click Gump Size? Or whatever.
« Reply #8 on: November 24, 2009, 08:05:07 AM »
0
Here is where the snippet is located:

http://www.scriptuo.com/index.php?topic=505.0
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +57
  • Referrals: 1
    • View Profile
Re: Click Gump Size? Or whatever.
« Reply #9 on: November 24, 2009, 10:03:38 AM »
0
Man you guys are great, thank you.  I am going to make a real nice script, BIG all on my own that will help a lot of people one day.  Now I just need to find something no one has done yet ;)
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline cgeorgemo

  • Hero Member
  • *
  • Posts: 586
  • Activity:
    0%
  • Reputation Power: 5
  • cgeorgemo has no influence.
  • Gender: Male
  • I'm Brian...cgeorgemo is Curious George Missouri
  • Respect: +19
  • Referrals: 1
    • View Profile
Re: Click Gump Size? Or whatever.
« Reply #10 on: December 03, 2009, 08:45:15 PM »
0
Code: [Select]
gosub gumpclick 325 400
I did not think you could send parameters in the gosub name I thought you had to make a statement that set them...
Sarcasm is your body's natural defense against stupidity.

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: Click Gump Size? Or whatever.
« Reply #11 on: December 04, 2009, 02:42:41 AM »
0
Nope.
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Tags: