Author Topic: TrailMyx's OffsetClick generator  (Read 20742 times)

0 Members and 1 Guest are viewing this topic.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • 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: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
TrailMyx's OffsetClick generator
« on: October 28, 2008, 01:01:50 AM »
0
Here's a quick script that helps you determine where buttons are located on any gump relative to the position of the gump on the screen.  Use in combination with the "OffsetClick" sub to make your button position determination effortless (i.e. put that calculator down.)

Usage:
1) Run Script
2) Open/select gump you want to determine positions of
3) Hover mouse over button in question
4) Hit ALT-F1 to capture that position
5) Cut/Paste (from right mouse button context) the string found in "String" edit box
6) Hit ALT-F1 to start actively scanning again
7) Rinse/Repeat

Code: easyuo
  1. set #LPC 100
  2. gosub showEUOMenu1
  3. set %update_rate 5
  4. set %timer #SCNT2 + %update_rate
  5. set %MODE CAPTURE
  6. repeat
  7.   if #SCNT2 > %timer && %MODE = CAPTURE
  8.   {
  9.     menu set EUOEditMenu #CONTNAME
  10.     menu set EUOEditSize #CONTSIZE
  11.     menu set EUOEditX #CONTPOSX
  12.     menu set EUOEditY #CONTPOSY
  13.     set %tempx #CURSORX - #CONTPOSX
  14.     set %tempy #CURSORY - #CONTPOSY
  15.     set %string gosub , #SPC , OffsetClick , #SPC , %tempx , #SPC , %tempy
  16.     menu set EUOEditString %string
  17.     set %timer #SCNT2 + %update_rate
  18.   }
  19.  
  20.   onhotkey F1 ALT
  21.   {
  22.     if %MODE = CAPTURE
  23.     {
  24.       set %MODE HOLD
  25.       menu delete EUOLabel6
  26.     }
  27.     else
  28.     {
  29.       set %MODE CAPTURE
  30.       menu Text EUOLabel6 4 136 ALT-F1 to capture
  31.     }
  32.     wait 10
  33.   }
  34. until #FALSE
  35. ;--------- EasyUO Menu Designer Code Begin ---------
  36. sub showEUOMenu1
  37.         menu Clear
  38.         menu Window Title TM's Offset Click Generator
  39.         menu Window Color BtnFace
  40.         menu Window Size 236 147
  41.         menu Font Transparent #true
  42.         menu Font Align Right
  43.         menu Font Name MS Sans Serif
  44.         menu Font Size 8
  45.         menu Font Style
  46.         menu Font Color WindowText
  47.         menu Font Transparent #false
  48.         menu Font Align Left
  49.         menu Text EUOLabel1 128 8 Current Menu
  50.         menu Text EUOLabel2 128 32 Current Size
  51.         menu Text EUOLabel3 60 60 X Coord
  52.         menu Text EUOLabel4 60 84 X Coord
  53.         menu Text EUOLabel5 176 112 String
  54.         menu Text EUOLabel6 4 136 ALT-F1 to capture
  55.         menu Font BGColor Window
  56.         menu Edit EUOEditMenu 0 4 121
  57.         menu Edit EUOEditSize 0 28 121
  58.         menu Edit EUOEditX 0 56 53
  59.         menu Edit EUOEditY 0 80 53
  60.         menu Edit EUOEditString 0 108 169
  61.         menu Show 421 270
  62. return
  63. ;--------- EasyUO Menu Designer Code End ---------
  64.  

Use in combination with this little OffsetClick sub:

Code: easyuo
  1. ;-------------------------------------------------------------------------------
  2. sub OffsetClick
  3.   set %tempx %1 + #CONTPOSX
  4.   set %tempy %2 + #CONTPOSY
  5.   click %tempx %tempy f
  6. return
  7.  

« Last Edit: August 06, 2017, 08:03:51 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: TrailMyx's OffsetClick generator
« Reply #1 on: December 31, 2009, 07:33:34 AM »
0
Nice and easy.
What you witness -- is whatver..
uogamers hybrid.

Offline Coragin

  • 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: TrailMyx's OffsetClick generator
« Reply #2 on: December 31, 2009, 09:13:31 AM »
0
You mean we have to copy and paste this?  Ugh, so much work...wheres the download?  :p
Coragin

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

Scrripty

  • Guest
Re: TrailMyx's OffsetClick generator
« Reply #3 on: February 08, 2010, 09:13:39 AM »
0
Just a nice little tidbit here makes working with menus really easy... if you change the sub name to "sub OffsetClickR" and set the click %tempx %tempy to R instead of F you have a handy way of right clicking menus that are open in only 2 little easy subs. :)  And you can use the click position you generated for left clicking the menu to right click it also, so it's just a cut and paste for both functions. :)
Example below:

Code: [Select]
;-------------------------------------------------------------------------------
sub OffsetClickR
  set %tempx %1 + #CONTPOSX
  set %tempy %2 + #CONTPOSY
  click %tempx %tempy r
return


[/quote]

Offline Khameleon

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: TrailMyx's OffsetClick generator
« Reply #4 on: February 08, 2010, 04:00:33 PM »
0
LOL that looks similar to my offsetclick sub :P I guess there's not much more you can do with it eh :P

Offline baldielocks

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +11
  • Referrals: 5
    • View Profile
Re: TrailMyx's OffsetClick generator
« Reply #5 on: June 13, 2010, 08:05:19 PM »
0
okay, maybe not as easy as that. Where do I paste it TO? How does it work in the sub? :-[ feels so newbish.

Did I post this in the right place?

Here is what i have so far. I broke the script trying to get this to work. Good learning opportunity. I know that usually, you would set two variables, then combine them in savepix. (thanks to MW in chat for helping, so I included code from his miner here).
This for a health bar (pet gump).
CONTSIZE 432_184
CONTKIND GLF
CONTNAME status_gump
CONTID LYWEPB
CONTTYPE LZ

default location 0 0

Code: [Select]
set %xclick #contposx + 220
set %yclick #contposy + 110

Code: [Select]
savepix %clickx %clicky 1

These are my locations, from the generator. They will be used savepix later in script. Old locations are commented below offset click. I had it working at 0 0. %PetgumpX and %petgumpY are set as #contposX and #contposy. As far as I can tell, I should have been able to move it around. But as soon as it was moved from 0 0, it would constantly cast.
Code: [Select]
set %Pet_heal_now gosub OffsetClick 118 44 ; heal start
;set %PetHealthPixX ( %PetgumpX + 118 )
;set %PetHealthPixY ( %PetgumpY + 44 )

set %Pet_poisoned gosub OffsetClick 47 44 ;while loop
;set %PetPoisonpixX ( %PetgumpX + 47 )
;set %PetPoisonpixY ( %PetgumpY + 44 )

set %pet_dead gosub OffsetClick 38 44 ;res sub
;set %PetDeadpixX ( %PetgumpX + 38 )
;set %PetDeadpixY ( %PetgumpY + 44 )

sub at end of code:
Code: [Select]
sub OffsetClick
  set %tempx %1 + #CONTPOSX
  set %tempy %2 + #CONTPOSY
  click %tempx %tempy f
return
« Last Edit: June 15, 2010, 09:18:24 PM by baldielocks »

Offline gimlet

  • Very Super Secret
  • Global Moderator
  • *
  • *
  • Posts: 6190
  • Activity:
    3%
  • Reputation Power: 71
  • gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!
  • Gender: Male
  • Respect: +273
  • Referrals: 3
    • View Profile
Re: TrailMyx's OffsetClick generator
« Reply #6 on: September 27, 2011, 06:42:46 AM »
0
You mean we have to copy and paste this?  Ugh, so much work...wheres the download?  :p

I agree!

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: TrailMyx's OffsetClick generator
« Reply #7 on: September 27, 2011, 06:49:53 AM »
0
~An Corp Post~

Replying to a post dated 1 year and 9 months ago from a guy who hasn't been logged into the forums in 5 months?

Not very Elite if you ask me :P
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 gimlet

  • Very Super Secret
  • Global Moderator
  • *
  • *
  • Posts: 6190
  • Activity:
    3%
  • Reputation Power: 71
  • gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!
  • Gender: Male
  • Respect: +273
  • Referrals: 3
    • View Profile
Re: TrailMyx's OffsetClick generator
« Reply #8 on: September 27, 2011, 08:33:25 AM »
0
Actually - Super Secret Elite! (and my opinion still stands! heheheh)

Offline grrrls

  • Newbie
  • *
  • Posts: 8
  • Activity:
    0%
  • Reputation Power: 1
  • grrrls has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: TrailMyx's OffsetClick generator
« Reply #9 on: November 22, 2012, 09:17:56 AM »
0
This is exactly the help I needed - thank you!

Offline Crisis

  • Global Moderator
  • *
  • *
  • Posts: 2998
  • Activity:
    3.4%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +205
  • Referrals: 2
    • View Profile
Re: TrailMyx's OffsetClick generator
« Reply #10 on: February 22, 2013, 02:54:31 PM »
0
This is awesome, loving it for my crafting script!