First real macro, loop problem
Posted: Tue Jan 18, 2005 8:48 pm
This is my first attempt at a real macro that can be used by others if they want, but im having an odd problem and I dont see why im getting it.
problem detailed under code
Here at the end of the macro where the healing sub is when i give the bot the heal command it will heal, but It wont sit no errors it just stands there but will continue if i give it another command, im thinking something with the else statement but it looks right to me.
also this is a cleaned up version of my 1st. All the vars and some commands are in but have yet to be tested , but I think they should all work If something is wrong please feel free to flame / point it out.
problem detailed under code
Code: Select all
| Plassist.mac
|
| syntax:
| /macro Plassist <Masters Name>
| Example:
| /macro Plassist Newbie
|
#event DS1 "#*#Need DS1#*#"
#event DS2 "#*#Need DS2#*#"
#event Heal "#*#Need Heal#*#"
#event HPbuff "#*#Need HP buff#*#"
#event strbuff "#*#Need str#*#"
#event sow "#*#Need Sow#*#"
#event sit "#*#Sit down#*#"
#event camp "#*#Camp now#*#"
#event Info "#*#Need Info#*#"
Sub Main
/echo PL assistant Started
/declare Master string Global
/declare DS1 string Global
/declare DS2 string Global
/declare Healspell string Global
/declare strbuff string Global
/declare HPbuff string Global
/declare Sowspell string Global
/varset Master ${Param0}
|----------------------
|Edit spells here
|----------------------
/varset DS1 "Shield of Thistles"
/varset DS2 "Riftwind's Protection"
/varset Healspell "Healing"
/varset strbuff "Strength of Earth"
/varset HPbuff "Skin like Steel"
/varset Sowspell "Spirit of Wolf"
/echo Syntax for requesting buffs...
/echo /tell <bot's name > <Command>
/echo "Need DS1" : to cast ${DS1}
/echo "Need DS2" : to cast ${DS2}
/echo "Need Heal" : to cast ${Healspell}
/echo "Need Str" : to cast ${strbuff}
/echo "Need HP buff" : to cast ${HPbuff}
/echo "Need Sow" : to cast ${Sowspell}
/echo ------------------------------------------------------
/echo Syntax for misc stuff...
/echo "Camp Now" : to have bot camp and end the macro
/echo "Need Info" : to have bot display HP and Mana %
/echo "Sit Now" : to have bot sit down
:loop
/doevents
/delay 2
/goto :loop
/return
Sub Event_camp
/camp
/delay 5s
/endmac
/return
|--------------------------------
Sub Event_Info
/tell ${Master} I have % ${Me.PCTHps} HP and % ${Me.PCTMana}
/return
|--------------------------------
Sub Event_sit
/if (${Me.State.NotEqual[SIT]}) {
/sit
/delay 5
/return
|--------------------------------
Sub Event_DS1
/if (${Me.State.NotEqual[STAND]}) {
/stand
/delay 5
}
/tar ${Master}
/cast ${DS1}
/delay 10s
/sit
/return
|--------------------------------
Sub Event_DS2
/if (${Me.State.NotEqual[STAND]}) {
/stand
/delay 5
}
/tar ${Master}
/cast ${DS2}
/delay 10s
/sit
/return
|--------------------------------
Sub Event_sow
/if (${Me.State.NotEqual[STAND]}) {
/stand
/delay 5
}
/tar ${Master}
/cast ${Sowspell}
/delay 10s
/sit
/return
|--------------------------------
Sub Event_HPbuff
/if (${Me.State.NotEqual[STAND]}) {
/stand
/delay 5
}
/tar ${Master}
/cast ${HPbuff}
/delay 10s
/sit
/return
|--------------------------------
Sub Event_strbuff
/if (${Me.State.NotEqual[STAND]}) {
/stand
/delay 5
}
/tar ${Master}
/cast ${strbuff}
/delay 10s
/sit
/return
|--------------------------------
Sub Event_Heal
{
/tar ${Master}
/goto :heal
:healtest
/if (${Target.PctHPs}<100) {
/goto :heal
} else {
/sit
/delay 5
/return
}
:heal
/cast ${Healspell}
/delay 1s
/goto :healtest
}
also this is a cleaned up version of my 1st. All the vars and some commands are in but have yet to be tested , but I think they should all work If something is wrong please feel free to flame / point it out.