View difference between Paste ID: dFZVA6AJ and tfBqpd08
SHOW: | | - or go back to the newest paste.
1
; Path Of Exile Sync Script 1.0
2
3
#IfWinActive Path of Exile
4
SendMode Input
5
{
6
7
F3::
8
Send {enter}
9
Send /oos 
10
Send {Enter}
11
Return
12
13
F2::
14
Send {enter}
15
Sleep 20
16
Send {Alt} /itemlevel {enter}
17
Sleep 20
18
Return
19
20
F4:: 
21
Send {enter}
22
Sleep 20
23
Send {Alt} /remaining {enter}
24
Sleep 20
25
Return
26
27
F11:: 
28
Loop 1000000 {
29
  BlockInput On
30
  Send {Enter}
31
  Sleep 2
32
  Send @poexyzis This is a message for your bot
33
  Send {Enter}
34
  BlockInput Off
35
  Sleep 3599999
36
}
37
}
38
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
39
#Warn ; Enable warnings to assist with detecting common errors.
40
#Persistent ; Only the user can kill the application
41
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
42
StringCaseSense, On ; Match strings with case.
43
44
MouseMovePixels = 40 ; How many pixels you have to move until tooltip disapears.
45
Menu1 = POE.iLVL And DPS Revealer. 
46
ver = v1 Fork
47
48
; Some various fancy tray icon stuff.
49
Menu, tray, Tip, %Menu1% %ver%`nrevealing your iLVL and DPS since 2013
50
Menu, tray, NoStandard
51
Menu, tray, add, %Menu1%%ver%, RemoveTooltip
52
Menu, tray, disable, %Menu1%%ver%
53
Menu, tray, add
54
Menu, tray, add, Reload, MyReload
55
Menu, tray, add, Edit, MyEdit
56
Menu, tray, add
57
Menu, tray, add, Exit, ExitSub
58
return
59
60
#IfWinActive, Path of Exile ; May save CPU usage when copying stuff outside of PoE. Hasn't been tested.
61
OnClipboardChange:
62
StopName = 0 ; Stop appending things to the name.
63
GotItemlevel = 0 ; Just in case the script doesn't find the itemlevel
64
GotDPS = 0
65
Name = ; Blank name (for now)
66
PhyLow = 0
67
PhyHigh = 0
68
FireLow = 0
69
FireHigh = 0
70
ColdLow = 0
71
ColdHigh = 0
72
LightningLow = 0
73
LightningHigh = 0
74
ChaosLow = 0
75
ChaosHigh = 0
76
AttackSpeed = 0
77
Quality = 0
78
PhyDamageP = 0
79
80
Loop, parse, Clipboard, `n, `r ; Goes through a loop with the lines of text found in the clipboard
81
{
82
if StopName = 0 
83
{
84
if A_Loopfield = -------- ; Checks when to stop appending stuff to the name
85
{
86
StopName = 1
87
continue
88
}
89
if A_Index = 1 ; Starts a check whether it has "Rarity", as well as avoiding appending the rarity to the name.
90
{
91
IfNotInString, A_Loopfield, Rarity: ; Checks whether it has "Rarity:" in the first line. If it doesn't...
92
Exit
93
}
94
else
95
Name = %Name%%A_Loopfield%`n ; Appends the line to the name with a line break.
96
}
97
IfInString, A_Loopfield, Itemlevel:
98
{
99
Name = %Name%%A_LoopField% 
100
GotItemlevel = 1
101
Itemlevel = %A_LoopField%
102
103
}
104
IfInString, A_Loopfield, Physical Damage:
105
{
106
PhyDamage = %A_LoopField%
107
IfInString, A_Loopfield, increased
108
{
109
} Else {
110
GotDPS = 1
111
StringSplit, PhyDamageArray, PhyDamage , %A_Space%,
112
StringSplit, PhyDamageNumArray, PhyDamageArray3 , -,
113
PhyLow = %PhyDamageNumArray1%
114
PhyHigh = %PhyDamageNumArray2%
115
} 
116
117
118
}
119
IfInString, A_Loopfield, Quality:
120
{
121
Quality = %A_LoopField%
122
123
StringSplit, QualityArray, Quality , %A_Space%,
124
StringTrimLeft, Quality, QualityArray2, 1
125
StringTrimRight, Quality, Quality, 1
126
StringLen, length, Quality
127
If length = 1
128
Quality := "0" + Quality
129
Quality := "0." + Quality
130
131
132
}
133
134
IfInString, A_Loopfield, Attacks per Second:
135
{
136
AttackSpeed = %A_LoopField%
137
138
StringSplit, ASArray, AttackSpeed , %A_Space%,
139
AttackSpeed = %ASArray4%
140
141
}
142
IfInString, A_Loopfield, increased Physical Damage
143
{
144
PhyDamageP = %A_LoopField%
145
146
StringSplit, PhyDamagePArray, PhyDamageP , %A_Space%,
147
PhyDamageP = %PhyDamagePArray1%
148
StringTrimRight, PhyDamageP, PhyDamageP, 1
149
150
151
}
152
IfInString, A_Loopfield, Fire Damage 
153
{
154
FireDamage = %A_LoopField%
155
IfInString, A_Loopfield, increased
156
{
157
} Else {
158
StringSplit, FireDamageArray, FireDamage , %A_Space%,
159
StringSplit, FireDamageNumArray, FireDamageArray2 , -,
160
FireLow = %FireDamageNumArray1%
161
FireHigh = %FireDamageNumArray2%
162
}
163
164
}
165
IfInString, A_Loopfield, Cold Damage
166
{
167
ColdDamage = %A_LoopField%
168
IfInString, A_Loopfield, increased
169
{
170
} Else {
171
StringSplit, ColdDamageArray, ColdDamage , %A_Space%,
172
StringSplit, ColdDamageNumArray, ColdDamageArray2 , -,
173
ColdLow = %ColdDamageNumArray1%
174
ColdHigh = %ColdDamageNumArray2%
175
}
176
}
177
IfInString, A_Loopfield, Lightning Damage
178
{
179
LightningDamage = %A_LoopField%
180
IfInString, A_Loopfield, increased
181
{
182
} Else {
183
StringSplit, LightningDamageArray, LightningDamage , %A_Space%,
184
StringSplit, LightningDamageNumArray, LightningDamageArray2 , -,
185
LightningLow = %LightningDamageNumArray1%
186
LightningHigh = %LightningDamageNumArray2%
187
}
188
}
189
IfInString, A_Loopfield, Chaos Damage
190
{
191
ChaosDamage = %A_LoopField%
192
IfInString, A_Loopfield, increased
193
{
194
} Else {
195
StringSplit, ChaosDamageArray, ChaosDamage , %A_Space%,
196
StringSplit, ChaosDamageNumArray, ChaosDamageArray2 , -,
197
ChaosLow = %ChaosDamageNumArray1%
198
ChaosHigh = %ChaosDamageNumArray2%
199
}
200
}
201
}
202
if GotItemlevel = 0 ; If we didn't get the itemlevel...
203
exit
204
MouseGetPos, X, Y ; Stores the mouse position when the tooltip was displayed
205
if GotDPS = 1
206
{
207
TotalDamage := ((PhyLow + PhyHigh + FireLow + FireHigh + ColdLow + ColdHigh + LightningLow + LightningHigh + ChaosLow + ChaosHigh) / 2) * AttackSpeed
208
TotalPhyDamage := ((PhyLow + PhyHigh) / 2) * AttackSpeed
209
TotalEleDamage := ((FireLow + FireHigh + ColdLow + ColdHigh + LightningLow + LightningHigh + ChaosLow + ChaosHigh) / 2) * AttackSpeed
210
211
If StrLen(PhyDamageP) = 3
212
PutIntoString(PhyDamageP, 1, ".")
213
If StrLen(PhyDamageP) = 2
214
PhyDamageP := "0." + PhyDamageP
215
216
PhyDamageP1 := PhyDamageP + Quality + 1
217
218
BasePhy := (PhyLow + PhyHigh) / PhyDamageP1
219
PhyDamagePQ20 := BasePhy * (PhyDamageP + 1.20)
220
221
if Quality < 0.20
222
{
223
224
TotalDPSWithQuality := ((PhyDamagePQ20 + FireLow + FireHigh + ColdLow + ColdHigh + LightningLow + LightningHigh + ChaosLow + ChaosHigh) / 2) * AttackSpeed
225
StringTrimRight, TotalDPSWithQuality, TotalDPSWithQuality, 4
226
TotalDPSWithQualityDisplay = `nDPSwQ20: %TotalDPSWithQuality%
227
} Else {
228
TotalDPSWithQualityDisplay = 
229
}
230
231
232
StringTrimRight, TotalDamage, TotalDamage, 4
233
StringTrimRight, TotalPhyDamage, TotalPhyDamage, 4
234
StringTrimRight, TotalEleDamage, TotalEleDamage, 4
235
236
Name = %Name%`nPhyDps:%TotalPhyDamage%`nEleDps:%TotalEleDamage%`nTotalDps:%TotalDamage%%TotalDPSWithQualityDisplay%
237
SwName = %Itemlevel%`nPhyDps:%TotalPhyDamage%`nEleDps:%TotalEleDamage%`nTotalDps:%TotalDamage%%TotalDPSWithQualityDisplay%
238
239
StringReplace, clipboard, Name, `n, %A_SPACE% , All
240
}
241
242
ToolTip, %Name%, X + 35, Y + 35 ; The name is taken just to confirm what item the user is hovering over.
243
Increment := 0 ; Sets the variable to increment
244
SetTimer, TimerTick, 100
245
return
246
247
248
249
#IfWinActive
250
251
TimerTick:
252
Increment += 1 ; When it hits 75 (7.5 sec), it removes the tool tip just in case of it screwing up
253
MouseGetPos, currentX, currentY ; Used for the below expression
254
if ((X - CurrentX)**2 + (Y - CurrentY)**2 > MouseMovePixels**2 or Increment >= 75) {
255
SetTimer, TimerTick, Off ; When the mouse moves MouseMovePixels pixels, it stops the tooltip.
256
ToolTip
257
}
258
return
259
260
MyListVars:
261
ListVars
262
Return
263
264
MyReload:
265
266
Reload
267
Return
268
269
MyEdit:
270
Edit
271
Return
272
273
PutIntoString(ByRef Str, AtChar, InsertString)
274
{ While StrLen(Str) < (AtChar-1) ; First, make sure the satring is long enough to insert at 'at'
275
Str .= " "
276
Str := % SubStr(Str, 1, AtChar) . InsertString . Substr(Str, (AtChar + StrLen(InsertString))) ; %
277
}
278
279
RemoveTooltip: ; exactly what it says on the tin
280
ToolTip
281
return
282
283
284
ExitSub:
285
F12::
286
ExitApp
287
return