Shadow Haven Faction Macro

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

User avatar
Override
a hill giant
a hill giant
Posts: 179
Joined: Sun Dec 29, 2002 9:19 am

Shadow Haven Faction Macro

Post by Override » Wed Aug 18, 2004 1:15 am

Here is a little macro to work on that Shadow Haven Faction. Be sure to start it at Gearo in the bazaar.

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 
SH.ini

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
Enjoy!
Self Automated Tradeskill Macros at:
[url=http://www.override13.com/mq2/]http://www.override13.com/mq2/[/url]

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Wed Aug 18, 2004 7:51 am

I'll stick with mine, more parts (files) but so much smaller and easy to edit and modify to use for other simular faction quests.

Though I think I'll borrow your itemnotify lines. :cool:
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

mmatt_y2k
decaying skeleton
decaying skeleton
Posts: 9
Joined: Fri Dec 31, 2004 10:44 am

Post by mmatt_y2k » Mon Apr 25, 2005 3:33 pm

Sorry to bump up the thread but here is an update to the bazaar locs because of the zone change..Bit sloppy but it gets the job done..

Code: Select all

[The Bazaar]
Loc1=0, -29.36
Loc2=15.08, -29.04
Loc3=-1.42, -100.09
Loc4=-0.29, -270.36
Loc5=-110.32, -272.13
Loc6=-155.03, -305.91
Loc7=-153.12, -353.19
Loc8=-183.12, -353.19

Chazzer
decaying skeleton
decaying skeleton
Posts: 3
Joined: Mon May 23, 2005 12:28 pm
Contact:

Post by Chazzer » Wed May 25, 2005 11:39 am

Sweet,

Override have you added the new LOC's do your "base" code on your web site. I have been looking at this and many of the other Macros you have.. but I am a little ignorant and have not taken allot of time yet.. Going to take that time this next week and see how far I can get. ( I am a network guy not a coder so this should be fun.)

Agrowhore
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sun Aug 14, 2005 1:54 pm

Post by Agrowhore » Sun Aug 14, 2005 1:57 pm

Is there an easy mod that can be made for a caster class, who has the ability to Gate back and forth to both NPCs?? If I Bind and Gate to the Bazaar NPC and use a Stone of Marking and Secondary Recall AA to the Shadowhaven NPC? Would save the pathing and the macro would run faster. Im new to writing macros, so I dont really even know where to start =/

TheNewGuy
a snow griffon
a snow griffon
Posts: 307
Joined: Sat Jul 10, 2004 9:33 am
Contact:

Post by TheNewGuy » Sun Aug 14, 2005 4:54 pm

Start by posting help requests in the right goddamn forum. Yer 2 for 2 buddy, at least you are consistant.

... And yet again the base of your post has NOTHING to do with the subject of the post.

A_Druid_00: Go Away!
TheWarden: Die in a fire
eqjoe: fuckin noob...

Pick your quote, they all apply...
[quote="dont_know_at_all"][quote="sybarite"]Um.. search works fine for me (used spell_routines.inc)... Try scrolling down you lazy fuck.

http://www.macroquest2.com/phpBB2/viewtopic.php?t=8964&highlight=spellroutines+inc[/quote]

That's great but he's looking for move.inc, you fucking spastic colon.[/quote]

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Sun Aug 14, 2005 6:09 pm

TheNewGuy wrote:Start by posting help requests in the right goddamn forum. Yer 2 for 2 buddy, at least you are consistant.

... And yet again the base of your post has NOTHING to do with the subject of the post.

A_Druid_00: Go Away!
TheWarden: Die in a fire
eqjoe: fuckin noob...

Pick your quote, they all apply...
Uhh, TNG . . . He was talking about this specific macro, if it was possible to remove some of the pathing by using gate and the aa gate.

How does this not apply to this topic?
Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]

TheNewGuy
a snow griffon
a snow griffon
Posts: 307
Joined: Sat Jul 10, 2004 9:33 am
Contact:

Post by TheNewGuy » Sun Aug 14, 2005 8:38 pm

Bad day, I jumped to conclusions. My bad - re-read it just now, see what you mean.

Fucking Air Force blows... I got the distinct pleasure of detailing a 10k All-Terrain Forklift today - which hasn't been washing inside or out for a good 2 years... (Inspection coming in 2 weeks, all vehicles, even ones that are supposed to be shitty ass greasy and dirty must sparkle)

Sorry ><

*edit* I know there are more military that use MQ2... If you see an Air Force 10AT driving around your base that looks like it's been waxxed, wheels with that tire wet shit and all - yeah that was me. The Air Force is big allright, but I can guaran-fucking-tee there's only 1 10K AT that' looks all shit ass rusty with what paintjob that's left waxxed, and "bling bling" tires. (Interior was armor-all'd as well but you won't notice that just passing by))

*edit2* In answer to the dude's question... Yes, there is an easy mod you can make to do that. Take a look at [[Editing Existing Macros]] and flip through a few pages in TFM ([[RTFM]]) for a quick change.
[quote="dont_know_at_all"][quote="sybarite"]Um.. search works fine for me (used spell_routines.inc)... Try scrolling down you lazy fuck.

http://www.macroquest2.com/phpBB2/viewtopic.php?t=8964&highlight=spellroutines+inc[/quote]

That's great but he's looking for move.inc, you fucking spastic colon.[/quote]

Agrowhore
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sun Aug 14, 2005 1:54 pm

Post by Agrowhore » Sun Aug 14, 2005 9:52 pm

TheNewGuy wrote: In answer to the dude's question... Yes, there is an easy mod you can make to do that. Take a look at [[Editing Existing Macros]] and flip through a few pages in TFM ([[RTFM]]) for a quick change.
Actually, I did read that forum, spoke with some friends, and experimented a little to make it work. Will clean it up a bit and post the code if anyone wants it.

Also, I noticed that the original macro doesnt function; get lots of errors spamming the MQ console. That could be my screw up, but no time to look into it at this point, especially since my gimped version is working just fine...

Jarid
a lesser mummy
a lesser mummy
Posts: 33
Joined: Sat Jul 03, 2004 2:14 pm

Post by Jarid » Mon Aug 15, 2005 9:16 am

I was looking at this...the error is on

Code: Select all

/if (${String[${Ini[${FileName},${SectionName},Loc${nValues}]}].Equal[null]}) {
but

Code: Select all

/if (${Ini[${FileName},${SectionName},Loc${nValues}].Equal[null]}) {
and

Code: Select all

/if (${Ini[${FileName},${SectionName},Loc${nValues}].Equal[NULL]}) {
Don't seem to work even when the ini returns NULL.

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Mon Aug 15, 2005 10:13 am

Jarid wrote:I was looking at this...the error is on

Code: Select all

/if (${String[${Ini[${FileName},${SectionName},Loc${nValues}]}].Equal[null]}) {
but

Code: Select all

/if (${Ini[${FileName},${SectionName},Loc${nValues}].Equal[null]}) {
and

Code: Select all

/if (${Ini[${FileName},${SectionName},Loc${nValues}].Equal[NULL]}) {
Don't seem to work even when the ini returns NULL.
Can something really be equal to nothing? No, this is not a stupid question, and the answer holds the answer to your problem.
Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]

Jarid
a lesser mummy
a lesser mummy
Posts: 33
Joined: Sat Jul 03, 2004 2:14 pm

Post by Jarid » Mon Aug 15, 2005 11:55 am

AFAIK, nothing can be equal to nothing...which is what the line is trying to catch.

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Mon Aug 15, 2005 12:25 pm

Jarid wrote:AFAIK, nothing can be equal to nothing...which is what the line is trying to catch.
But if the line isn't working . . . there must be something wrong with your assumption.

As far as MQ is concerned, "Ini[${FileName},${SectionName},Loc${nValues}]" is something and therefore cannot be equal to nothing.

My suggestion would be to flip the logic around and try !NotEqual.
Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]

mitrestre
orc pawn
orc pawn
Posts: 18
Joined: Sun Dec 11, 2005 10:53 pm

Post by mitrestre » Mon Jan 09, 2006 12:59 am

does this work anymore? I cant seem to get it to work right.

matter68
a lesser mummy
a lesser mummy
Posts: 45
Joined: Tue Apr 04, 2006 6:37 pm

Post by matter68 » Sat Apr 15, 2006 4:09 pm

doesnt seem to be working for me either