Page 1 of 2

Shadow Haven Faction Macro

Posted: Wed Aug 18, 2004 1:15 am
by Override
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!

Posted: Wed Aug 18, 2004 7:51 am
by aChallenged1
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:

Posted: Mon Apr 25, 2005 3:33 pm
by mmatt_y2k
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

Posted: Wed May 25, 2005 11:39 am
by Chazzer
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.)

Posted: Sun Aug 14, 2005 1:57 pm
by Agrowhore
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 =/

Posted: Sun Aug 14, 2005 4:54 pm
by TheNewGuy
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...

Posted: Sun Aug 14, 2005 6:09 pm
by fearless
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?

Posted: Sun Aug 14, 2005 8:38 pm
by TheNewGuy
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.

Posted: Sun Aug 14, 2005 9:52 pm
by Agrowhore
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...

Posted: Mon Aug 15, 2005 9:16 am
by Jarid
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.

Posted: Mon Aug 15, 2005 10:13 am
by fearless
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.

Posted: Mon Aug 15, 2005 11:55 am
by Jarid
AFAIK, nothing can be equal to nothing...which is what the line is trying to catch.

Posted: Mon Aug 15, 2005 12:25 pm
by fearless
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.

Posted: Mon Jan 09, 2006 12:59 am
by mitrestre
does this work anymore? I cant seem to get it to work right.

Posted: Sat Apr 15, 2006 4:09 pm
by matter68
doesnt seem to be working for me either