My FletchMac (Generic) MQ2Data Compliant and working.

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

My FletchMac (Generic) MQ2Data Compliant and working.

Post by Fuergrissa » Fri Apr 23, 2004 1:29 pm

here is a mac i made up from taking bits and pieces from other macs and putting them all together, Thank you to all who contributed. This is the first mac i have shared with others i hope it helps, i welcome constructive critisism and any revisions to make a better mac.

Code: Select all

|===========================================|
| V1.0                                      |
|___________________________________________|
|fletch.mac MQ2Data Compliant by Fuergrissa |
|___________________________________________|

#Event SkillUp "You have become better at"
#Event nocomp "You are missing"
#Event SkillTrivial "You can no longer advance your skill from making this item"
#Event FullInventory "There was no place to put that" 
#Event SkillFailure "You lacked the skills" 
#Event SkillSuccess "You have fashioned the items together to create something new" 

Sub Main
      /declare SkillFailCounter global 
      /declare SkillSuccessCounter global
      /declare SuccessRate global 
      /declare TotalAttempts global 

      /varset SkillFailCounter 0 
      /varset SkillSuccessCounter 0
      /varset SuccessRate 0 
      /varset TotalAttempts 0 
   :mainloop
      /doevents
      /call Combine
      /goto :mainloop
      /end

Sub Combine
      /notify COMBW_CombineArea CombineButton leftmouseup
      /delay 2
      /if (${Cursor.ID}) /autoinv
      /return

Sub DisplayStats 
      /echo Combine Statistics - Successes: ${Int[@SkillSuccessCounter]}, Failures: ${Int[@SkillFailCounter]}
      /varcalc TotalAttempts @SkillFailCounter + @SkillSuccessCounter 
      /varcalc SuccessRate @SkillSuccessCounter / @TotalAttempts * 100 
      /echo Success Rate: ${Int[@SuccessRate]} % out of ${Int[@TotalAttempts]} attempts
      /zapvars 
      /return 

Sub Event_SkillUp(SkillUpText)
      /declare ParseSkillLevel local
      /declare ParseSkill local
      /declare PositionStart local
      /declare PositionEnd local
      /varset PositionStart ${Math.Calc[${String[@SkillUpText].Find[! (]}+3]}
      /varset PositionEnd ${String[@SkillUpText].Find[")"]}
      /varset ParseSkillLevel ${String[@SkillUpText].Mid[@PositionStart,${Math.Calc[@PositionEnd-@PositionStart]}]}
      /varset PositionStart ${Math.Calc[${String[@SkillUpText].Find[at]}+3]}
      /varset PositionEnd ${String[@SkillUpText].Find[!]}
      /varset ParseSkill ${String[@SkillUpText].Mid[@PositionStart,${Math.Calc[@PositionEnd-@PositionStart]}]}
      /popup "@ParseSkill increased - @ParseSkillLevel ..."
      /echo "@ParseSkill increased - @ParseSkillLevel ..."
      /return 

Sub Event_nocomp
      /echo "You have run out of Componants. ((Ending Macro)) "
      /popup You have run out of Componants. ((Ending Macro))   
      /if (${Cursor.ID}) /autoinv
      /call DisplayStats
      /end

Sub Event_SkillTrivial
      /echo "You can no longer advance your skill from making this item. ((Ending Macro))"
      /popup You can no longer advance your skill from making this item. ((Ending Macro))   
      /if (${Cursor.ID}) /autoinv
      /call DisplayStats
      /end

Sub Event_FullInventory 
      /echo "Your inventory is full, ((( Ending Macro ))) "
      /popup Your inventory is full, ((( Ending Macro )))
      /call DisplayStats 
      /end 

Sub Event_SkillFailure 
      /varadd SkillFailCounter 1 
      /return 

Sub Event_SkillSuccess 
      /varadd SkillSuccessCounter 1 
      /return 

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Post by Fuergrissa » Fri Apr 23, 2004 1:31 pm

I have fletching container in slot one and open, i buy all ingrediants needed select recipe then run mac.
it works 100% for me, hope its good for you.

bootyjuice
decaying skeleton
decaying skeleton
Posts: 7
Joined: Fri Jan 23, 2004 11:44 am

Post by bootyjuice » Sat Apr 24, 2004 4:44 pm

Very clean. I haven't tried it but the code is very readable and that's a rare thing in these forums I've found.

Nice job

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Post by Fuergrissa » Sat Apr 24, 2004 5:12 pm

Thank you for the support.

Married
decaying skeleton
decaying skeleton
Posts: 4
Joined: Sun Dec 21, 2003 12:31 am

Post by Married » Sun Apr 25, 2004 12:53 pm

I tried it, after you posted it for me on another post.
It works really well - if the item I am making is not trivial.

I generally only run /macro when I wish to make subcombines. I pretty much have all skills above 220. So I need something that won't stop working after trivials.

But awesome work, very well done!

User avatar
SimpleMynd_01
a lesser mummy
a lesser mummy
Posts: 71
Joined: Thu May 08, 2003 3:16 pm

Ghetto answer

Post by SimpleMynd_01 » Sun Apr 25, 2004 3:32 pm

A simple answer to your request is to just comment out this line so it will run until you run out of components or your inventory is full.

Code: Select all

#Event SkillTrivial "You can no longer advance your skill from making this item"
-SimpleMynd

Married
decaying skeleton
decaying skeleton
Posts: 4
Joined: Sun Dec 21, 2003 12:31 am

Post by Married » Mon Apr 26, 2004 1:06 am

Outstanding!

Simplemynd, thank you.

Mikilo
decaying skeleton
decaying skeleton
Posts: 1
Joined: Wed Oct 20, 2004 3:09 am
Contact:

Post by Mikilo » Sun Nov 28, 2004 9:48 pm

Works great...KISS seems the way to go... this was the simplist i tried but the only one i could get to work without tweaking

Cheers

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Post by Fuergrissa » Mon Nov 29, 2004 3:35 am

its allways a pleasure to see people get something from my work.
[quote]"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."[/quote]