How to? /macro <name> <variable> ?

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

Neolesh
a hill giant
a hill giant
Posts: 231
Joined: Mon Aug 23, 2004 11:15 am

How to? /macro <name> <variable> ?

Post by Neolesh » Sat Sep 11, 2004 10:38 pm

Been looking at the documentation trying to figure out how this is done. Basically I want to declare an int variable from the command line when I start the macro much like genbot declares a master list?

How is this done? and don't go through too much trouble if it's complex. Perhaps just point me to a command I could look up in the documentation.

hytiek
Contributing Member
Contributing Member
Posts: 54
Joined: Mon Jun 14, 2004 5:45 pm

Post by hytiek » Sat Sep 11, 2004 11:29 pm

The following should help you understand how to accomplish what you are wanting:

Execute macro:

Code: Select all

/macro donate.mac 20
Macro code:

Code: Select all

/declare dollarAmount int outer

Sub Main

:verify
   /if (!${Defined[Param0]}) {
      /echo You must set a value to donate to MQ2 developers.
      /echo Any/all donations are accepted.
      /echo hytiek is not a developer but he will accept donations.
      /end
   } else {
      /varset dollarAmount ${Param0}
      /popup INCOMING: Explanation!
   }
   /goto :example

:example
   /echo Let's log off, and donate ${dollarAmount} to the MQ2 developers.
   /goto :example

:end
 /return
[/code]

Neolesh
a hill giant
a hill giant
Posts: 231
Joined: Mon Aug 23, 2004 11:15 am

Post by Neolesh » Sat Sep 11, 2004 11:37 pm

Thank you and I understand now :)

hiipii
a ghoul
a ghoul
Posts: 93
Joined: Sat Jun 19, 2004 5:01 pm

Post by hiipii » Sun Sep 12, 2004 3:11 am

why would you use /goto :example when :example is the next line? what are you trying to pull?! :D

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Re: How to? /macro <name> <variable> ?

Post by wassup » Sun Sep 12, 2004 3:36 am

Neolesh wrote:Been looking at the documentation trying to figure out how this is done. Basically I want to declare an int variable from the command line when I start the macro much like genbot declares a master list?

How is this done? and don't go through too much trouble if it's complex. Perhaps just point me to a command I could look up in the documentation.
The other example isn't quite right

To do what you want to do:

/macro mymacro 20

Code: Select all

Sub Main(int myValue)
   /echo Parameter Value: ${myValue}
/return
The value of 20 will be in the parameter myValue when the macro is started.

You can declare an int variable inside Sub Main that can hold the value for the parameter myValue:

Code: Select all

Sub Main(int myValue)
   /declare intValue int outer ${myValue}
   /echo Parameter Value: ${intValue}
/return
You may want to take a look in the readme.chm for the difference between local, outer, and global variables.

hytiek
Contributing Member
Contributing Member
Posts: 54
Joined: Mon Jun 14, 2004 5:45 pm

Post by hytiek » Sun Sep 12, 2004 2:28 pm

bah! was late in the night, trying to have a laugh to stay awake!

FrankJScott
naggy
naggy
Posts: 2349
Joined: Sun Feb 19, 2023 7:11 am

Great Tajir4d Slot Website

Post by FrankJScott » Mon Nov 24, 2025 1:54 pm

In reply to the people asking about bandar judi slot online terbaik, situs bandar judi slot, 666 casino login, pragmatic slot88, judi slot sgp, main mesin judi, link judi slot online terbaru, main game slot, promo pragmatic play, city slot online, I highly recommend this for beginners for tajir4d forum or link main slot, asia slot online, rtp slot malaysia, situs slot 24 jam online, web slot online, website judi indonesia, jackpot judi slot online, game judi online slot, game slot apa, slot 4d login, alongside all this recommended reading for tajir4d info bearing in mind singapore slot online, promo pragmatic play, sini slot link alternatif, sistem slot online, casino online login, main judi slot, game judi indonesia, slot yg, slot source, judi slot online terbaru, together with this web site on tajir4d slot tips which is also great. Also, have a look at this her explanation on tajir4d tips together with toto judi, city slot online, game pragmatic play, agen judi slot slot online, bonus live casino, pragmatic slot88, judi game slot online, slot online idn, slot saja, main game slot online, on top of this moved here for tajir4d login advice alongside all login judi slot, play tech slot, sg metro slot, io slot, online slot indonesia, recommended site for alongside all situs bandar judi, jago slots, live judi slot online, rp casino, link judi online, for good measure. Check more @ Great TAJIR4D Info 8dec9a8

FrankJScott
naggy
naggy
Posts: 2349
Joined: Sun Feb 19, 2023 7:11 am

Excellent Bet365 Free Bets Sign Up Offer Blog

Post by FrankJScott » Thu Nov 27, 2025 9:28 am

To the man talking about best online betting promotions, bet 365 bets, free bets telegraph, new sports betting websites, best bet in the world, william hill england, live football on betting sites, free bet after registration, bet 5 get free bet, english bookmakers online, I highly recommend this cool bet365 free bets sign up offer advice or latest bookmakers, top 5 bookmakers, bookmakers prices, william hill 10 for 50, online sports betting bonus, bet 5 get 40, bet365 casino welcome bonus, best welcome bonus sports betting, best bookies and betting sites, top 10 sports betting, bearing in mind this see page about bet365 free bets sign up offer forum not forgetting sites such as betting list, quinnbet free spins, bet365 live play, 100 first deposit bonus, bet credits, best betting sites no deposit required, betting website offers, best online bookies, free betting games no deposit, new online betting companies, alongside all this straight from the source about bet365 free bets sign up offer forum which is also great. Also, have a look at this website about bet365 free bets sign up offer url bearing in mind open betting account, betting list, paddy power sign up, new bookmakers, bookmaker offers cheltenham, gambling free bets, bet 5 pound get free bets, best football gambling sites, bet365 odds boost, uk casino deposit bonus, together with this see page on bet365 free bets sign up offer details and don't forget 888 sport welcome offer, unibet deals, betting for profit, bet uk new customer offer, bet365 bonus registration, bonuses about as well as grand national betting offers existing customers, free bet for joining no deposit, live betting site, bookies welcome bonus, bet without deposit, for good measure. Check more @ Great Bet365 Bonus Code ONTHEBALL Website 3c8dec9