Author Topic: Someone please explain this in childs terms.  (Read 4672 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
Someone please explain this in childs terms.
« on: December 27, 2009, 09:16:48 AM »
0
Okay so I have the TRUE locations of ALL buttons for crafting and imbuing gumps.  Meaning I can call a click with the size of the window and where the button is located on the window and not on screen.  In case gumps move.

Can someone please explain how to do the clicks?  I know how to do click 50 50, ect, but how do i make it click for just the window?  I am drawing a blank here. 

Please give a few examples, or one really good one, like make last would be awesome, since I know the x/y and all craf gumps are the same size...

So how would a

gosub makelast

sub makelast

the blah blah stuff
return

Thanks guys.  This will make redoing my craft scripts EASY.  Well kinda anyways.
Coragin

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

Scrripty

  • Guest
Re: Someone please explain this in childs terms.
« Reply #1 on: December 27, 2009, 10:33:55 AM »
0
Okay so I have the TRUE locations of ALL buttons for crafting and imbuing gumps.  Meaning I can call a click with the size of the window and where the button is located on the window and not on screen.  In case gumps move.

Can someone please explain how to do the clicks?  I know how to do click 50 50, ect, but how do i make it click for just the window?  I am drawing a blank here. 

Please give a few examples, or one really good one, like make last would be awesome, since I know the x/y and all craf gumps are the same size...

So how would a

gosub makelast

sub makelast

the blah blah stuff
return

Thanks guys.  This will make redoing my craft scripts EASY.  Well kinda anyways.

There's a really good craftgump tutorial somewhere on easyuo...  Not sure where.  Search is your friend. :)

Offline OMGBurgers

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Someone please explain this in childs terms.
« Reply #2 on: December 27, 2009, 10:41:50 AM »
0
here's my craft sub.  not sure if it still works with the imbuing gump change.  i use it in my master craft script and haven't had a problem much with it.  i'm sure it could be a lot better/shorter, but eh oh well lol.

Code: [Select]
;#######################################
;#######################################
; CRAFT
;#######################################
;#######################################
sub craft
   set %craft_1 %1
   set %craft_2 %2
   set %craft_3 %3
   set %craft_4 %4
   
   if %craft_1 = tinker
      set %craft_tool GTL_JTL
   if %craft_1 = tailor
      set %craft_tool HAG
   if %craft_1 = fletching
      set %craft_tool UFG
   if %craft_1 = blacksmith
      set %craft_tool OBG

   set %timeout #SCNT2 + 30
   while #contname <> generic_gump && #contsize <> 530_507
      {
      if #SCNT2 > %timeout
         return ERROR
      set %timeout #SCNT2 + 30
      finditem %craft_tool C_ , #backpackid
      set #lobjectid #findid
      event macro 17
      wait 25
      }

   if %craft_2 = ML
      {
      gosub clickmod 285 450
      wait 5
      return
      }
   else
      {
      set %temp ( %craft_2 * 20 ) + 70
      gosub clickmod 30 %temp
      wait %craftmenuclick
      }

   set %temp %craft_3 - 1
   if %craft_3 > 1
      {
      for %craft_a 1 %temp
         {
         gosub clickmod 380 270
         wait %craftmenuclick
         }
      }

   set %temp ( %craft_4 * 20 ) + 50
   gosub clickmod 235 %temp
   wait %craftmenuclick
return

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13305
  • Activity:
    0.8%
  • 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
Re: Someone please explain this in childs terms.
« Reply #3 on: December 27, 2009, 10:43:50 AM »
0
OMG:  You forgot the most inportant thing for Cor; the gosub clickmod 285 450 sub.
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: +44
  • Referrals: 0
    • View Profile
Re: Someone please explain this in childs terms.
« Reply #4 on: December 27, 2009, 11:02:45 AM »
0
for gump clicks you're going to want a sub that handles clicks, I have one called clickmod I made...  it's pretty simple.

lets say you wana click x50 y120 on a gump, you would call clickmod 50 120 f.
clickmod would do:

Code: [Select]
sub clickmod
   set %x #contposx + %1
   set %y #contposy + %2
   click %x %y %3
return

I think I may have a bit more to mine, but not sure.

Saves writing those lines over and over and makes it real easy.

From there you want a good container/gump handling sub.  I would write it around using #contname, #contsize at the most.  #contkind I would only use if NEEDED because they change #contkinds of most gumps at every patch.

Offline OMGBurgers

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Someone please explain this in childs terms.
« Reply #5 on: December 27, 2009, 11:03:30 AM »
0
OMG:  You forgot the most inportant thing for Cor; the gosub clickmod 285 450 sub.

yeah I forgot it then had this post ready but did a rat spawn instead of pressing submit lol

:P

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: Someone please explain this in childs terms.
« Reply #6 on: December 27, 2009, 05:35:19 PM »
0
So like this...

Code: [Select]
set %cwin 530_507
set %makelastx 285
set %makelasty 450
gosub waitforgump %cwin
gosub clickmod %makelastx %makelasty


sub waitforgump
set %timeout #scnt + 30
while #contsize <> %1
      {
      wait 1
      if #scnt > %timeout
         {
          return #false
         }
      }
wait %gumpwait
return #true

sub clickmod
   set %x #contposx + %1
   set %y #contposy + %2
   click %x %y %3
return

That would work?
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: Someone please explain this in childs terms.
« Reply #7 on: December 27, 2009, 05:50:39 PM »
0
So like this...

Code: [Select]
set %cwin 530_507
set %makelastx 285
set %makelasty 450
gosub waitforgump %cwin
gosub clickmod %makelastx %makelasty


sub waitforgump
set %timeout #scnt + 30
while #contsize <> %1
      {
      wait 1
      if #scnt > %timeout
         {
          return #false
         }
      }
wait %gumpwait
return #true

sub clickmod
   set %x #contposx + %1
   set %y #contposy + %2
   click %x %y %3
return

That would work?

Sure.

I would suggest a lower number to wait for the gump before returning #FALSE but maybe that's just me.

Also, you don't need open and close brackets "{" and "}" on "If" arguments that are only one line long, should still work fine just not required.


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 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: Someone please explain this in childs terms.
« Reply #8 on: December 27, 2009, 05:57:45 PM »
0
dont need them i know, but if it intend to add mroe to that part later or something it dont hurt anything to have it there right?  In some cases and if command can be one line right?

if #mana >= 11 event macro (recall)

heh dont know the number off the top of my head but you get the idea.
Coragin

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

Offline OMGBurgers

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Someone please explain this in childs terms.
« Reply #9 on: December 28, 2009, 01:30:53 PM »
0
dont need them i know, but if it intend to add mroe to that part later or something it dont hurt anything to have it there right?  In some cases and if command can be one line right?

if #mana >= 11 event macro (recall)

heh dont know the number off the top of my head but you get the idea.

never tried that.  I think they mean:

Code: [Select]
      if #scnt > %timeout
         {
          return #false
         }

can be:

Code: [Select]
      if #scnt > %timeout
          return #false

a lot of time I put the extra brackets on because I usually add in more things for it to do after the if statements.  Usually when I finish up my script I take out em where they're not needed.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13305
  • Activity:
    0.8%
  • 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
Re: Someone please explain this in childs terms.
« Reply #10 on: December 28, 2009, 02:31:01 PM »
0

if #mana >= 11 event macro (recall)

Nope, can't do that.
Please read the ScriptUO site RULES
Come play RIFT with me!

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: Someone please explain this in childs terms.
« Reply #11 on: December 28, 2009, 03:24:54 PM »
0
never tried that.  I think they mean:

Code: [Select]
      if #scnt > %timeout
         {
          return #false
         }

can be:

Code: [Select]
      if #scnt > %timeout
          return #false

Yep, that's what I was talking about.

Also, as TM said, you can't have your "IF" condition and action on the same line but you can have multiple conditions on the same line:

Code: [Select]
If #MANA >= 11 || #HITS <= 30   ;<----multiple "IF" conditions
   Event Macro 15 31 ;<----action, Recall the hell outta there!

SeewhadImean Vern?

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 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: Someone please explain this in childs terms.
« Reply #12 on: December 29, 2009, 12:46:15 AM »
0
gotcha
Coragin

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

Scrripty

  • Guest
Re: Someone please explain this in childs terms.
« Reply #13 on: December 29, 2009, 04:49:37 PM »
0
gotcha

I haven't tried this yet tho I'm sure it will work also:

Code: [Select]
IF %coragin = newb || %coragin = trammy
  IF %coragin NOTIN #property
    IF #coragin = 50
      IF #coragin = uglymanboy
      {
        DO YOUR STUFF HERE
      }
Or you could show that like this also:
Code: [Select]
IF %coragin = newb || %coragin = trammy || %coragin NOTIN #property || #coragin = 50 || #coragin = uglymanboy
  {
    DO YOUR STUFF HERE
  }

I'm sure that would work, but not sure it's a very efficient way of doing it. :)
« Last Edit: December 29, 2009, 04:53:15 PM by Scripty »

Tags: