Post your completed (working) macros here. Only for macros using MQ2Data syntax!
Moderator: MacroQuest Developers
-
ieatacid
- Developer

- Posts: 2727
- Joined: Wed Sep 03, 2003 7:44 pm
Post
by ieatacid » Thu May 06, 2004 9:21 pm
Opens the bag your Mana Robe is in (or grabs it from inv slot), equips it, clicks you to 95% mana or 10% health (whichever comes first), then returns the Mana Robe back to the slot it was in and puts the original robe back on.
Code: Select all
|manarobe.mac -- 8.30.2004
|/mac mana
|/echo stop (to end it and have it re-equip your original robe)
#turbo
#event stop "[MQ2] stop"
Sub Main
/declare slot int outer
/declare bag int outer
/echo ${Macro.Name} started....
/echo /echo stop (to stop it)
/if (!${Window[InventoryWindow].Open}) /keypress Inventory
/varset bag ${FindItem[Mana Robe].InvSlot.Pack}
/itemnotify ${InvSlot[${bag}]} rightmouseup
/varset slot ${FindItem[=Mana Robe].InvSlot}
/itemnotify chest leftmouseup
/itemnotify ${InvSlot[${slot}]} leftmouseup
/itemnotify chest leftmouseup
/if (${Me.Sitting}) /stand
:loop
/call CheckMana
/itemnotify chest rightmouseup
/doevents
/delay 1
/goto :loop
/return
Sub CheckMana
/if (${Me.PctMana}>=95) {
/echo Full Mana!
/call EndIt
}
/if (${Me.PctHPs}<=10) {
/echo Low on health!!
/call EndIt
}
/return
Sub EndIt
:wait
/if (${Me.Casting.ID}) /goto :wait
/itemnotify chest leftmouseup
/itemnotify ${InvSlot[${slot}]} leftmouseup
/itemnotify chest leftmouseup
/echo Ending.
/cleanup
/endmac
Sub Event_stop
/call EndIt
/return
Last edited by
ieatacid on Mon Aug 30, 2004 9:58 pm, edited 2 times in total.
-
se7en
- orc pawn

- Posts: 21
- Joined: Sun Dec 14, 2003 6:51 pm
Post
by se7en » Fri May 07, 2004 1:27 pm
Well, it seems that /finditem and $getlastfoundslot are both gone. Is there a replacement? My manarobe macro did exactly what I wanted but without that command it wont be very useful anymore
Here it is if you want to see if you might use some logic from it to work with MQ2Data.
Code: Select all
Sub Main
:checkrobe
/if "$equip(chest,name)"=="Mana Robe" /goto :loop
:getmanarobe
/if "$invpanel"==FALSE /press i
/finditem "Mana Robe"
/if "$cursor(name)"!="Mana Robe" /goto :getmanarobe
/if "$cursor(name)"=="Mana Robe" /goto :swap
:swap
/click left chest
/click left pack $getlastfindslot
/cleanup
/goto :loop
:loop
/if n $char(mana,pct)==100 /goto :end
/if $char(buff,"Force Shield")==0 /cast item "Wand of Impenetrable Force"
:runewait
/if $char(casting)==TRUE /goto :runewait
/cast item "Mana Robe"
:robewait
/if $char(casting)==TRUE /goto :robewait
/goto :loop
:end
/if "$invpanel"==FALSE /press i
/finditem "Maelin's Robe of Lore"
/if "$cursor(name)"!="Maelin's Robe of Lore" /goto :end
/click left chest
/click left pack $getlastfindslot
/cleanup
/delay 1s
/cast item "Wand of Impenetrable Force"
/return
I had to make a minor change to /finditem in MQ2Commands.cpp in order to make the output of the $getlastfoundslot variable usable by /finditem again, but now that is all rather moot considering the command is commented out. Ideas?
-
Preocts
- a snow griffon

- Posts: 312
- Joined: Thu Jan 29, 2004 1:02 pm
Post
by Preocts » Fri May 07, 2004 2:26 pm
errr... Use the macro that was posted on this thread? ::ponder::
-
se7en
- orc pawn

- Posts: 21
- Joined: Sun Dec 14, 2003 6:51 pm
Post
by se7en » Sat May 08, 2004 12:47 pm
my issue was having it find the manarobe, and remember where it got it from, and placing the robe i was wearing there, then swapping them back out, eliminating the need for changing the line for where it was. rarely does my gear stay put.
-
ieatacid
- Developer

- Posts: 2727
- Joined: Wed Sep 03, 2003 7:44 pm
Post
by ieatacid » Sat May 08, 2004 2:25 pm
Updated the original. Now gets the robe from whatever bag it's in or if it's in an inventory slot and puts it back there when it's done.
-
Casper the Wizard
- decaying skeleton

- Posts: 4
- Joined: Tue Jun 08, 2004 9:17 pm
Post
by Casper the Wizard » Tue Jun 08, 2004 9:23 pm
Hi Ieatacid,
I took your idea (really liked the inventory code) and combined it with Yalp's code (cuase I use the epic/manarobe combo) and made this macro. Nothing special, but figured someone may have some use for it. My first macro, so I'm not sure if it's 100%, but it does work pretty well.
Thanks,
Code: Select all
|ManaRobe.Mac by Casperwiz
|Useage: This Macro requires the Wizard Epic, but is easily
|adaptable to work with the Wand of Impenetrable Force from time.
|
|This macro will grab your mana robe from inventory (if you're not
|wearing it) and then cast it, keeping you buffed with the Epic
|rune so as not to take any damage.
|
|Thanks to Yalp and Ieatacid for the orginal code.
#Turbo
#event stop "[MQ2] stop"
Sub Main
/declare slot int outer
/declare bag int outer
/echo manarobe.mac started....
/echo /echo stop (to stop it)
/if (!${Window[InventoryWindow].Open}) /keypress Inventory
/varset bag ${FindItem[Mana Robe].InvSlot.Pack}
/itemnotify ${InvSlot[${bag}]} rightmouseup
/varset slot ${FindItem[=Mana Robe].InvSlot}
/itemnotify chest leftmouseup
/itemnotify ${InvSlot[${slot}]} leftmouseup
/itemnotify chest leftmouseup
/if (${Me.Sitting}) /stand
:loop
/call GetMana
/delay 1
/goto :loop
/return
Sub GetMana
:loop
/if (${Me.PctMana}==100) /call EndIt
/if ( ${Bool[${Me.Buff["Barrier of Force"]}]}==FALSE ) /cast item "Staff of the Four"
:runewait
/if (${Me.Casting.ID}) /goto :runewait
/cast item "Mana Robe"
:robewait
/if (${Me.Casting.ID}) /goto :robewait
/goto :loop
/return
Sub EndIt
:wait
/if (${Me.Casting.ID}) /goto :wait
/itemnotify chest leftmouseup
/itemnotify ${InvSlot[${slot}]} leftmouseup
/itemnotify chest leftmouseup
/echo Ending.
/cleanup
/endmac
-
Yalp
- a ghoul

- Posts: 90
- Joined: Thu Dec 05, 2002 6:28 pm
Post
by Yalp » Wed Jun 09, 2004 3:14 pm
hehe my casting subs are popular :)
heres the one i use currently
Code: Select all
|ManaRobe.Mac by Yalp
|Useage: This Macro requires Wand if Impenetrable Force from time,
|but is easily adaptable to work with wizard epic
|this uses f12 for endmacro key, i personally remapped my "mouse controll"
|button to pause-break since i never turn it off anyways.
#Turbo
Sub Main
/custombind add EndMacro
/custombind set EndMacro /endmacro
/bind EndMacro F12
:loop
/if (${Me.PctMana}==100) /endmacro
/if ( ${Bool[${Me.Buff["Force Shield"]}]}==FALSE ) /cast item "Wand of Impenetrable Force"
:runewait
/if (${Me.Casting.ID}) /goto :runewait
/cast item "Mana Robe"
:robewait
/if (${Me.Casting.ID}) /goto :robewait
/goto :loop
/return
pretty simple but hey it works for me :p
Because i wouldn't have it any other way
-
MankindTG
- decaying skeleton

- Posts: 1
- Joined: Thu Aug 19, 2004 2:08 am
Post
by MankindTG » Thu Aug 19, 2004 2:11 am
There anyway to change Caspers version so it finds Mana robe switches it with ur robe then finds wiz epic then switches it with ur primary.. do script then switch stuff back?
-
SukMage
- a ghoul

- Posts: 88
- Joined: Fri Jun 04, 2004 5:08 pm
Post
by SukMage » Thu Aug 19, 2004 5:24 am
Code: Select all
/if (!${Window[InventoryWindow].Open}) /keypress Inventory
/varset bag ${FindItem[Staff of the Four].InvSlot.Pack}
/itemnotify ${InvSlot[${bag}]} rightmouseup
/varset slot ${FindItem[=Staff of the Four].InvSlot}
/itemnotify primary leftmouseup
/itemnotify ${InvSlot[${slot}]} leftmouseup
/itemnotify primary leftmouseup
added before the /if (${Me.Sitting}) /stand should make it grab wizzy epic and robe out but untested as I'm not able to get in game atm and jump on friend's wizzy to try.
-
Monkeynuts
- decaying skeleton

- Posts: 5
- Joined: Fri Aug 20, 2004 3:23 pm
Post
by Monkeynuts » Tue Aug 24, 2004 7:51 pm
*edit* meh.
Last edited by
Monkeynuts on Wed Aug 25, 2004 2:17 pm, edited 1 time in total.
-
ieatacid
- Developer

- Posts: 2727
- Joined: Wed Sep 03, 2003 7:44 pm
Post
by ieatacid » Tue Aug 24, 2004 11:20 pm
What line is the error happening on?
For starters, this is in the old format that's no longer supported:
Code: Select all
/if "$equip(primary,name)"!="Staff of the four"
An easy way to do this
Code: Select all
/if ( ${String[${Target.ID}].Equal[NULL]} ) /return
would be
-
Monkeynuts
- decaying skeleton

- Posts: 5
- Joined: Fri Aug 20, 2004 3:23 pm
Post
by Monkeynuts » Wed Aug 25, 2004 2:20 pm
Ok, here's what I use with Genbot, seems to work the way I want.
Thanks to Yalp, IeatAcid, Bardomatic, and of course the devs of MQ
Code: Select all
Sub Command-robeup
/declare manarpt int outer
/varset manarpt 0
/keypress F1
:loop
/doevents chat
/if (!${Target.ID}) /return
/if (${Me.PctMana}<93) /alt activate 172
:harv
/delay 2
/if (${Me.Casting.ID}) /goto :harv
/if (${Me.PctMana}<93) /cast "Harvest"
/if (${Me.Casting.ID}) /call ChatOut 3 "Casting Harvest"
/doevents chat
/if (!${Target.ID}) /return
/if (${Me.PctMana}==100) /call chatout 3 "Full Mana"
/if (${Me.PctMana}==100) /return
/if (${manarpt}==0) /if (${Me.PctMana}>79) /call ChatOut 3 "I'm At ${Me.PctMana} % Mana"
/if (${manarpt}==0) /if (${Me.PctMana}>79) /varset manarpt 1
| Check Health
/if (${Me.PctHPs}<35) /call chatout 3 "I am at ${Me.PctHPs} % health!"
/if (${Me.PctHPs}<35) /return
| Check Buffs
/if ( ${Bool[${Me.Buff["Barrier of Force"]}]}==FALSE ) /if ( ${Bool[${Me.Buff["Spiritual Dominion"]}]}==FALSE ) /call swapcast "Staff of the four" mainhand
:RuneWait
/if (${Me.Casting.ID}) /goto :runewait
/doevents chat
/if (!${Target.ID}) /return
| UseRobe
/call swapcast "Mana Robe" chest
:CastPause
/if (${Me.Casting.ID}) /goto castpause
/goto :loop
/return
Sub SwapCast(item,equipslot)
/declare inventoryslot int local
/declare pack local
/declare packslot int local
/declare leaveopen int local 1
/declare packnumber int local 0
/declare leavetwisting int local 0
/if (!${Defined[item]}) /goto :end
/if (${Twisting}) {
/twist stop
/varset leavetwisting 1
}
:stopsingingdelay
/if (${Me.Casting.ID}) {
/stopsong
/goto :stopsingingdelay
}
/varset inventoryslot ${FindItem[${item}].InvSlot}
/if (!${inventoryslot}) /goto :notfound
:packcountloop
/if (${inventoryslot}>250 && ${inventoryslot}<331) {
/varset packnumber ${Math.Calc[${packnumber}+1]}
/varset inventoryslot ${Math.Calc[${inventoryslot}-10]}
/goto :packcountloop
}
/if (${packnumber} > 0) {
/varset pack pack${packnumber}
/varset packslot ${Math.Calc[${inventoryslot}-240]}
/goto :foundit
}
:notinpack
/call CastItem ${inventoryslot}
/goto :end
:foundit
/if (!${Window[${pack}].Open}) {
/nomod /itemnotify ${pack} rightmouseup
/varset leaveopen 0
}
/call WaitCursor ${packslot} ${pack}
/if (${String[${equipslot}].Find[null]}) {
/if (${Cursor.WornSlots}>0) {
/varset equipslot ${Cursor.WornSlot[1]}
} else {
/varset equipslot pack1
}
}
/call WaitCursor ${equipslot}
/call CastItem ${equipslot}
/call WaitCursor ${equipslot}
/call WaitCursor ${packslot} ${pack}
/if (${leaveopen} == 0) /nomod /itemnotify ${pack} rightmouseup
/goto :end
:notfound
/echo ${item} not found in inventory.
:end
/if (${leavetwisting} == 1) /twist start
/return
Sub CastItem(slot)
/nomod /itemnotify ${slot} rightmouseup
/echo Casting the effect on your ${InvSlot[${slot}].Item.Name}
:castloop
|| special case composer greaves don't ever stop casting
/if (${InvSlot[${slot}].Item.Name.Find["Composers Greaves"]}) {
/delay 12
/stopsong
}
/if (${Me.Casting.ID}) /goto :castloop
/return
Sub WaitCursor(slot, pack)
/declare item local
/declare timeout timer 30
/varset item ${Cursor.ID}
/if (${Defined[pack]}) /goto :waitloop2
:waitloop1
/nomod /itemnotify ${slot} leftmouseup
/if ((${item} == ${Cursor.ID}) && (${timeout} > 0)) /goto :waitloop1
/goto :donewaiting
:waitloop2
/nomod /itemnotify in ${pack} ${slot} leftmouseup
/if ((${item} == ${Cursor.ID}) && (${timeout} > 0)) /goto :waitloop2
:donewaiting
/return
-
digital_hex
- decaying skeleton

- Posts: 3
- Joined: Mon Aug 30, 2004 4:34 pm
Post
by digital_hex » Mon Aug 30, 2004 4:41 pm
I registered so I could say thank you for this macro. :) So simple yet so useful.
And just to point it out, there are two errors in the original macro (first post) with using the html code for the greater/less than symbols in the mana and health checks. These are very obvious and I corrected them myself with no macro writing experience. Just wanted to make you aware of it. :)
-
ieatacid
- Developer

- Posts: 2727
- Joined: Wed Sep 03, 2003 7:44 pm
Post
by ieatacid » Mon Aug 30, 2004 9:59 pm
Thanks. Updated the original post to replace > and < with the proper characters.