Page 1 of 1

SH Faction Macro

Posted: Thu Aug 12, 2004 10:10 pm
by Bad Karma
Posted here for aChallenged1.


SHFaction.mac

Code: Select all

|
|  SH Faction Macro
|  by Bad Karma
|
|  Start this macro from inside the room with Steaon (Alchemy guy) in SH.
|

#turbo 40
#include advpath.inc


Sub Main
   /call InitAPFVars 1 15 20
   /press ESC

:MainLoop
   /doevents

| -------------------------------------------------------------------
| 1. Make sure we're close enough to Steaon.
| 2. Give Steaon the items from Gearo.
| 3. Get item from Steaon to take to Gearo.
| -------------------------------------------------------------------
   /call PlayFunction "Steaon_to_Door 1 cr nopp noz"
   /call WaitTilThere
   /call delay 1s


| --------------------------
| Get the stuff from Steaon.
| --------------------------
   /target Steaon
   /call delay 2s
   /if $cursor()=="TRUE" {
      /click left target
      /call delay 3s
      /click left npctrade give
      /call delay 3s
   }
   /call delay 5s
   /say I will make a trip to the Bazaar.
   /call delay 5s
   /press ESC


| ---------------------------
| Run to Gearo in the Bazaar.
| ---------------------------
   /call PlayFunction "Steaon_to_Door 1 cf nopp noz"
   /call WaitTilThere
   /call delay 1s
   /face loc 240,1540
   /call delay 2s
   /doortarg
   /call delay 2s
   /press u
   /call delay 1s
   /call PlayFunction "Door_to_Bazaar 1 cf nopp z"
   /call WaitTilThere
   /call delay 1s
   /face loc -875,-175
   /call delay 2s
   /call PlayFunction "Gearo_to_SH 1 cr nopp noz"
   /call WaitTilThere


| ----------------------------------------------
| 1. Give Gearo the item from Steaon
| 2. Get item from Gearo to take back to Steaon.
| ----------------------------------------------
   /call delay 1s
   /target Gearo
   /call delay 2s
   /if $cursor()=="TRUE" {
      /click left target
      /call delay 3s
      /click left npctrade give
      /call delay 3s
   }
   /call delay 5s
   /say I will take the gems.
   /call delay 5s
   /press ESC


| -------------------------
| Run back to Steaon in SH.
| -------------------------
   /call PlayFunction "Gearo_to_SH 1 cf nopp z"
   /call WaitTilThere
   /call delay 1s
   /face loc 300,740
   /call delay 2s
   /call PlayFunction "Door_to_Bazaar 1 cr nopp noz"
   /call WaitTilThere
   /call delay 1s
   /face loc 265,1540
   /call delay 2s
   /doortarg
   /call delay 2s
   /press u
   /call delay 1s
| ----------------------------------
| Rinse, Repeat, until we /endmacro.
| ----------------------------------
   /goto :MainLoop
/return

Sub WaitTilThere
   :LoopTilThere
      /if n @PathingFlag==1 {
         /call AdvPathPoll
         /call delay 1
         /doevents
         /goto :LoopTilThere
      }
/return



I found it necessary to make this first part 2 seperate path files, due to problems with targeting and opening the door. When I had it all in one file, I would often get stuck running into the corner of the room, or trying to open the wall just to the right of the door from outside, due to AdvPath's anti-collision code. Using the next 2 pathing files made it 10,000 times more accurate and efficient, especially when using a SOW type spell.

PathFile_Steaon_to_Door.ini

Code: Select all

[PFLocs]
0=265.00 1560.00 -55.25
1=265.00 1540.00 -55.25
2=255.00 1540.00 -55.25



PathFile_Door_to_Bazaar.ini

Code: Select all

[PFLocs]
0=240.00 1540.00 -55.25
1=240.00 1390.00 -55.25
2=300.00 1320.00 -55.25
3=300.00 1170.00 -55.25
4=150.00 1075.00 -55.25
5=150.00 980.00 -55.25
6=55.00 860.00 -55.25
7=55.00 630.00 -55.25
8=90.00 630.00 -55.25
9=90.50 740.00 -55.25
10=300.00 740.00 -55.25
11=300.00 670.00 -55.25
12=320.00 670.00 -55.25


I don't know how lag will affect this now. I have NPCs (traders) hidden in Bazaar, so I never lagged.

PathFile_Gearo_to_SH.ini

Code: Select all

[PFLocs]
0=-510.00 -175.00 3.75
1=-530.00 -175.00 3.75
2=-595.00 -140.00 3.75
3=-780.00 -140.00 3.75
4=-830.00 -175.00 3.75
5=-875.00 -175.00 3.75
6=-875.00 -215.00 3.75
7=-885.00 -215.00 3.75
Good luck! Shouldn't take ya more than 5 minutes to convert.

Posted: Thu Aug 12, 2004 10:34 pm
by aChallenged1
Thanks, the conversion should be pretty straight forward as much of what I needed was the pathing. I was wondering about the door and you pretty much did what I thought might be needed.

I'll be looking yours over and compair it to mine and merge them as best I can so I can get this running.

Thanks, again.

Posted: Mon Aug 16, 2004 2:28 pm
by aChallenged1
BK, I'm still working on it, think I'm close to done, but the dang pathing is killing me. Had me running into walls and such, so I recreated the pathing files. Gotta fine tune them so that walls and such aren't an issue, nor is the reverse of the door to bazaar with the stairs and then the door at the end.

I should have it soon. I'm just a bit nutty about pathing. I want it to be very smooth from start to finish.

Posted: Thu Aug 19, 2004 5:09 am
by Bad Karma
My original pathing files were actually quite extensive, but I eventually whittled them down until I was left with what is posted above.

That was before the new params.

I haven't looked at the latest AdvPath.inc enough to see if/what/how things have changed. Will look at your code in the other thread and reply there after checking things out.