AutumnElegy

RC Timer by Dreyri

Mar 6th, 2016
3,677
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. ; This script was made a long time ago by Dreyri.
  2. ; I use it for Runecrafting to keep track of when my pouches
  3. ; are about to degrade.
  4.  
  5. ; This paste has f1 set to increment the timer, you can change
  6. ; what key you want to use for it where I commented in all caps.
  7. ; Reset the timer to 1 when you repair your pouches, then
  8. ; repair them again when the timer hits 9 and your pouch
  9. ; will never degrade and you won't ever lose the 3 essence
  10. ; on 10th runs.
  11.  
  12. #SingleInstance force
  13.  
  14. Gosub,currentTime
  15. Gosub,updateGui
  16. SetTimer,currentTime,500
  17.  
  18. FillCount := 1
  19. ResetTime := A_TickCount
  20. CurrentTime := A_TickCount
  21. Difference := CurrentTime - ResetTime
  22.  
  23. Gui,-border -caption +alwaysontop +disabled +owner -sysmenu
  24. Gui,color,green
  25. Gui,add,Text, vCount w30 h11 +center,%FillCount%
  26. Gui,add,Text, vTime w30 h11 +center,%Difference%
  27. Gui,show
  28.  
  29.  
  30. Loop
  31. {
  32.  
  33. ifWinExist, ahk_class SunAwtFrame
  34. {
  35. ifWinActive, ahk_class SunAwtFrame
  36. {
  37. Gui,+alwaysontop
  38. }
  39. else
  40. {
  41. Gui,-alwaysontop
  42. }
  43. WinGetPos,orx,ory,width,height, ahk_class SunAwtFrame
  44. winX := orx + 719
  45. winY := ory + 54
  46. Gui,show,NA x%winX% y%winy%
  47. Sleep,500
  48. }
  49. else
  50. {
  51. Gui,Submit
  52. Sleep,2000
  53. }
  54. }
  55. return
  56.  
  57. ; CHANGE THIS VALUE BEFORE THE TWO COLONS TO CHANGE WHAT KEY WILL INCREMENT THE SCRIPT:
  58. f1::
  59. FillCount += 1
  60. if(Fillcount > 9)
  61. {
  62. FillCount = 1
  63. }
  64. if(FillCount >= 8)
  65. {
  66. if(FillCount = 9)
  67. {
  68. Gui,color,red
  69. }
  70. else
  71. {
  72. Gui,color,yellow
  73. }
  74. }
  75. else
  76. {
  77. Gui, color, green
  78. }
  79. ResetTime = %A_TickCount%
  80. GuiControl,text,Count,%FillCount%
  81. GuiControl,text,Time,0
  82. return
  83.  
  84. currentTime:
  85. CurrentTime = %A_TickCount%
  86. gosub,updategui
  87. return
  88.  
  89. updateGui:
  90. difference := (CurrentTime - ResetTime)
  91. difference /= 1000
  92. GuiControl,text,Time,%difference%
  93. return
Advertisement
Add Comment
Please, Sign In to add comment