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