parameters...

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

cybernerd
a lesser mummy
a lesser mummy
Posts: 38
Joined: Tue May 13, 2003 11:05 pm

parameters...

Post by cybernerd » Sat Mar 06, 2004 3:00 am

I must be thinking dumb tonight or something. I want to be able to run a macro and have it loop the number of times I request, for instance..


/macro runme 100


That would cause the loop to run 100 times, but how the heck do I pass the parameter? I'm at a loss and I can't figure out the new system. I'm figuring it goes something similar to this...


/sub main
/for x 1 to @Param0
/echo doesallmycraphere
/next x
/return

Can someone tell me what kind of crack im on. Watch some noob with like 5 posts know the answer to this. Thank you to whomever educates me.

-The Nerd :lol:

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Sat Mar 06, 2004 5:44 am

Code: Select all

Sub Main 
/declare x local
/for x 1 to @Param0 
/echo doesallmycraphere 
/next x 
/endmacro
/return 
Last edited by ml2517 on Sat Mar 06, 2004 12:45 pm, edited 1 time in total.

smelly wang
a lesser mummy
a lesser mummy
Posts: 54
Joined: Mon Jan 19, 2004 6:04 pm

Post by smelly wang » Sat Mar 06, 2004 5:47 am

Code: Select all

/sub main
should be

Code: Select all

sub main
and yea, you need to declare variables.

cybernerd
a lesser mummy
a lesser mummy
Posts: 38
Joined: Tue May 13, 2003 11:05 pm

Post by cybernerd » Sat Mar 06, 2004 12:23 pm

Well, I didn't realize I typed the / for sub main line, but I forgot to declare the variables :P. Dumb me. I'm not used to declaring them and I thought if you defined them that they were global. Thanks for your help everyone!

-The Nerd :lol:

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Sat Mar 06, 2004 12:50 pm

smelly wang wrote:

Code: Select all

/sub main
should be

Code: Select all

sub main
and yea, you need to declare variables.
doh.. thats what I get for responding in the middle of the night