SH.mac
Code: Select all
|
| SH.mac
| Works on your Shadow Haven Faction for merchents.
| Version 1.0
| Date: August 18, 2004
|
| Be sure to check out my other macros at http://www.soc-music.com/mq2/index.htm
|
| You WILL need to in front of Gearo in the bazaar before you start it.
|
| Disclaimer:
| Code was used from other programers also from the MQ Forums.
|
Sub Main
/declare Location int inner
/call ReadINI SH.ini "Shadow Haven"
/if (!${Defined[SHArray]}) {
/echo No SH Array Created...
/endmacro
}
/call ReadINI SH.ini "The Bazaar"
/if (!${Defined[BazArray]}) {
/echo No Baz Array Created...
/endmacro
}
:start
/target Gearo
/face
/nomodkey /say I will take the gems
/delay 1s
/if (!${Window[InventoryWindow].Open}) /nomodkey /keypress inventory
/delay 2s
/autoinv
/delay 2s
/call GMCheck
/for Location 1 to ${BazArray.Size}
:MoveLoopBaz
/if (${Zone.Name.Equal[Shadow Haven]}) /goto :SH
/face nolook loc ${BazArray[${Location}]}
/if (${Math.Distance[${BazArray[${Location}]}]}>4) {
/nomodkey /keypress forward hold
/face nolook loc ${BazArray[${Location}]}
/look
}
/if (${Math.Distance[${BazArray[${Location}]}]}<=4) {
/nomodkey /keypress forward
/goto :next
}
/goto :MoveLoopBaz
:next
/delay 1s
/next Location
:SH
/for Location 2 to ${SHArray.Size}
:MoveLoopSH
/face nolook loc ${SHArray[${Location}]}
/if (${Math.Distance[${SHArray[${Location}]}]}>4) {
/nomodkey /keypress forward hold
/face nolook loc ${SHArray[${Location}]}
/look
/if (${Location}==14) /keypress u
}
/if (${Math.Distance[${SHArray[${Location}]}]}<=4) {
/nomodkey /keypress forward
/goto :nexta
}
/goto :MoveLoopSH
:nexta
/delay 1s
/next Location
/target Steaon
/face
/delay 1s
/call OpenPacks
/delay 1s
/nomodkey /itemnotify ${FindItem[=Bag of Assorted Gems].InvSlot} leftmouseup
/delay 2s
/click left target
/delay 2s
/notify GiveWnd GVW_Give_Button leftmouseup
/delay 1s
/call ClosePacks
/delay 1s
/say I will make a trip to the bazaar
/delay 2s
/autoinv
/delay 2s
/varset Location ${SHArray.Size}
:SHa
/if (${Location}>0) {
:MoveLoopSHa
/if (${Zone.Name.Equal[The Bazaar]}) /goto :DoneSH
/face nolook loc ${SHArray[${Location}]}
/if (${Math.Distance[${SHArray[${Location}]}]}>4) {
/nomodkey /keypress forward hold
/face nolook loc ${SHArray[${Location}]}
/look
/if (${Location}==13) /keypress u
}
/if (${Math.Distance[${SHArray[${Location}]}]}<=4) {
/nomodkey /keypress forward
/goto :nextc
}
/goto :MoveLoopSHa
:nextc
/delay 1s
/varset Location ${Math.Calc[${Location}-1]}
/goto :SHa
}
:DoneSH
/varset Location ${Math.Calc[${BazArray.Size}-1]}
:Baza
/if (${Location}>0) {
:MoveLoopBaza
/face nolook loc ${BazArray[${Location}]}
/if (${Math.Distance[${BazArray[${Location}]}]}>4) {
/nomodkey /keypress forward hold
/face nolook loc ${BazArray[${Location}]}
/look
}
/if (${Math.Distance[${BazArray[${Location}]}]}<=4) {
/nomodkey /keypress forward
/goto :nextb
}
/goto :MoveLoopBaza
:nextb
/delay 1s
/varset Location ${Math.Calc[${Location}-1]}
/goto :Baza
}
/target Gearo
/face
/delay 1s
/call OpenPacks
/delay 1s
/nomodkey /itemnotify ${FindItem[=Assorted Tailoring Supplies].InvSlot} leftmouseup
/delay 2s
/click left target
/delay 2s
/notify GiveWnd GVW_Give_Button leftmouseup
/delay 1s
/call ClosePacks
/goto :start
/return
Sub GMCheck
:gmcheck
/if (${Spawn[gm].ID}>0) {
/echo "Waiting on GM to leave zone."
/delay 10
/goto :gmcheck
}
/return
Sub ReadINI(FileName,SectionName)
/echo Attempting to Read Section "${SectionName}" Zone Information from ${FileName}...
/delay 1s
/if (${Ini[${FileName},${SectionName},-1,NO].Equal[NO]}) {
/echo "${SectionName}" is not a Valid Section for FILE:${FileName}, ending macro...
/delay 1s
/return
}
/declare nValues int local 1
/declare nArray int local 0
/declare KeySet string local ${Ini[${FileName},${SectionName}]}
| ****************** Locs ****************************
:CounterLooplo
/if (${String[${Ini[${FileName},${SectionName},Loc${nValues}]}].Equal[null]}) {
/varcalc nValues ${nValues}-1
/goto :MakeArraylo
}
/varcalc nValues ${nValues}+1
/goto :CounterLooplo
:MakeArraylo
/if (!${nValues}) /return
/if (${nValues}>0) {
/echo Declaring Loc Array...
/if (${SectionName.Equal[Shadow Haven]}) /declare SHArray[${nValues}] string outer
/if (${SectionName.Equal[The Bazaar]}) /declare BazArray[${nValues}] string outer
}
/for nArray 1 to ${nValues}
/if (${SectionName.Equal[Shadow Haven]}) /varset SHArray[${nArray}] ${Ini[${FileName},${SectionName},Loc${nArray}]}
/if (${SectionName.Equal[The Bazaar]}) /varset BazArray[${nArray}] ${Ini[${FileName},${SectionName},Loc${nArray}]}
/next nArray
/echo "${SectionName}" Zone Information Read Successfully from ${FileName}...
/delay 1s
/return
Sub OpenPacks
/declare bag int local 0
/declare check int local 0
/newif (!${Window[InventoryWindow].Open}) /nomodkey /keypress inventory
/delay 1s
/for bag 1 to 8 step 1
/newif (${Window[Pack${bag}].Open}==FALSE) /nomodkey /itemnotify pack${bag} rightmouseup
/next bag
/delay 1s
/for check 1 to 9 step 1
/if (${Window[TradeskillWnd].Open}) {
/nomodkey /notify TradeskillWnd ExperimentButton leftmousehold
/nomodkey /notify TradeskillWnd ExperimentButton leftmouseup
}
/next check
/delay 1s
/return
Sub ClosePacks
/declare bag int local 0
/newif (!${Window[InventoryWindow].Open}) /nomodkey /keypress inventory
/delay 1s
/for bag 1 to 8 step 1
/newif (${Window[Pack${bag}].Open}==TRUE) /nomodkey /itemnotify pack${bag} rightmouseup
/next bag
/delay 1s
/newif (${Window[InventoryWindow].Open}) /nomodkey /keypress inventory
/delay 1s
/return
Code: Select all
[Shadow Haven]
Loc1=327.00, 675.00
Loc2=299.86, 675.00
Loc3=302.56, 730.10
Loc4=94.96, 735.55
Loc5=87.55, 634.45
Loc6=65.27, 634.98
Loc7=65.39, 884.90
Loc8=154.67, 1018.52
Loc9=157.54, 1096.85
Loc10=287.60, 1146.23
Loc11=290.18, 1359.16
Loc12=241.67, 1393.67
Loc13=241.67, 1540.28
Loc14=263.77, 1540.80
Loc15=266.41, 1561.27
[The Bazaar]
Loc1=-510.19, -170.68
Loc2=-750.32, -161.86
Loc3=-876.23, -174.24
Loc4=-875.80, -215.95
Loc5=-895.00, -215.95



