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
-
Neb
- decaying skeleton

- Posts: 4
- Joined: Sun Nov 23, 2003 3:48 am
- Location: Hell
Post
by Neb » Sun Nov 23, 2003 3:54 am
I have just discoverd of this wonderful thing, and i have been tinkering with some other peoples macros and i mangaged to copy/paste and write my own macro. i havent gotten a chance to test it out yet and i was wondering if there is anything wrong with it or any inmporvements could be made. Thanks much.
Code: Select all
#event Fizzle "Your spell fizzles!"
#event Interrupt "Your casting has been interrupted!"
#event Interrupt "Your spell is interrupted."
#event Recover "You haven't recovered yet..."
#event Recover "Spell recovery time not yet met."
#event Resisted "You target resisted the "
#event OutOfMana "Insufficient Mana to cast this spell!"
#event OutOfRange "Your target is out of range, get closer!"
#event NoLOS "You cannot see your target."
#event Stunned "You cannot cast while stunned"
#event Standing "You must be standing to cast a spell"
#event Collapse "Your gate is too unstable, and collapses."
#event CampCheck “camp”
--------------------------------------------------------------------------------------
Sub Main
/declare MobToHunt global
/declare MainArray array2
/declare MyXLoc global
/declare MyYLoc global
/declare KSRadius global
/declare NotSee global
/declare TooFar global
/declare MyTarget global
/declare TargetDead global
/declare HasTarget global
/declare ObstCount global
/declare LootSlot global
/declare CheckLoot global
/declare LootTotal global
/declare MobArraySize global
/declare RangeMax global
/declare RangeMin global
/declare AttackRange global
/declare MobArraySize global
/declare WaitForAdds global
/call movetoloc
/call gettarget
/doevent
/return
--------------------------------------------------------------------------------------
Sub movetoloc(xloc,yloc)
/declare MyXLOC local
/declare MyYLOC local
/declare ObstCount local
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstCount 0
:locloop
/face loc @xloc
/if "@yloc"=="u" /Press u
/call AutoRun 1
/varadd ObstCount 1
/if n @ObstCount>=3 {
/if n @MyXLOC==$char(x) /if n @MyYLOC==$char(y) {
/sendkey up up
/sendkey down down
/if n $rand(99)>50 {
/delay 1s
/sendkey up down
/sendkey down Right
/delay 5
/sendkey up Right
/sendkey down up
/delay 1s
/sendkey up up
} else {
/delay 1s
/sendkey up down
/sendkey down left
/delay 5
/sendkey up left
/sendkey down up
/delay 1s
/sendkey up up
}
/sendkey up down
/sendkey up Right
/sendkey up Left
}
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstCount 0
}
/if n $distance(@xloc)>10 /goto :locloop
}
/call autorun 0
/return
--------------------------------------------------------------------------------------
Sub GetTarget
/target npc "brownie"
/return
--------------------------------------------------------------------------------------
Sub Event_CampCheck
/ooc Shopkeep is taken
/return
Sub Event_Fizzle
/return CAST_RESTART
Sub Event_Interrupt
/return CAST_RESTART
Sub Event_Recover
/delay 5
/return CAST_RESTART
Sub Event_Standing
/stand
/return CAST_RESTART
Sub Event_Collapse
/return CAST_RESTART
Sub Event_OutOfMana
/return CAST_OUTOFMANA
Sub Event_OutOfRange
/return CAST_OUTOFRANGE
Sub Event_NoLOS
/return CAST_CANNOTSEE
Sub Event_Stunned
/return CAST_STUNNED
Sub Event_Resisted
/return CAST_RESISTED
-
Neb
- decaying skeleton

- Posts: 4
- Joined: Sun Nov 23, 2003 3:48 am
- Location: Hell
Post
by Neb » Sun Nov 23, 2003 3:57 am
BTW, im sure i went a little over board with the declares, but like i said befor im pretty new to all this and wasnt sure what id need, and i figured better be safe then sorry.
-
dont_know_at_all
- Developer

- Posts: 5450
- Joined: Sun Dec 01, 2002 4:15 am
- Location: Florida, USA
-
Contact:
Post
by dont_know_at_all » Sun Nov 23, 2003 4:02 am
You have many things wrong. For example, what sets xloc?
-
Neb
- decaying skeleton

- Posts: 4
- Joined: Sun Nov 23, 2003 3:48 am
- Location: Hell
Post
by Neb » Sun Nov 23, 2003 4:57 am
i do depending on where i want to set up camp. havent gotten to go in game with it yet so i havent gotten a safe loc of my camp. thanks much for reply tho.
-
Joshjje
- orc pawn

- Posts: 18
- Joined: Mon Oct 27, 2003 2:39 pm
Post
by Joshjje » Sun Nov 23, 2003 9:50 am
If it hasnt been changed you cant declare paramaters like this, you dont declare any paramaters at all, just use @Param0, and @Param1 for the xloc and yloc in your code you would do it like this:
Code: Select all
Sub movetoloc
/face fast loc @Param0,@Param1
/return
/call movetoloc 100 100
That would call movetoloc with 100 as the xloc and yloc and face that location. Didnt check out the rest of your code
-
Neb
- decaying skeleton

- Posts: 4
- Joined: Sun Nov 23, 2003 3:48 am
- Location: Hell
Post
by Neb » Sun Nov 23, 2003 10:00 am
oh ok thanks. ill try this out.
-
Drunkensloth
- a lesser mummy

- Posts: 67
- Joined: Sat Oct 18, 2003 2:54 am
Post
by Drunkensloth » Sun Nov 23, 2003 4:03 pm
from the looks of it... your macro... calls that shopkeep is camped when someone says camp...
and runs to a brownie
it also just looks like a copy of plazmics spellcast.ini and grimjacks hunting mac, you might want to give credit
also what do you want this mac to do?
i posted in macrohelp something that you can just mod for your own purposes
its a caster hunting macro based off of grimjacks hunting mac using plazmics spellcast.ini and elretardo's necrofarm mods, it has a couple problems doing certian things, but you could take alook to see how things work
but post what you need help doing and i am sure some of the gurus and even some of the non gurus would love to help you
And here I was clicking like a sucker!
-
wassup
- Official Guardian and Writer of TFM

- Posts: 1487
- Joined: Sat Oct 26, 2002 5:15 pm
Post
by wassup » Sun Nov 23, 2003 6:19 pm
Joshjje wrote:
If it hasnt been changed you cant declare paramaters like this, you dont declare any paramaters at all, just use @Param0, and @Param1 for the xloc and yloc in your code you would do it like this:
Code: Select all
Sub movetoloc
/face fast loc @Param0,@Param1
/return
/call movetoloc 100 100
That would call movetoloc with 100 as the xloc and yloc and face that location. Didnt check out the rest of your code
The sub can take named parameters like he showed, it's just easier to use @Param0, @Param1 instead of defining variables inside the sub.
I'm just wondering if the lines of:
--------------------------------------------------------------------------------------
Are in his macro. If so remove them.
-
Drunkensloth
- a lesser mummy

- Posts: 67
- Joined: Sat Oct 18, 2003 2:54 am
Post
by Drunkensloth » Sun Nov 23, 2003 7:50 pm
or just comment them out
its an easy way to visually seperate different subs and hold places :)
And here I was clicking like a sucker!