Tradeskills macro

Have a macro idea but not sure where to start? Ask here.

Moderator: MacroQuest Developers

Tigger7833
decaying skeleton
decaying skeleton
Posts: 2
Joined: Sun Oct 10, 2004 10:47 pm

Tradeskills macro

Post by Tigger7833 » Mon Oct 11, 2004 3:56 pm

Is there an automated macro using the new tradeskills window? I found this one that would work great but it's been awhile since it was posted. Tried to compile it and got a few errors. I've looked around but most of them i've found have been with recipes and ect. I just want it to hit combine then autoinventory it lol.

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
peach
a hill giant
a hill giant
Posts: 156
Joined: Fri Sep 10, 2004 8:20 pm

Post by peach » Mon Oct 11, 2004 4:31 pm


Sunkist
orc pawn
orc pawn
Posts: 16
Joined: Thu Sep 09, 2004 10:31 am

Post by Sunkist » Mon Oct 11, 2004 5:29 pm

I'm learning as I go too and I found you don't need to compile macros, just plugins. To make a macro open your MQ folder > Release > Macros, then make a new text document there and copy all the code you just posted into it and save as fletch.mac in this case. Then when you get ingame type /mac fletch to load the macro.

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Mon Oct 11, 2004 5:33 pm

I think this is something I made a while back to do a few combines when I didn't want to bother with the more advanced macros. Not sure how well it works, found it in my macro dir and I'm just posting it like it is.

Code: Select all

#event Full "#*#There was no place to put that#*#" 
#event Missing "You are missing #*#"
#event SkillMax "You can no longer advance your skill from making this item."

Sub Main
	/declare StopAtTrivial bool outer 0
	
	/if (${Defined[Param0]}) {
		/varset StopAtTrivial ${Param0}
	}

	/if (${StopAtTrivial}) /echo Stopping at trivial.

	:endlessloop
	/if  (${Window[TradeSkillWnd].Open}) {
		/doevents

		/delay 12		

		/notify COMBW_CombineArea COMBW_CombineButton leftmouseup
		
		:clearmore
		/if (${Cursor.ID}) {
			/autoinv
			/delay 1
			/goto :clearmore
		}

	}
	/goto :endlessloop
/return

Sub Event_SkillMax
	/if (${StopAtTrivial}) {
		/echo Reached cap, ending!
		/endmacro
	}
/return

Sub Event_Full
	/echo Full, ending!
	/endmacro
/return

Sub Event_Missing
	/echo Missing ingredients, ending!
	/endmacro
/return