Need help with a macro you are writing? Ask here!
Moderator: MacroQuest Developers
-
bohicaseti
- a lesser mummy

- Posts: 33
- Joined: Sat Mar 06, 2004 5:55 am
Post
by bohicaseti » Fri Apr 30, 2004 10:43 am
I"m back. Spent countless hours trying to figure it out and its not working. There are no working examples that I can find anywhere on here that I can learn from to get this. I just want to be able to swap out my normal melee bp with my clickie 100hp heal robe. Used to be quite simple with /finditem, but now it's a complex maze of /itemnotify stuff that I obviously can't figure out. And all the examples that I find that come close tell you to leave all your packs open before you start those macros. Hard to leave all your packs open while in combat constantly. If this can't be done simply like before, just say so and I"ll drop it. I don't need any fancy arrays or anything. This is just a simple swap of two items that used to take around 7 lines of code in the past to do that for some reason now I can't get done with 4 times that amount of code. Here's my base. Flame on peeps, Lax has made me numb to it.
Code: Select all
Sub Main
/if (${Me.PctHPs}>=91) /return
/if (!${Window[InventoryWindow].Open}) /keypress inventory
/itemnotify pack1 rightmouseup
/itemnotify ${FindItem[=Silver Moon Chest Wraps].InvSlot} leftmouseup
/delay 1s
/itemnotify chest leftmouseup
/delay 2
:HPCheck
/cast item "Silver Moon Chest Wraps"
/delay 11s
/if (${Me.PctHPs}>=91) /goto :bp
/goto :HPCheck
:bp
/delay 1s
/itemnotify chest leftmouseup
/autoinv
/cleanup
/return
Friends help friends move . . . .
Real friends help friends move dead bodies.
-
Preocts
- a snow griffon

- Posts: 312
- Joined: Thu Jan 29, 2004 1:02 pm
Post
by Preocts » Fri Apr 30, 2004 12:33 pm
Code: Select all
Sub Main
/if (${Me.PctHPs}>=91) /return
/if (!${Window[InventoryWindow].Open}) /keypress inventory
/itemnotify pack1 rightmouseup
[color=red]/itemnotify in pack1 ${FindItem[=Silver Moon Chest Wraps].InvSlot} leftmouseup[/color]
/delay 1s
/itemnotify chest leftmouseup
/delay 2
:HPCheck
/cast item "Silver Moon Chest Wraps"
/delay 11s
/if (${Me.PctHPs}>=91) /goto :bp
/goto :HPCheck
:bp
/delay 1s
/itemnotify chest leftmouseup
/autoinv
/cleanup
/return
See if that change makes it work. The code looks good.
-
bohicaseti
- a lesser mummy

- Posts: 33
- Joined: Sat Mar 06, 2004 5:55 am
Post
by bohicaseti » Fri Apr 30, 2004 12:44 pm
Thanks for the feedback Preocts, but its still doing what it was before. It opens the inventory, then the first bag, but doesn't find the robe inside the bag. Just skips to the next part and clicks the chest area taking off my current BP. I keep the robe in the first slot of the first pack. Been trying for a couple of weeks to get this now and just can't seem to figure out how it's this difficult. I'll keep pounding on the keyboard. Put a monkey in front of a typewriter long enough and he'll type the entire works of Shakespear.
Friends help friends move . . . .
Real friends help friends move dead bodies.
-
Preocts
- a snow griffon

- Posts: 312
- Joined: Thu Jan 29, 2004 1:02 pm
Post
by Preocts » Fri Apr 30, 2004 12:48 pm
Put a /delay 3 or 5 between the /itemnotify that opens your bag and the one that picks up the first item. If that still doesn't help knock #Turbo down to 10. When you open a pack there is a very noticable delay between the time that MQ says the bag is open and EQ says you can click stuff inside it.
It's odd. My own Switch.mac can change equipment faster than the graphics refresh if and only if the bags have been opened. When it needs to open a bag I had to put a big delay, about half a second, and even then it was a bit touchy. When I knocked the turbo down things smoothed out and the macro can now change about half my equipment with one button press in about 5 seconds.
-
bohicaseti
- a lesser mummy

- Posts: 33
- Joined: Sat Mar 06, 2004 5:55 am
Post
by bohicaseti » Fri Apr 30, 2004 1:13 pm
I set #Turbo to 10 and added a 3 second delay between the pack opening and /itemnotify and I'm still getting a "Could not send notification to in pack1."
Friends help friends move . . . .
Real friends help friends move dead bodies.
-
Preocts
- a snow griffon

- Posts: 312
- Joined: Thu Jan 29, 2004 1:02 pm
Post
by Preocts » Fri Apr 30, 2004 5:08 pm
Aye, that plugin gave me most the idea for my macro.
Bohicaseti: I'm sorry again. If you are finding the slot number of the item with ${FindItem[=Silver Moon Chest Wraps].InvSlot} I don't think you need the 'in pack1' part
This is code straight from my macro. ${WorkWith} is set to be the item inside my inventory.
Code: Select all
/varset PackNum ${InvSlot[${FindItem[=${WorkWith}].InvSlot.ID}].Pack}
/varset SlotNum ${Math.Calc[${FindItem[=${WorkWith}].InvSlot.Slot}+1]}
/if (!${Window[${InvSlot[${PackNum}].Name}].Open}) {
/itemnotify ${PackNum} rightmouseup
:Wait1
/if (!${Window[${InvSlot[${PackNum}].Name}].Open}) /goto :Wait1
}
/delay 3
/itemnotify in ${InvSlot[${PackNum}].Name} ${SlotNum} leftmouseup
/call WaitForIt ${CursorCheck}
/varset CursorCheck ${Cursor.ID}
/itemnotify ${SlotName} leftmouseup
/call WaitForIt ${CursorCheck}
/varset CursorCheck ${Cursor.ID}
/itemnotify in ${InvSlot[${PackNum}].Name} ${SlotNum} leftmouseup
/call WaitForIt ${CursorCheck}
/varset CursorCheck ${Cursor.ID}
WaitForIt is just a called loop that doesn't exit until the given Cursor.ID does not match the current cursor ID. But from this you see: I open the pack if it isn't open, and not only wait until that pack is open but delay again before moving on to pickup whatever item I'm after in that pack.
If you compare them yours is doing the same baisc actions so except for that little opps mentioned above I don't know why it won't work.
-
bardomatic
- a ghoul

- Posts: 131
- Joined: Thu Apr 29, 2004 12:09 am
Post
by bardomatic » Fri Apr 30, 2004 7:08 pm
Ths will work as long as the chestplate is always in pack1, still looking for a way to grab pack# from Finditem, inventory is not necissary to open btw, the loops are a bit more accurate than just delays and actually run faster
Code:
Code: Select all
Sub Main
:loop0
/if (${Me.Casting.ID}>0) {
/stopsong
/goto :loop0
}
/if (${Me.PctHPs}>=91) /return
/if (!${Window[pack1].Open}) /itemnotify pack1 rightmouseup
:wait0
/if (!${Window[pack1].Open}) /goto :wait0
:wait1
/itemnotify ${FindItem["Silver Moon Chest Wraps"].InvSlot} leftmouseup
/if (!${String[${Cursor.Name}].Find["Silver Moon Chest Wraps"]}) /goto :wait1
/itemnotify chest leftmouseup
:wait2
/if (${String[${Cursor.Name}].Find["Silver Moon Chest Wraps"]}) /goto :wait2
:HPCheck
/cast item chest
:castwait
/if (${Me.Casting.ID}>0) /goto :castwait
/if (${Me.PctHPs}>=91) /goto :bp
/goto :HPCheck
:bp
:wait3
/itemnotify chest leftmouseup
/if (!${String[${Cursor.Name}].Find["Silver Moon Chest Wraps"]}) /goto :wait3
:wait4
/autoinv
/if (${String[${Cursor.Name}].Find["Silver Moon Chest Wraps"]}) /goto :wait4
/itemnotify pack1 rightmouseup
/return
-
bohicaseti
- a lesser mummy

- Posts: 33
- Joined: Sat Mar 06, 2004 5:55 am
Post
by bohicaseti » Sat May 01, 2004 12:40 am
You guys are beautiful people. Thanks so much for the help and time working with this. Got it working 100% now and I couldn't have done it without ya. I ended up going with bardomatics version cause *crosses fingers*(please don't get mad at me Preocts, I know you worked hard to help me out), but I couldn't get it to work. I added a #define WorkWith "Silver Moon Chest Wraps" at the beginning but I got a "Varset failed, variable 'PackNum' not found".

Got the same for the SlotNum also, along with Lax's infamous cheery quotes. I'm sure it's my ignorance causing it. I'm probably brainfarting something simple but again I'm sorry and don't mean to descount the example that you posted. I'm sure others will be able to grasp it better than I. :) Thanks again for the patience and help.

Friends help friends move . . . .
Real friends help friends move dead bodies.
-
Preocts
- a snow griffon

- Posts: 312
- Joined: Thu Jan 29, 2004 1:02 pm
Post
by Preocts » Sat May 01, 2004 8:25 am
heh, I didn't expect that little snippet to work, I was showing you that the way you were trying to do it was the way that I did do it. Sorta a "It's okay, you've got the idea right just some syntax isnt working".
Glad to hear you've got it working.