my fd mac, comment please (missing code added)

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

Moderator: MacroQuest Developers

bugcoder
orc pawn
orc pawn
Posts: 26
Joined: Mon Nov 04, 2002 1:11 am

my fd mac, comment please (missing code added)

Post by bugcoder » Fri Dec 27, 2002 3:19 pm

Code: Select all

#event FDFail "has fallen to"

#define FdFail v14

Sub FD
	:fdloop
	/vaarset FdFail 0
	/if $char(ability,"Feign Death")>0 /doability "Feign Death"
	/doevents
	/if n $FdFail==1{
		/sit off
		/face
		/goto :fdloop
	}
/return

sub Event_FDFail
	/echo "broke hip"
	/varset FdFail 1 
/return
The idea is to call this puppy when I want to fd. If it fails, I stand up and face the mob like a man till I fd again. Each time I reset the FdFail to 0. Now if fd ability is already used when I first call this routine, I am hosed. Any tips?

edited my damn buggy code again
Last edited by bugcoder on Thu Jan 02, 2003 2:47 pm, edited 2 times in total.

YKW-28983
a hill giant
a hill giant
Posts: 252
Joined: Sun Dec 01, 2002 11:37 pm

Re: my fd mac, comment please

Post by YKW-28983 » Fri Dec 27, 2002 7:04 pm

edited my damn buggy code
"/vaarset FDFail 0"

and you forgot to #define FdFail v##

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

Re: my fd mac, comment please

Post by SingleServing » Sat Dec 28, 2002 11:50 pm

bugcoder wrote:

Code: Select all

Sub FD
	:fdloop
	/vaarset FdFail 0
	/if $char(ability,"Feign Death")>0 /doability "Feign Death"
	/doevents
	/if n $FdFail==1{
		/sit off
		/face
		/goto :fdloop
	}
/return
The idea is to call this puppy when I want to fd. If it fails, I stand up and face the mob like a man till I fd again. Each time I reset the FdFail to 0. Now if fd ability is already used when I first call this routine, I am hosed. Any tips?

edited my damn buggy code

What events are you running?
What sets FDFail to 1 if it fails the events maybe?
Where is the rest of the code, sub main anybody maybe some include and define statements also?
[color=DarkBlue]Everything,[/color] [color=DarkBlue][b]is[/b][/color] [color=black]black[/color] [color=DarkBlue]and[/color] [color=white]white[/color][color=DarkBlue], when you zoom out it looks[/color] [color=gray]grey[/color][color=DarkBlue].[/color]

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

Post by L124RD » Sun Dec 29, 2002 2:30 pm

Salutations,
I would use an event for setting FDfail... and you need a define for FDfail as well...

bugcoder
orc pawn
orc pawn
Posts: 26
Joined: Mon Nov 04, 2002 1:11 am

arg I am a damn lazy bastard

Post by bugcoder » Tue Dec 31, 2002 2:02 am

/sigh I left out bunch of stuff it's added now.

So the idea is that when fd is called, it would try till it's successful. However, if me being an idiot and pressed fd myself prior to the fd call and it failed, the macro would have no idea that I have fded and failed already. In addition, if the macro calls the fd before it refreshes, it would acutally intepret the absence of response as success.

This of course doesn't happen often. I am just perturbed by the none robustness of the code. NEway, comments please. Hopefully the code is complete enough. Thanks

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

Re: my fd mac, comment please (missing code added)

Post by SingleServing » Sat Jan 04, 2003 1:28 am

bugcoder wrote:

Code: Select all

#event FDFail "has fallen to"

#define FdFail v14

Sub FD
	:fdloop
	/vaarset FdFail 0
	/if $char(ability,"Feign Death")>0 /doability "Feign Death"
	 :idea: /doevents :idea: 
	/if n $FdFail==1{
		/sit off
		/face
		/goto :fdloop
	}
/return

sub Event_FDFail
	/echo "broke hip"
	/varset FdFail 1 
/return
The idea is to call this puppy when I want to fd. If it fails, I stand up and face the mob like a man till I fd again. Each time I reset the FdFail to 0. Now if fd ability is already used when I first call this routine, I am hosed. Any tips?

edited my damn buggy code again
I would change it to :arrow: /doevent FDFail instead of /doevents just to be on the safe side.

Also, your defining FDFail as v14 AND making an event FDFail that may cause some problems..

Going through your code, I found varset mispelled and no space between your your /if and the { that can cause problems...

Here try this, I pulled this out of my ... so might need some debugging.

Code: Select all

#include routines.mac

#event FDFail "has fallen to"
#define FDCheck v14

Sub Main

/sit off

:Loop

/varset FdFail 0

|Fd if you can here and make sure you didn't fail

/if $char(ability,"Feign Death")>0 {
	/doability "Feign Death"
	/doevent FDFail
} else {
	/call TryNLive
	/delay 5
	/goto :Loop
}

|If you did fail do this

/if n $FdFail==1 {
	/sit off
	/face
	/attack on
	/call TryNLive
	/if $char(ability,"Flying Kick")>0 /doability "Flying Kick"
	/delay 3s
	/attack off
	/face away
	/sendkey down up
	/delay 15
	/sendkey up up
	/goto :Loop
}

/return

|***********************************************************|

Sub Event_FDFail
	/mqlog FD Failed!!
	/varset FdFail 1 
/return

|***********************************************************|

Sub TryNLive

/if n $char(hp,pct)<45 /disc Stone

/if n $char(hp,pct)<25 {
	 /if $char(ability,"Mend")>0 {
		/doability "Mend"
	}
}

/return

[color=DarkBlue]Everything,[/color] [color=DarkBlue][b]is[/b][/color] [color=black]black[/color] [color=DarkBlue]and[/color] [color=white]white[/color][color=DarkBlue], when you zoom out it looks[/color] [color=gray]grey[/color][color=DarkBlue].[/color]

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

Post by L124RD » Sat Jan 04, 2003 5:59 am

Salutations,
all I have to say is: NO! NO NO NO NO NO! ok now that I've done that I correct it...

Code: Select all

#include routines.mac

#event FDFail "has fallen to"
#define FDCheck v14

Sub Main

/sit off

:Loop

|FDfail isn't a variable, I think you meant FDCheck...
/varset FDCheck 0

|Fd if you can here and make sure you didn't fail

/if $char(ability,"Feign Death")>0 {
   /doability "Feign Death"
   | you can't only check a single event...
   /doevents
} else {
   /call TryNLive
   /delay 5
   /goto :Loop
}

|If you did fail do this

/if n $FDCheck==1 {
   /sit off
   /face
   /attack on
   /call TryNLive
   /if $char(ability,"Flying Kick")>0 /doability "Flying Kick"
   /delay 3s
   /attack off
   /face away
   /sendkey down up
   /delay 15
   /sendkey up up
   /goto :Loop
}

/return

|***********************************************************|

Sub Event_FDFail
   /mqlog FD Failed!!
   /varset FDCheck 1
/return

|***********************************************************|

Sub TryNLive
| wtf does /disc do?
/if n $char(hp,pct)<45 /disc Stone
/if n $char(hp,pct)<25 /if $char(ability,"Mend")>0 /doability "Mend"
/return 
I think i caught most problems /disc still confuzzles me...

eqaddict
a lesser mummy
a lesser mummy
Posts: 74
Joined: Sun Sep 15, 2002 10:05 pm

Post by eqaddict » Sat Jan 04, 2003 6:37 pm

Monks get disciplies, or disc for short, at lvl 30 which are short term events that are triggered from the command line. The stone stance (lvl 51 disc) is given below ala castersrealm. You take a lot less damage while this discipline is active which increases the changes that you survie while waiting for FD to repop.

-EQA

Class: Monk
Level obtained: 51
Duration: 12 seconds.
Re-Use Delay: 12 minutes.
Re-Use Delay at Level 60: 3 minutes.
Discipline Description:
When using this discipline the monk will take roughly 1/10th damage from most physical attacks. This discipline lasts for 12 seconds and has a base reuse time of 12 minutes. The reuse time for this discipline will decrease as the monk gains additional levels.

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

Post by L124RD » Sat Jan 04, 2003 8:21 pm

Salutations,
ah ok, thank you for helping my lvl 50+ level knowledge... makes absolute sense.

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

Post by SingleServing » Sat Jan 04, 2003 8:52 pm

L124RD wrote:Salutations,
all I have to say is: NO! NO NO NO NO NO! ok now that I've done that I correct it...

Code: Select all

|FDfail isn't a variable, I think you meant FDCheck...

| you can't only check a single event...

Yes, I mentioned that FDFail should not be a function and a var just forgot to correct it from origonal code. Thnx

Also,

You can only do one event? Hmm I'm sure I picked that up from someone elses code.. thanks for the info

And...

I noticed you changed the if { if { blah } } statement at the end is that b/c it won't work or just simplicity?
[color=DarkBlue]Everything,[/color] [color=DarkBlue][b]is[/b][/color] [color=black]black[/color] [color=DarkBlue]and[/color] [color=white]white[/color][color=DarkBlue], when you zoom out it looks[/color] [color=gray]grey[/color][color=DarkBlue].[/color]

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

Post by L124RD » Sat Jan 04, 2003 8:53 pm

Salutaitions,
simplicity, I don't like using curly brackets if they're not needed in MQ#

bugcoder
orc pawn
orc pawn
Posts: 26
Joined: Mon Nov 04, 2002 1:11 am

Thank you

Post by bugcoder » Mon Jan 06, 2003 4:49 pm

Thanks for showing me the finer point of coding. I appreciate all the comments. Now I am off FDing away.

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

Re: Thank you

Post by SingleServing » Mon Jan 06, 2003 9:31 pm

bugcoder wrote:Thanks for showing me the finer point of coding. I appreciate all the comments. Now I am off FDing away.
What macro are you using? Did you try mine? (/edited version) Or if you wrote a different one post it.
[color=DarkBlue]Everything,[/color] [color=DarkBlue][b]is[/b][/color] [color=black]black[/color] [color=DarkBlue]and[/color] [color=white]white[/color][color=DarkBlue], when you zoom out it looks[/color] [color=gray]grey[/color][color=DarkBlue].[/color]

bugcoder
orc pawn
orc pawn
Posts: 26
Joined: Mon Nov 04, 2002 1:11 am

I use my own stolen crappy code

Post by bugcoder » Tue Jan 07, 2003 1:56 pm

:twisted: Well, I basically read the codes you guys shown me and try to come up with one that I understand. I hate using things that I don't understand. I'll post the final version of my part crappy part stolen code in a couple of days when I have time to get back on EQ. Thanks again everyone.

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

Re: I use my own stolen crappy code

Post by SingleServing » Tue Jan 07, 2003 8:13 pm

bugcoder wrote::twisted: Well, I basically read the codes you guys shown me and try to come up with one that I understand. I hate using things that I don't understand. I'll post the final version of my part crappy part stolen code in a couple of days when I have time to get back on EQ. Thanks again everyone.
If you have questions on parts you don't understand go ahead and ask. No reason to limit yourself to only what you havn't asked yet
[color=DarkBlue]Everything,[/color] [color=DarkBlue][b]is[/b][/color] [color=black]black[/color] [color=DarkBlue]and[/color] [color=white]white[/color][color=DarkBlue], when you zoom out it looks[/color] [color=gray]grey[/color][color=DarkBlue].[/color]