My first attempt

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

Moderator: MacroQuest Developers

Binky
decaying skeleton
decaying skeleton
Posts: 4
Joined: Tue Aug 05, 2003 11:31 pm

My first attempt

Post by Binky » Fri Sep 05, 2003 12:21 am

Ok here is my first rather pathetic attempt at a self-created macro...

Code: Select all

#turbo

#event invite "invites you to join a group."
#event junk "You have scrounged up something that doesn't look edible."
#event killed "LOADING, PLEASE WAIT..."

Sub Main

   :Loop

   /delay 50
   /if n $char(ability,Forage)>0 /doability Forage
   /click left auto
   /goto Loop

/return

Sub Event_invite

   /invite
   /delay 10
   /g Hello!  =)  Me going afk again!
/return

Sub Event_junk

   /click left destroy
/return

Sub Event_killed

   /sit
   /camp desktop

/return

What I'm trying to get it to do, basically, is sit there and forage stuff. If it forages up junk, it destroys it. If someone invites to group, it joins, sends a little message, and chugs along as usual. If I die, it logs off.

The only problems I have is that, well, it doesn't forage, it doesn't loop, and it doesn't join groups. Given that track record I didn't decide to die and see if it would log me off. *grin*

Could anyone kinda give me some tips on what I'm doin wrong? As I said, it's my first attempt at anything and I kinda stole a bunch of code snips from other macros and put 'em all together in here, but that obviously wasn't a good idea... :)

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Fri Sep 05, 2003 12:48 am

Ok, the first thing that jumps out at me is your loop.

Code: Select all

   /goto Loop
should be

Code: Select all

   /goto :Loop

The second thing is your events will never happen without putting /doevents somewhere.

Those should fix the problems you are having. Without some logic changes it won't ever destroy anything though. You have it clicking the auto box right after it activates the forrage skill. You may want to have it check if there is anything on the cursor and if it is something you want to keep or not before doing that.

Thanks
GrimJack
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

slimjim
a ghoul
a ghoul
Posts: 94
Joined: Thu Oct 17, 2002 4:05 pm

Post by slimjim » Fri Sep 05, 2003 2:06 am

yea, you need a /doevents inside your loop and /goto :Loop.

Also, if you want to test to see if you camp when you die just gate or zone, it will still do LOADING, PLEASE WAIT...

Im not sure if MQ waits for you to zone to finish the macro or not, but if it were me i would put in a /delay 200 or so as first thing in your Event_killed to make sure you are done zoning before it tries to initiate the camp sequence.

Valerian
a grimling bloodguard
a grimling bloodguard
Posts: 709
Joined: Sun Jul 28, 2002 3:29 am

Post by Valerian » Fri Sep 05, 2003 8:09 am

or make that event trigger on "You have entered "

Shin Noir
a ghoul
a ghoul
Posts: 90
Joined: Tue Aug 05, 2003 8:18 pm

Post by Shin Noir » Sat Sep 06, 2003 4:56 am

or or!

Code: Select all

/varset CurZone $zone
at start

then in the loop somewhere go

Code: Select all

/if "CurZone"!="$zone" /call Event_killed
yaa !

sleepy.