frustrated....

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

Shali
a ghoul
a ghoul
Posts: 87
Joined: Sun Dec 07, 2003 12:39 pm

frustrated....

Post by Shali » Thu Dec 11, 2003 4:17 pm

getting kinda frustrated here....shown in the code below in the "Sub main" part of it, i tell it to check if those certain events have happened, and go on to the corresponding part once they happen, if none of the events happen, it is supposed to return to the :Combine2 as stated, yet when i run it, many times it will go on to the next part without the listed events ever happening, severely screwing up with macro, can anyone explain why it might be doing this?


event defines:

Code: Select all

#event COMBINE_LackedSkills "You lacked the skills to fashion the items together." 
#event COMBINE_Success "You have fashioned the items together to create something new!"
code in Sub Main:

Code: Select all

:WaitforCombine2
/doevents Combine_LackedSkills
/doevents Combine_Success
/if $return=="fail1" /goto :Make 
/if $return=="fail2" /goto :MakeBlock
/if $return=="success1" /goto :ClickAuto1 
/if $return=="success2" /goto :ClickAuto2
/goto :Combine2
event subs:

Code: Select all

Sub Event_Combine_LackedSkills
    /varadd COMBINE_LackedSkills 1
    /if @y==1 /return "fail2"
/return "fail1"

Sub Event_Combine_Success
    /varadd COMBINE_Success 1
    /if @y==1 /return "success2"
/return "success1"

thanks in advance

Shali
a ghoul
a ghoul
Posts: 87
Joined: Sun Dec 07, 2003 12:39 pm

re

Post by Shali » Thu Dec 11, 2003 5:06 pm

ok, i tried adding in some combine attempts after the /if return lines so that it would attempt the combine twice more before re running the events, ill test it now

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Thu Dec 11, 2003 5:56 pm

Code: Select all

:WaitforCombine2
/doevents Combine_LackedSkills
/echo first doevents returns $return
/doevents Combine_Success
/echo second doevents returns $return
/if $return=="fail1" /goto :Make
/if $return=="fail2" /goto :MakeBlock
/if $return=="success1" /goto :ClickAuto1
/if $return=="success2" /goto :ClickAuto2
/goto :Combine2

Shali
a ghoul
a ghoul
Posts: 87
Joined: Sun Dec 07, 2003 12:39 pm

re

Post by Shali » Thu Dec 11, 2003 6:08 pm

wow, thanks a bunch, fixed it, dont know what it does, guess it tells it to do the first event before proceeding /shrug, but it def fixed that part :D , now i got a prob about it for some reason continueing to attempt a combine when it has already placed the products in my bag

*edit* scratch that, fixed that prob, had it checking to see if number of products before and after were the same even if it failed the combine to get alternate products =P*edit*

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Thu Dec 11, 2003 6:57 pm

Before I brand you an idiot, where do you think the $return variable is set?

User avatar
FreQuency
a hill giant
a hill giant
Posts: 215
Joined: Tue Sep 23, 2003 6:03 pm

Post by FreQuency » Thu Dec 11, 2003 7:16 pm

Before I brand you an idiot, where do you think the $return variable is set?
/snicker