Looking for help with a goto location code.

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

cww256
orc pawn
orc pawn
Posts: 20
Joined: Mon Jun 23, 2003 7:58 pm

Looking for help with a goto location code.

Post by cww256 » Tue Jun 24, 2003 5:27 pm

Trying to make my own goto script...

Code: Select all

#define gotoloc 0,0
#define Loc1 -1585,-908
#define Loc2 -1581,-971
#define Loc3 -1119,-832
#define Loc4 -1111,-893

sub main
/face loc Loc3
/sendkey down W
:loop3
/face loc Loc3
/if n $distance(Loc3)>3 /goto :loop3
:loop1
/face loc Loc1
/if n $distance(Loc1)>3 /goto :loop1 
/sendkey up W
/return
The problem is for some reason I just keep running after the macro ends instead of stopping at Loc1.

Also as you can see there are 4 points I define. Is there a more efficent way of walking to these 4 points than what I have started here? If soplease give precise examples.

yocal
a lesser mummy
a lesser mummy
Posts: 43
Joined: Fri Jun 14, 2002 12:28 pm
Location: Denmark
Contact:

Method

Post by yocal » Sat Jul 05, 2003 4:17 pm

Hi there.

I use a method from my routine-library:

Code: Select all

|*********************************************************|
|**                MOVE TO LOCATION ROUTINE             **|
|**         /call MoveToLocation "<loc(x),loc(y)>"      **|
|*********************************************************|
Sub MoveToLocation

  /sendkey down up 

  :MoveToLocationLoop

    /face loc $p0
    /call CheckIfStucked
    /if n $distance($p0)>5 /goto :MoveToLocationLoop
  
  /sendkey up up 
  /delay 3
 
/return
Usage:

Code: Select all

Sub Main

   /call MoveToLocation -1585,-908
   /call MoveToLocation -1581,-971 
   /call MoveToLocation -1119,-832 
   /call MoveToLocation -1111,-893

/return
Remember: Remove /call CheckIfStucked... It calls a method that - uhm - checks if you are stucked in a tree, wall or whatever... :roll:

// Yoc.

User avatar
BlueSkies
a ghoul
a ghoul
Posts: 132
Joined: Tue Oct 01, 2002 6:22 pm

Post by BlueSkies » Sat Jul 05, 2003 5:52 pm

Might try taking a look here:

http://macroquest2.com/phpBB2/viewtopic.php?t=2595

That's a link to my pathwalking scripts that uses INI support to record and playback paths.
Live your dreams! Blue Skies everyone