How do I set up /call Sub for an echo

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

Moderator: MacroQuest Developers

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

How do I set up /call Sub for an echo

Post by Draekz » Fri Oct 04, 2002 12:36 pm

Im trying to set up a call sub for an echo but it doesnt seem to initiate the /echo ..but also doesnt give me an error?

Here's the code..

Code: Select all

|warfight.mac
|Warrior /doabilities
|
|Author: Draekz
#turbo

Sub Main
/echo Warrior Skills macro Started...
:NoFight
/delay 1
/if "$combat"=="TRUE" /varset v1 1 /call Fight{
/goto :Loop
}else /if "$combat"!="TRUE" /varset v1 0 /call Fight{
/goto :NoFight
}

/return

Sub LoopStart
:Loop
/delay 1
/doability 10
/delay 9s
/if "$combat"!="TRUE" {
/goto :NoFight
}
/doability "Kick"
/delay 9s
/if "$combat"!="TRUE" {
/goto :NoFight
}
/doability "Taunt"
/delay 8s
/if "$combat"=="TRUE" {
/goto :LoopStart
}else /if n "$combat!"="TRUE" {
/goto :NoFight
}

/return

Sub Fight

/if $v1==0 {
/echo Fighting Ceased
/goto :NoFight
}else /if $v1==1 {
/echo Fighting Initiated
/goto :Loop
}

/return
The rest of the code works the way i want it to but i cant seem, for the life of me, to get the damn /echo's to work lol...and come to think of it..none of the echo's in ANY of my macro's echo :P so mebbe if anyone can help here it'd fix that hehe

Thanks!

Draekz

Silvak
orc pawn
orc pawn
Posts: 10
Joined: Mon Sep 30, 2002 5:04 pm

Post by Silvak » Fri Oct 04, 2002 3:09 pm

Haven't done much programming with MQ but I would guess that the statement you want echo'd to the client needs to be in Quotes...

S_B_R
a lesser mummy
a lesser mummy
Posts: 72
Joined: Tue Jul 30, 2002 11:12 am

Post by S_B_R » Fri Oct 04, 2002 3:27 pm

When compairing Numeric values you need an "n" in your /if statements, i.e.:

Code: Select all

/if n $v1==0
/if n $v1==1
[b]dd if=/dev/zero of=/dev/hda[/b]

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

Post by Draekz » Fri Oct 04, 2002 4:08 pm

ahhh ok thanks S_B_R

That worked :P

Draekz