Button ready for pressing?

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

User avatar
SimpleMynd_01
a lesser mummy
a lesser mummy
Posts: 71
Joined: Thu May 08, 2003 3:16 pm

Button ready for pressing?

Post by SimpleMynd_01 » Fri Apr 23, 2004 11:04 pm

Is there a way to tell if a button is ready for pressing or not? My goal is to not just loop through pounding the Combine button in the new tradeskill interface before it's ready.

It seems like there should be a way to do this with a bit more style... My cludge workaround is:

Code: Select all

Sub NewTSCombine
    /delay 2
    :CombineClick
        /varset Waiting 0
        /delay 8
        /notify TradeskillWnd CombineButton leftmouseup
        :WaitForResult
            /delay 1
            /doevents CombineSuccess
            /doevents CombineFail
            /doevents NoComponents
            /if (@OutOfItems==TRUE) {
                /varset OutOfItems FALSE
                /goto :DoneCombining
            }
            /if (@FailedCombine==TRUE) {
                /varset FailedCombine FALSE
                /goto :CombineClick
            }
            /if (@MadeIt==TRUE) {
                /varset MadeIt FALSE
                /autoinv
                /goto :CombineClick
            }
            /varadd Waiting 1
            /if (@Waiting==10) {
                /echo ${Time} Combine click timeout. Reclicking.
                /mqlog ${Time} Combine click timeout. Reclicking.
                /goto :CombineClick
            }
        /goto :WaitForResult
:DoneCombining
/return
Another easy question: What's the propper way to write this?
Old way:

Code: Select all

/selectitem "Water Flask" merchant
My ghetto fix is...

Code: Select all

/notify MerchantWnd MW_MerchantSlot7 leftmouseup
But once again I get no style or flexability points for it... :(

I play on satellite so my timings get ALL screwed up pretty easily with tradeskill scripts. Latency is anywhere from .5 to 3.5 seconds, and hardcoded delays of 4 seconds just bugs the hell outta me!

Thanks for the help in advance!

-SimpleMynd

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Sat Apr 24, 2004 12:09 am

added bool window.Checked for next zip.

Then do this:

Code: Select all

/if (!${Window[TradeskillWnd].Child[CombineButton].Checked) {
whatever
}
The right way to select an item is this:
/itemnotify merchant1 leftmouseup
(merchant1 through merchant80 are valid)
or
/itemnotify ${Merchant.Item[=Water Flask].InvSlot} leftmouseup
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

User avatar
SimpleMynd_01
a lesser mummy
a lesser mummy
Posts: 71
Joined: Thu May 08, 2003 3:16 pm

Thanks

Post by SimpleMynd_01 » Sat Apr 24, 2004 7:18 am

Thank you sir!

-SimpleMynd

BrainDeath
a ghoul
a ghoul
Posts: 86
Joined: Sun Mar 07, 2004 5:00 pm

${Window[TradeskillWnd].Child[CombineButton].Checked}

Post by BrainDeath » Mon Apr 26, 2004 10:17 pm

Lax,

I tested ${Window[TradeskillWnd].Child[CombineButton].Checked} and it returns TRUE if the mouse is pointing at the button (which highlights it) and FALSE otherwise. Doesn't appear to have any relation to whether or not the button is pressed or available for pressing. I probably won't be using this myself, but just wanted to let you know.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Mon Apr 26, 2004 10:21 pm

k, I'll look into it then
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Tue Apr 27, 2004 5:19 pm

ok. Checked appears to give TRUE if either a) the button is pressed OR b) the mouse is hovering over it.

I'll be trying to figure out how to determine if it is pressed.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Tue Apr 27, 2004 5:50 pm

got it, fixed in next zip
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

BrainDeath
a ghoul
a ghoul
Posts: 86
Joined: Sun Mar 07, 2004 5:00 pm

Post by BrainDeath » Fri Apr 30, 2004 8:46 pm

Lax helped me to figure this one out.

For those of you who want to wait for the button to become available and then press it use .Enabled.

The combine button on the new Tradeskill window for example, to press it when it becomes available you would use:

Code: Select all

:Loop
   /if (!${Window[TradeskillWnd].Child[CombineButton].Enabled}) /goto :Loop
   /notify TradeskillWnd CombineButton leftmouseup
You can use the same thing for the SearchButton, etc.
Hope this helps someone out :)

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Fri Apr 30, 2004 11:13 pm

The difference between using Checked and Enabled is that one of them is having a button "greyed out" like the invite button on a group window, and one is having it appear depressed (no not "sad" just down).

greyed out=not enabled
looks down=checked
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0