Need help with a macro you are writing? Ask here!
Moderator: MacroQuest Developers
-
Draconis
- a lesser mummy

- Posts: 40
- Joined: Tue Mar 23, 2004 4:53 pm
Post
by Draconis » 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
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
}
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.
-
A_Druid_00
- Macro Maker Extraordinaire
- Posts: 2378
- Joined: Tue Jul 13, 2004 12:45 pm
- Location: Rolling on the Lawn Farting
Post
by A_Druid_00 » Tue Jan 18, 2005 8:54 pm
You need to work on your indentation when opening and closing /if statements. If you get a text editing program like Ultraedit, and use the syntax file posted here on the boards, your life will be a lot easier. He's what your macro looks like cleaned up with Ultraedit. Note that if your macro has no formatting errors, the last line should be against the left margin. You have a lot of extra brackets from what I can see.
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
}
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]
-
A_Druid_00
- Macro Maker Extraordinaire
- Posts: 2378
- Joined: Tue Jul 13, 2004 12:45 pm
- Location: Rolling on the Lawn Farting
Post
by A_Druid_00 » Tue Jan 18, 2005 9:00 pm
Here's a cleaned up version, to give you some perspective. Note that I got rid of the reduntant goto statement in the heal sub.
You can also lose all the /stand commands, EQ automatically stands you up to cast spels now.
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}
:CheckHealAgain
/if (${Target.PctHPs}<100) {
/cast ${Healspell}
/delay 1s
/goto :CheckHealAgain
}
/return
Last edited by
A_Druid_00 on Tue Jan 18, 2005 9:01 pm, edited 2 times in total.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]
-
Draconis
- a lesser mummy

- Posts: 40
- Joined: Tue Mar 23, 2004 4:53 pm
Post
by Draconis » Tue Jan 18, 2005 9:00 pm
Ok, ive just been using notepad and some of that code is pulled from other macros, maybe why it has extra {}. Now to find a copy of ultra edit.
-
A_Druid_00
- Macro Maker Extraordinaire
- Posts: 2378
- Joined: Tue Jul 13, 2004 12:45 pm
- Location: Rolling on the Lawn Farting
Post
by A_Druid_00 » Tue Jan 18, 2005 9:04 pm
There's like a 30 day free trial. I'd recommend registering a copy, if you plan on writing your own macros more than just screwing around. Some people prefer other text editors, ask around.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]
-
Draconis
- a lesser mummy

- Posts: 40
- Joined: Tue Mar 23, 2004 4:53 pm
Post
by Draconis » Tue Jan 18, 2005 9:25 pm
I put the stand code in because I have auto stand on cast turned off, turned it off after the 4th time my necro died while fd because ill mash fd and hit it too many times and stand back up.
I had a copy of ultra edit for doing either HTML or Hex editing, think i might still have a copy and key floating around one of my hardrives or back-ups. just have to find it.
-
JP5
- a lesser mummy

- Posts: 70
- Joined: Tue Jul 06, 2004 10:32 pm
Post
by JP5 » Wed Jan 19, 2005 3:33 pm
On the ultra-edited copy you were missing an end bracket near the beginning.