Running to a loc

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

Moderator: MacroQuest Developers

buyatradeskill
decaying skeleton
decaying skeleton
Posts: 7
Joined: Wed Jan 22, 2003 10:11 pm

Running to a loc

Post by buyatradeskill » Wed Jan 22, 2003 11:01 pm

I'm trying to learn about making macros. Can anyone tell me what code would make the character run in a straight line from its current location to a loc I specify in the code? I am aware that this is dangerous because it doesn't look "human" but this is just for eductional purposes. Thanks in advance :)

Ariain
a ghoul
a ghoul
Posts: 88
Joined: Fri Oct 11, 2002 10:35 am

....

Post by Ariain » Thu Jan 23, 2003 12:34 am

macros directory routines.mac sub gotoloc

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Thu Jan 23, 2003 1:30 am

Salutations,
or, we actually post code for someone instead of being cruel and torturing them and making them use my computer...

Code: Select all

#define gotoloc 0,0

sub main
/sendkey up down
/face loc gotoloc
:gotoloop
 /face loc gotoloc
/if n $distance(gotoloc)>3 /goto :gotoloop
/sendkey up up
/return

Ariain
a ghoul
a ghoul
Posts: 88
Joined: Fri Oct 11, 2002 10:35 am

....

Post by Ariain » Thu Jan 23, 2003 3:07 am

jeees sooooooorry =)
and making them use my computer...
Whats that mean make them use your computer?

User avatar
ap50
a snow griffon
a snow griffon
Posts: 425
Joined: Sun Aug 18, 2002 2:29 pm

Post by ap50 » Thu Jan 23, 2003 3:57 am

Image
[color=yellow][size=92][b]Just because you're paranoid, it doesn't mean everyone isn't out to get you![/b][/size][/color]

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Thu Jan 23, 2003 5:03 am

Salutations,
correct ap50... very good... Thats what happens if you use pronouns in your applications, people get confused...

Ariain
a ghoul
a ghoul
Posts: 88
Joined: Fri Oct 11, 2002 10:35 am

..

Post by Ariain » Thu Jan 23, 2003 5:46 am

Lol I did not catch that at all. =) Again its late =)

buyatradeskill
decaying skeleton
decaying skeleton
Posts: 7
Joined: Wed Jan 22, 2003 10:11 pm

Post by buyatradeskill » Thu Jan 23, 2003 10:47 am

Hey, there is a gototarget sub in there too, very cool :) Thanks guys

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Thu Jan 23, 2003 2:06 pm

Salutations,

Code: Select all

sub main
/sendkey up down
/face $p0
:gotoloop
/face $p0
/if n $spawn($id($p0),distance)>3 /goto :gotoloop
/sendkey up up
/return