/varadd /varsub and /for

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

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

/varadd /varsub and /for

Post by grimjack » Fri Oct 03, 2003 10:50 am

With the new variable setup these seem to currently not be working for me. Has anyone else seen a problem with these?

Thanks
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

LordGiddion
a snow griffon
a snow griffon
Posts: 352
Joined: Sat Sep 13, 2003 6:12 pm
Contact:

Post by LordGiddion » Fri Oct 03, 2003 1:46 pm

I tested this code and got the results I expected.
Counted up from 1 to 20 twice and then 19 to 0

Code: Select all

sub main
	/declare counter Global
	/varset counter 0
	:loop
		/varadd counter 1
		/echo @counter 
	/if n @counter<20 /goto :loop

	/for counter 1 to 20
		/echo @counter 
	/next counter

	/varset counter 20
	:loop2
		/varsub counter 1
		/echo @counter 
	/if n @counter>0 /goto :loop2
	
/return

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Fri Oct 03, 2003 8:53 pm

There is a minor bug in /for... it converts the loop variable to lowercase (variables are case sensitive).

I have no clue why /varadd or /varsub would give you any trouble...
- Plazmic

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

Post by grimjack » Fri Oct 03, 2003 10:49 pm

It turned out to be just the /for. After changing to an all lower case variable it seems to work.
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

User avatar
Curious
a ghoul
a ghoul
Posts: 88
Joined: Wed Aug 27, 2003 5:19 am

Post by Curious » Mon Oct 06, 2003 4:37 am

Do we need to code our variables in lower-case, or will the /if command be changed to support upper?

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Mon Oct 06, 2003 10:35 am

sorry, nobody noticed this until now? ;(
- Plazmic

FrankJScott
a grimling bloodguard
a grimling bloodguard
Posts: 1568
Joined: Sun Feb 19, 2023 7:11 am

Updated Natural Pet Supplements Website

Post by FrankJScott » Thu Apr 10, 2025 11:27 am

For the guy talking about dog mat outdoor, keep my pet, dog from home, dog with an umbrella, pet you, dog misting fan, summer pet beds, summer dog boarding, dog cooler for car, shade for dog water bowl, I highly suggest this on the main page on natural pet supplements link or with your dog, dog water cooling mat, dog beds for the summer, pup training, dog portable water, you as a dog, dog needs, cooling fan for dog, dog fur care, keep my dog, as well as this a fantastic read for natural pet supplements url bearing in mind my dog s, dog cubes, dog for dog bed, leaving a dog, break dog, best dog beds for hot weather, dog rescue tips, pup for home, help dogs in need, make my dog, not forgetting sites such as this additional reading for natural pet supplements forum which is also great. Also, have a look at this on front page about natural pet supplements url not to mention keep dog from overheating, dog re, pet safe for dogs, choose your pet, your dog, create your dog, if dog, my dog boarding, rescue dog care, dog and dog, on top of this agree with on natural pet supplements advice not forgetting sites such as walk about dog, water filled dog cooling mat, walk the dog, dog shade umbrella, dog shade, learn more here about alongside all dogs with owners, best dog tips, leaving your dog at home, over heat in dogs, pet dogs, for good measure. Check more @ Updated Penile Rejuvenation Therapy In Sarasota Site a61d1ac