Author Topic: Offset gumps  (Read 10576 times)

0 Members and 1 Guest are viewing this topic.

Offline SuperslayerTopic starter

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +100
  • Referrals: 0
    • View Profile
Offset gumps
« on: February 22, 2009, 04:38:54 PM »
0
As I write my first script (the roam one going on 1500 lines without the rails even) I have some notes at the top as 'Goals' to achieve.  At this moment, I'm rather wondering, do I need to have an offset gump option available, and if so, how so?  Currently I play on a 1280 x 1024 20" screen and the UO options are 1024 x 768 full screen resolution option and the game play window at 800 x 600.  I have in my script, parts where gumps are moved to a place, clicks made, runebooks opened and click made and the such.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13314
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +3090
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Offset gumps
« Reply #1 on: February 22, 2009, 04:45:31 PM »
0
If you check out this little script:

http://www.scriptuo.com/smf/index.php?topic=505.0;highlight=click

I used this all the time to generate the correct click offsets for screen locations.

It works wonders; I use it just about every script I develop.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline OMGBurgers

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +83
  • Referrals: 0
    • View Profile
Re: Offset gumps
« Reply #2 on: February 22, 2009, 05:28:09 PM »
0
Same thing I do.  Simple fool proof solution :)

Offline SuperslayerTopic starter

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +100
  • Referrals: 0
    • View Profile
Re: Offset gumps
« Reply #3 on: February 22, 2009, 06:13:35 PM »
0
So as I understand it, I personally won't need to incorporate this sub in my script, but users of my script can use this sub?  Or...I can actually have it in my script, but keep it commented out for me, and just let users aware that it is there and can/should be used/uncommented?

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13314
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +3090
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Offset gumps
« Reply #4 on: February 22, 2009, 06:25:06 PM »
0
The only thing you have to integrate into your script is this:

Code: [Select]
sub OffsetClick
  set %tempx %1 + #CONTPOSX
  set %tempy %2 + #CONTPOSY
  click %tempx %tempy f
return

Whether you write one yourself, or use that one.  Just about every scripter out there has generated a sub like this to adjust for gump coordinates mapped to the screen.  You start out coding all those clicks by hand, but you'll soon find that you are going to be using the same type of code a 100 times over.  So that's when you just make a little click sub out of it. 

The script I linked for you just help you generate the offset coordinates so you can cut/paste the resulting offset values.

A note on why we really need a sub like this

When you've coded enough, you might think that code like this should function:

Code: [Select]
  click %tempx + 200 %tempy + 200 f

However, in EasyUO it doesn't know how to parse this.  So that's why you have to do the math before you actually use the CLICK command. 

At this point, I get to poke fun at the lame EasyUO parser again..  ScriptUO knows how to parse this expression.  ;)
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline SuperslayerTopic starter

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +100
  • Referrals: 0
    • View Profile
Re: Offset gumps
« Reply #5 on: February 22, 2009, 08:06:46 PM »
0
Thanks TM, again.  It surprisingly makes sense.

Offline OMGBurgers

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +83
  • Referrals: 0
    • View Profile
Re: Offset gumps
« Reply #6 on: February 22, 2009, 08:15:05 PM »
0
When you've coded enough, you might think that code like this should function:

Code: [Select]
  click %tempx + 200 %tempy + 200 f

Haha you have no idea how often I tried to make things like that work ;*(
It would make code so much cleaner though if you could do things like that ;/

Offline _C2_

  • AFK FtW
  • Global Moderator
  • *
  • *
  • Posts: 4077
  • Activity:
    0%
  • Reputation Power: 48
  • _C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!
  • RIP Pen Trick
  • Respect: +396
  • Referrals: 4
    • View Profile
Re: Offset gumps
« Reply #7 on: February 23, 2009, 06:29:37 AM »
0
absolute life savers and allows everyone to use your code regardless of resolution.  I don't remember when I learned this but it was from cerv or TM and it is a life changer!

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: +861
  • Referrals: 11
    • View Profile
Re: Offset gumps
« Reply #8 on: February 23, 2009, 07:38:51 AM »
0
absolute life savers and allows everyone to use your code regardless of resolution.  I don't remember when I learned this but it was from cerv or TM and it is a life changer!

Musta been TM, I'm only semi-literate.
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 bliss

  • Jr. Member
  • **
  • Posts: 15
  • Activity:
    0%
  • Reputation Power: 0
  • bliss has no influence.
  • Respect: +3
  • Referrals: 0
    • View Profile
Re: Offset gumps
« Reply #9 on: March 03, 2009, 10:56:09 AM »
0
does this actualy move the gump to a diff spot? thats what i need to do. i need to open a crafting gump and move it off the main play screen i dont use full size res so i have some room

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13314
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +3090
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Offset gumps
« Reply #10 on: March 03, 2009, 11:01:57 AM »
0
No, this just makes whatever gump you are addressing usable.  For you, just change the #CONTPOSX and #CONTPOSY.  Also, if you change the #NEXTCPOSX and #NEXTCPOSY before you open the gump, then it will open where you want it.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline bliss

  • Jr. Member
  • **
  • Posts: 15
  • Activity:
    0%
  • Reputation Power: 0
  • bliss has no influence.
  • Respect: +3
  • Referrals: 0
    • View Profile
Re: Offset gumps
« Reply #11 on: March 03, 2009, 11:42:23 AM »
0
does this move a gump ? lol sorry you replied fast to that one

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13314
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +3090
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Offset gumps
« Reply #12 on: March 03, 2009, 11:47:40 AM »
0
#CONTPOSX and #CONTPOSY will move the current gump or container.
#NEXTCPOSX and #NEXTCPOSY will allow you to specify the position of the next opened gump/container.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline bliss

  • Jr. Member
  • **
  • Posts: 15
  • Activity:
    0%
  • Reputation Power: 0
  • bliss has no influence.
  • Respect: +3
  • Referrals: 0
    • View Profile
Re: Offset gumps
« Reply #13 on: March 03, 2009, 12:06:57 PM »
0
every time i think i have a grasp of what is going i realise i dont have a clue lol

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13314
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +3090
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Offset gumps
« Reply #14 on: March 03, 2009, 08:50:44 PM »
0
Ah, you'll get it.  Best thing is to do what I did and just play with it.... ;)
Please read the ScriptUO site RULES
Come play RIFT with me!

Tags: