Advertisement
Guest User

Untitled

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