Moderator: MacroQuest Developers


I don't think you can call main, never tried but it sounds totally wrong. You also never placed a /return in your main, try thisIceassassin wrote:Hmm.. My if statements don't work anymore.. Can anyone tell me whats wrong with this macro?
#include routines.mac
Sub Main
:loop
/call Heal
Sub Check
/if n $char(hp,pct)<100 /call Main
/if n $char(hp,pct)==100 /call End
/return
Sub Heal
/call check
/press 0
/delay 151
/goto :loop
/return
Sub End
/endmacro
/return

Zorg wrote:I seem to be having a different problem related it if, /if "$foo(argument)"=="TRUE" will evaluate correctly, but /if $foo(argument)==TRUE doesn't.
The problem is, other people don't seem to be having the same problem. Scripts posted in the depot using the second style of /if are running for at least some people.
readme a lovely thing/if <n> <condition> <command>
Runs a command if the condition is true. (n makes the compare numeric)
Condition understands comparison operators
== Equal to
!= Not Equal to
> < Greater than; less than
>= <= Greater than or equal to; Lesser than or equal to
~~ contains operator (string only)
!~ does not contain operator (string only)

I am a smart ass but at least I have good intentions. I did try to help you and event wrote a working macro for you to use. My suggestions were ment to help you and not to mock you. I am sorry if I made you feel smaller, that was not my intention.Zorg wrote:Problem solved, not through SingleServing's smartass answer, but for some reason the board was displaying the codes for < and > instead of the characters themselves, and I failed to notice.

No code brackets is what causes the problemMalachi wrote:I know EXACTLY what the problem is.
It's a failure to use code brackets....hehe.
~malachi
Code: Select all
< and >
Key word "other" MQ is written in VC++ =)AarynD wrote:Actually, /call Main is a legitimate construct in other programming languages (ie, functions meant to be called recursively)... It's doubtful MacroQest supports it. In either case, the call to main in the above code was not the proper use of a recursive call, as there is no "exit" back out of the recursion loop.
- Aaryn