doability.mac -- Do up to 4 abilities at the same time

Macro depository for macros written before the user variable changes that broke all of them.

Moderator: MacroQuest Developers

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

doability.mac -- Do up to 4 abilities at the same time

Post by L124RD » Sun Dec 01, 2002 11:55 pm

Salutations,

Code: Select all

sub main
/varset v0 $char(skill,"$p0")
/varset v1 $char(skill,"$p1")
/varset v2 $char(skill,"$p2")
/varset v3 $char(skill,"$p3")
:loop
/if "$p0"!="" {
 /call doability $p0 $v0
 /if n $return!=-1 /varset v0 $return
}
/if "$p1"!="" {
 /call doability $p1 $v1
 /if n $return!=-1 /varset v1 $return
}
/if "$p2"!="" {
 /call doability $p2 $v2
 /if n $return!=-1 /varset v2 $return
}
/if "$p3"!="" {
 /call doability $p3 $v3
 /if n $return!=-1 /varset v3 $return
}
/doevents
/goto :loop
/return

sub doability
/if n $char(ability,"$p0")>0 /doability "$p0"
/if n $p1!=$char(skill,"$p0") {
/echo You've gained a level in $p0 ($char(skill,"$p0"))
/return $char(skill,"$p0")
}
/return -1
use something along the lines of :
/macro doability "Sense Heading" "Mend"
and it will do Sense Heading and Mend... yeah...

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Mon Dec 02, 2002 12:11 am

Salutations,
I'm so stupid... updated for those of you who downloaded it...

User avatar
SingleServing
a hill giant
a hill giant
Posts: 195
Joined: Tue Dec 17, 2002 11:00 pm

Wrong forum but good example of usage...$p0

Post by SingleServing » Sun Dec 22, 2002 4:48 am

When using $p0, $p1, etc... Does whatever you pass have to always be in double quotes or is that only for strings?

/macro doability "Sense Heading" "Mend"

if we did this as a number would you do

/macro doability 1 2 3 4

or

/macro doability "1" "2" "3"...

How many things may $pX? can you have $p99?

How do $pX and /returns work together, and can you call functions without using the call command. Lets say I want to set v2 to 30 and make v1 always equal v2 plus 10 then divide that by 4 and store that back into v1.

Code: Select all

Sub Main

/varset v2 30

/varset v1 Routine $v2 (/call routine $v2)

/echo $v1

/return

Sub Routine

/varcalc v3 ($p0+10)/4

/return v3
Also if you call this function as

/macro doability "Sense Heading" "Mend"


$p0=="Sense Heading"
$p1=="Mend"

if within that function you called another subroutine

Code: Select all

/call Ability $p3

<code>

/return
does this store $p3 into $p0 being that this was the first value passed or are the values of $pX set?


I hope this makes sense :oops: