A little help

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

Moderator: MacroQuest Developers

Tuffy
a lesser mummy
a lesser mummy
Posts: 33
Joined: Thu Oct 02, 2003 9:20 am

A little help

Post by Tuffy » Thu Oct 02, 2003 9:32 am

Hello,

I want to return to my home.

This is what I started with about a weekago.

Code: Select all

sub Playerhome 
:homeloop 
/face $1080.00,1880.00 
/echo $distance(1080.00,1880.00) 
/if n $distance(1080.00,1880.00)>=40 { 
/sendkey down up 
} 
/if n $distance(1080.00,1880.00)<=40 { 
/sendkey up up 
/return 
} else { 
/goto :homeloop 
} 

/return

For some reason it doesn't like:

Code: Select all

/if n $distance(1080.00,1880.00)>=40
So after looking around this morning. I found this example:

Code: Select all

sub Playerhome
/face loc 1080.00,1880.00
/echo $distance(1080.00,1880.00)
/call gotoloc 1080.00,1880.00
/return
I just want to go back to home.

Any help would be great.

Scrime
a ghoul
a ghoul
Posts: 86
Joined: Sun Sep 21, 2003 5:48 pm
Contact:

Post by Scrime » Thu Oct 02, 2003 11:53 am

Not 100% sure what you are asking for, as you ask a question, then seem to answer it yourself with an example. However, I will humor you and see if I can help.

In your script I think the line

Code: Select all

/face $1080.00,1880.00
should instead be as your example shows

Code: Select all

/face loc 1080.00,1880.00
You state that "For some reason it doesn't like:"

Code: Select all

 /if n $distance(1080.00,1880.00)>=40 
But you don't say what error it gives you. It looks like a valid line to me.

If I were to rewite it myself, it would look something like this:

Code: Select all

Sub PlayerHome
  /sendkey down up
:HomeLoop
  /face loc 1080.00,1880.00
  /if n $distance(1080.00,1880.00)>=40 /goto :HomeLoop
  /sendkey up up
/return

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Thu Oct 02, 2003 12:03 pm

One thing I try to do is avoid multiple conditions like >=, etc. It's amazing the number of syntax errors that causes at times.

>=40 is the same as >39

Just a personal preference, but I've had that clear up problems in the past.
MQ2: Think of it as Evolution in action.

Tuffy
a lesser mummy
a lesser mummy
Posts: 33
Joined: Thu Oct 02, 2003 9:20 am

Post by Tuffy » Thu Oct 02, 2003 3:46 pm

Sorry for being unclear on the question. I'll try your suggestion and log the error if I get one after the change.

I've created a search and destory macro. After the little guy goes out and destorys something I want him to return to his home loc where it's safe to med etc.... I've search and read all the hunter macros. In my bastardize version every thing works on mine but the return home part.

Thanks for the help....

User avatar
Slice
a hill giant
a hill giant
Posts: 189
Joined: Wed Oct 30, 2002 2:52 pm

Post by Slice » Thu Oct 02, 2003 3:47 pm

Might want to take a look at the genbot macro. It's got an anchor function to set a home point for the bot to return to. You might be able to leverage some of that code.

Slice