advpath.inc v1.31 -- follow/record/playback pathing inc file

A forum for macro code snippets to be used in writing other macros. Post routines or .inc files here only, completed macros go to the Macro Depot. MQ2Data format only!

Moderator: MacroQuest Developers

DigitalMocking
a grimling bloodguard
a grimling bloodguard
Posts: 620
Joined: Mon Apr 04, 2005 5:53 pm

Post by DigitalMocking » Tue Jun 14, 2005 1:34 pm

Here's a little something I wrote to get the hang of advpath, the usage is simple:

/startrec <filename> - Start Recording a path file.
/stoprec - Stop Recording
/playfile <filename> - Playback a recorded path

Code: Select all

#event PlayFile "[MQ2] playfile #1#"

#include advpath.inc

Sub Main 
  /call InitAPFVars 1 15 20 
  /squelch /alias /startrec /echo record
  /squelch /alias /stoprec  /echo stop
  /squelch /alias /playfile /echo playfile
  :Main_Loop
  /call AdvPathPoll
  /delay 5
  /doevents
  /goto :Main_Loop
/return

Sub WaitTilThere 
  :LoopTilThere 
  /if (${PathingFlag}==1) { 
    /call AdvPathPoll 
    /delay 1
    /doevents 
    /goto :LoopTilThere 
  } 
/return

Sub Event_PlayFile(string Line, string PathFile)
  /call PlayFunction "${PathFile} 1 nf nopp noz"
  /call WaitTilThere
/return

KokoNutz
orc pawn
orc pawn
Posts: 20
Joined: Sat Aug 13, 2005 4:59 pm

Post by KokoNutz » Wed Aug 31, 2005 9:35 pm

Something strange is going on with my implementation of this snippet and wanted to get another set of eyes on it to see if I'm doing something wrong...

Code: Select all

#Include advpath.inc

Sub Main  

/call InitAPFVars 1 15 20

:MainLoop

/if (${Zone.Name.Equal[Some Zone]}) /call MoveToPlace

<bunch of my code>

/goto :MainLoop

/return

Sub MoveToPlace

   /call PlayFunction "gosomewhere 1 cf pp noz"
   /call WaitTilThere
   /target Soandso
   /delay 3s
   /say blah blah blah
   /call PlayFunction "gosomewhere 1 cr pp noz"
   /call WaitTilThere

/return


Sub WaitTilThere

   :LoopTilThere
      /if (${PathingFlag}==1) {
         /call AdvPathPoll
         /delay 0
         /doevents
         /goto :LoopTilThere
      } 

/return

The problem is this: It works great the first time it detects that it is not in the correct zone, but after the first time, it runs like 2 inches, stops, turns around and runs back to the zone-out point and exits back to the main loop. Why is it only working the first time? Is there some variable that is not being reset within AdvPath?

Thanks,

-KoKo

KokoNutz
orc pawn
orc pawn
Posts: 20
Joined: Sat Aug 13, 2005 4:59 pm

Post by KokoNutz » Wed Aug 31, 2005 10:52 pm

Nevermind... just put a /doevents flush before each /PlayFunction call and it fixed the problem. Still not sure what was happening, but it works now so bleh...

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Thu Sep 01, 2005 8:54 pm

Are you sure you wanted to use the "pp" parameter? That is ping pong. It sounds like you wanted to walk somewhere.... do something... then walk back to where you started right? If that is the case try exactly what you have now but use nopp.

KokoNutz
orc pawn
orc pawn
Posts: 20
Joined: Sat Aug 13, 2005 4:59 pm

Post by KokoNutz » Thu Sep 01, 2005 9:23 pm

Yeah I had it as "nopp" but I had changed it while trying to figure out specifically what was causing the problem. I had just made that change when I cut & pasted here, but changed it back as soon as I went back to testing. So yeah I noticed that and unfortunately it wasn't the problem :(

Thanks,
-KoKo

Stewee
orc pawn
orc pawn
Posts: 26
Joined: Mon Jun 14, 2004 8:54 pm

Post by Stewee » Tue Nov 01, 2005 9:13 pm

I have used DigitalMocking's script in combination with advpath to record and playback files. This works really well for me but I am having a problem with a door in the area I am trying to navigate. There is an intricate looking section in this script to open doors that doesnt seem to work for me. It targets the door but it does not open it. The rest of the obstacle avoidance works fine. I threw some use center screen keypresses into the obstacle avoidance section as a workaround but it is not 100 percent. If anyone knows what I could change to make this more reliable I would appreciate it.

Thanks

Stewee

Omnictrl
a lesser mummy
a lesser mummy
Posts: 48
Joined: Sat Nov 29, 2003 11:55 pm

Post by Omnictrl » Wed Nov 02, 2005 3:44 am

Heh, I think I know that door.

I had to separate into two paths, one leading to the door, and the remainder (by recording them separately) - and putting a:

Sub openthisdamndoor
/face locbehinddoor
/keypress USE
/return

I tried to fix it by checking whether or not the door is open (${Switch.Open} iirc) and when failed the first time I had code to face left and right (30 degrees) and up to center and keep trying to open it, but it just didn't work very well.

Good luck on a better fix.

Wink-
a ghoul
a ghoul
Posts: 122
Joined: Tue Apr 27, 2004 2:41 pm

Post by Wink- » Wed Nov 02, 2005 2:18 pm

What I do for doors is /doortarget <doorname>, /face, /stick x, /keypress u

Works good for doors, clicking on zones.

Just need to play with the stick distance that you need.

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

Post by fearless » Wed Nov 02, 2005 2:22 pm

yeah . . . cause having a door on target isn't noticeable . . .
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]

toomanynames
a grimling bloodguard
a grimling bloodguard
Posts: 1844
Joined: Mon Apr 11, 2005 11:10 am

Post by toomanynames » Fri Nov 18, 2005 12:10 pm

You know funny thing is, and I've not tested the lastest MQ down load but the 11/17 one, advpath didn't target "bad things" anymore.

Maybe just quinkydink or perhaps DKAA found / fixed it but I didn't change advpath.inc, played a few LDON, and was checking on targeting doors and such, and it wasn't.

/shrug

JimJohnson
a grimling bloodguard
a grimling bloodguard
Posts: 1299
Joined: Sat Oct 11, 2003 6:00 am

Post by JimJohnson » Fri Jul 07, 2006 2:19 am

When Recording a Pathfile that requires zoning do you need to actually zone or do you just stop before the zone? Having issues with this not actually zoning me every time and firing the second playbackfile before I zone.

someone_orsomething
orc pawn
orc pawn
Posts: 16
Joined: Sat Dec 31, 2005 7:24 am
Location: USA

Post by someone_orsomething » Fri Jul 07, 2006 9:00 am

When Recording a Pathfile that requires zoning do you need to actually zone or do you just stop before the zone? Having issues with this not actually zoning me every time and firing the second playbackfile before I zone.



When i do it i have it walk just before the zoneline then next line I put /keypress foward hold (this will make it zone) then next line i /call zoner. I also put a delay in there cause comp might lag

Hope this helps

Sephin
orc pawn
orc pawn
Posts: 25
Joined: Fri Nov 28, 2003 2:33 pm

trying

Post by Sephin » Mon Jul 31, 2006 5:40 pm

[deleted] cuz I got my chant.mac to work with this. Posting in forum.

FrankJScott
naggy
naggy
Posts: 2128
Joined: Sun Feb 19, 2023 7:11 am

Updated Product Website

Post by FrankJScott » Sat Jan 06, 2024 6:14 pm

Please try Google before asking about New Product Tips ac74_59

FrankJScott
naggy
naggy
Posts: 2128
Joined: Sun Feb 19, 2023 7:11 am

Recommended Merino Wool Site

Post by FrankJScott » Sun Jan 07, 2024 11:41 am

To the guy asking about best merino wool hunting base layer, lightweight merino base layer, minus33 base layers, mens merino base layer top, icebreaker bodyfit 150 women's, rapha men's merino base layer, pure merino wool thermals, mens 100 merino wool base layer, tencel base layer, merino thermal wear, smartwool bottom base layer, men's wool undershirts, bula wool base layer, merino wool thermals uniqlo, icebreaker merino oasis 200, hooded merino base layer, sherpa merino base layer, top rated merino wool base layer, meriwool midweight, merino wool long johns, I can vouch for this merino wool base layers for best value merino wool base layer, smart wool base layers, icebreaker merino wool long underwear, smartwool merino 150 hoody, smartwool merino 250 leggings, redram merino wool base layer, smart wool layers, plus size merino wool base layer, tracksmith merino wool, sweaty betty merino base layer, icebreaker long underwear mens, women's intraknit merino 250 thermal bottom, smartwool thermals, helly hansen merino wool base layer mens, castelli merino base layer, haster alpaca base layer, crane merino thermals, women's merino 250 base layer bottom, woolx women's wool leggings, technicals merino base layer, also. See More Excellent Merino Wool Info 8dec9a8