-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcombines.mac
124 lines (111 loc) · 3.06 KB
/
combines.mac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|# Simple Combine Macro
|# This isn't written by Shin Noir, but it's nice for tradeskill auto combining.
#turbo 40
#define DEBUG /echo
|
| Parameters
| - inv don't check free space
| - skill=x stop at x skill
| - triv stop when trivial
| - combines=x combine x times
|
sub Main
/declare fCheckInventory bool outer TRUE
/declare fStopAtTrivial bool outer
/declare fStopAtSkill bool outer
/declare SkillValue int outer
/declare x int local
/declare combines int outer
/declare checkcombines bool outer
/declare runs int outer
/declare max int outer
/echo Combine Macro Starting!
| Parse options
/for x 0 to 5
/if (${Param${x}.Find[inv]}) {
/varset fCheckInventory FALSE
/echo - Not checking inventory
}
/if (${Param${x}.Find[skill]}) {
/if (${Param${x}.Arg[2,=].Length}) {
/varset fStopAtSkill TRUE
/varset SkillValue ${Param${x}.Arg[2,=]}
/echo - Stopping at skill ${SkillValue}
}
}
/if (${Param${x}.Find[triv]}) {
/varset fStopAtTrivial TRUE
/echo - Stopping when trivial
}
/if (${Param${x}.Find[combines]}) {
/varset checkcombines true
/varset combines ${Param${x}.Arg[2,=]}
/echo - Stopping after ${combines} combines
}
/next x
:main_loop
/if (${checkcombines} && (${runs} >= ${combines})) {
/echo Ending macro because ${combines} combines have been made
/beep
/endmacro
}
/if (${fCheckInventory} && !${Me.FreeInventory}) {
/echo No free inventory, ending!
/beep
/endmacro
}
/if (!${Window[TradeskillWnd].Open}) {
/echo Tradeskill Window not open, ending!
/endmacro
} else {
/if (${Cursor.ID}) /call Clear_Cursor
/delay 5s ${Window[TradeskillWnd].Child[COMBW_CombineButton].Enabled}
/nomodkey /notify TradeskillWnd CombineButton leftmouseup
/delay 2s ${Cursor.ID}
/if (${Cursor.ID}) /call Clear_Cursor
}
/varcalc runs ${runs}+1
/doevents
/goto :main_loop
/return
#event SkillUp "You have become better at #1#! (#2#)"
sub Event_Skillup(Line,SkillName,SkillPoints)
/if (${fStopAtSkill} && ${SkillPoints}>=${SkillValue}) {
/echo Skill reached or exceeded, stopping!
/delay 1s ${Cursor.ID}
/if (${Cursor.ID}) /call Clear_Cursor
/beep
/endmacro
}
/return
#event Trivial "You can no longer advance your skill from making this item."
sub Event_Trivial
/if (${fStopAtTrivial}) {
/echo Item is trivial, stopping
/delay 1s ${Cursor.ID}
/if (${Cursor.ID}) /call Clear_Cursor
/beep
/endmacro
}
/return
#event OutOfStuff "Sorry, but you don't have everything you need for this recipe in your general inventory."
sub Event_OutOfStuff
/beep
/beep
/echo Out of ingredients
/endmacro
/return
sub Clear_Cursor
:start_clear
/if (${Cursor.ID}) {
/if (${Select[${Cursor.ID},16925,16929,16933,8238,9685,16598,16602,16698,21612,21614,9686,10269,3061,3059]}) {
/destroy
/delay 1s !${Cursor.ID}
/goto :start_clear
} else {
/autoinventory
/delay 1s ${Cursor.ID}
}
/goto :start_clear
}
/return