Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!
Moderator: MacroQuest Developers
-
Mister Peepers
- a lesser mummy

- Posts: 46
- Joined: Mon Apr 19, 2004 8:10 pm
Post
by Mister Peepers » Tue Apr 20, 2004 10:42 pm
This is from the hunter.mac I have been using it for alittle while now and since the upgrade to MQData system I converted it and added things but I can't seem to get the macro to move to the target.
This is the code I use, any help would be appriciated.
Code: Select all
Sub MoveToMob
/face fast
/newif ${math.calc[${target.distance}>=@FastRange]} /call Fastmove
/newif ${math.calc[${target.distance}>@RangeMa]} {
/press up
}
/newif ${math.calc[${target.distance}<@RangeMin]} {
/press down
}
/return
Sub Fastmove
/varset MyXLOC ${me.spawn.x}
/varset MyYLOC ${me.spawn.y}
/varset ObstCount 0
:fastmoveloop
/newif ${target} {
/sendkey up up
/newif ${combat} {
/attack off
/return
}
}
/face fast
/newif ${math.calc[${target.distance}>@FastRange]} {
/sendkey down up
}
/newif ${math.calc[$target.distance}<=@FastRange]} {
/sendkey up up
/return
}
/varadd ObstCount 1
/newif ${math.calc[@ObstCount>=3] {
/call CheckObst
}
/goto :fastmoveloop
/return
Thank You, In advanced
p.s. sorry for spelling errors.
-
ml2517
- a grimling bloodguard

- Posts: 1216
- Joined: Wed Nov 12, 2003 1:12 am
Post
by ml2517 » Tue Apr 20, 2004 10:54 pm
Well I think I got all of your errors fixed, hard to say.
Code: Select all
Sub MoveToMob
/face fast
/newif (${Target.Distance}>=@FastRange) /call Fastmove
/newif (${Target.Distance}>@RangeMax) {
/press up
}
/newif (${Target.Distance}<@RangeMin) {
/press down
}
/return
Sub Fastmove
/varset MyXLOC ${Me.X}
/varset MyYLOC ${Me.Y}
/varset ObstCount 0
:fastmoveloop
/newif (${Target.ID}) {
/sendkey up up
/newif (${Me.Combat}) {
/attack off
/return
}
}
/face fast
/newif (${Target.Distance}>@FastRange) {
/sendkey down up
}
/newif (${Target.Distance}<=@FastRange) {
/sendkey up up
/return
}
/varadd ObstCount 1
/newif (@ObstCount>=3) {
/call CheckObst
}
/goto :fastmoveloop
/return
-
Mister Peepers
- a lesser mummy

- Posts: 46
- Joined: Mon Apr 19, 2004 8:10 pm
Post
by Mister Peepers » Tue Apr 20, 2004 10:57 pm
Nope, it didn't work but I think there is somthing wrong in other parts of the code. I am geting alot of nulls for things that should be producing numbers.
Thank your for the try. I have been writing my /newif statements wrong. I have been using ${math.calc[var]} for them so they all return number values, and compareing them in there and not really seting them to compare something that can be true or false.
I do have a question, is there away to check strings using the /newif. I know its ment for checking numbers and produces 1 and 0.
-
ml2517
- a grimling bloodguard

- Posts: 1216
- Joined: Wed Nov 12, 2003 1:12 am
Post
by ml2517 » Tue Apr 20, 2004 11:08 pm
Just do this:
Check if something is equal:
Code: Select all
/varset blah "North"
/newif (${String[@blah].Equal[North]}) {
/echo Yep it is north
} else {
/echo No it is not north
}
Check if something is not equal:
Code: Select all
/varset blah "North"
/newif (${String[@blah].NotEqual[North]}) {
/echo It is not north
} else {
/echo It is north
}
Check if somewhere is in the string:
Code: Select all
/varset blah "North of here is Canada"
/newif (${String[@blah].Find[North]}) {
/echo Yes, North was found in the phrase "@blah"
} else {
/echo No, North was not found in the phrase "@blah"
}
-
Mister Peepers
- a lesser mummy

- Posts: 46
- Joined: Mon Apr 19, 2004 8:10 pm
Post
by Mister Peepers » Tue Apr 20, 2004 11:10 pm
Thank you for all your help. Time to get back to the writing.