Advertisement
DavidJSGardner

Unattended Macro Alert(Pangaea)

Jun 1st, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1. ;===================================
  2. ; Script Name: Unattended Macro Alarm Alerter
  3. ; Author: Callum O'Lyre
  4. ; ICQ: 625-658-845
  5. ; Version: 1.0
  6. ; Shard: Pangaea
  7. ; Public Release: 22.07.2013
  8. ; Purpose: To alert when specific gumps appear on Pangaea.
  9. ; Originally Posted: http://pastebin.com/u/DavidJSGardner
  10. ;===============Note================
  11. ; If you want to test that this is working as intended,
  12. ; you will need to bring up the .options gump as I block
  13. ; the .online gump as well as a couple other gumps from
  14. ; sounding the alarm.
  15. ;===================================
  16. ; You will need to edit the %SoundFile Variable, DO NOT
  17. ; EDIT the two below it, there is a sub I left in here
  18. ; that uses them, It's purpose is to alert when hostiles
  19. ; are found within 18 tiles of you (Reds as I recall)
  20. ; but could easily be changed to alert when enemy guild/
  21. ; Religion members are around you or anyone.
  22. ;===================================
  23. Set %SoundFile MacroAlert.wav
  24. Set %SFHT #SCNT
  25. Set %STimer #SCNT
  26.  
  27. While #True
  28. {
  29. GoSub ScanForHostiles 10
  30. if #contname = generic_gump && #contSize <> 420_340 && #contSize <> 310_490 && #contSize <> 220_440 && #contSize <> 178_108 && #contSize <> 382_256 && #contSize <> 382_231 && #ContSize <> 520_410 && #ContSize <> 430_560
  31. {
  32. gosub RKVisualAlert #true Gump
  33. }
  34. if #weight >= 510
  35. {
  36. gosub RKVisualAlert #true Weight
  37. }
  38. }
  39.  
  40. ;======begin the sub of interest
  41. ;===========
  42. ;**
  43. ;* @name RKVisualAlert
  44. ;* @ver 1.0 23Oct04
  45. ;* @author Roadkill
  46. ;* @purpose
  47. ;* @params %1 optional, default #false. #true/#false, if #true it
  48. ;* makes sound alarm also
  49. ;* @returns
  50. ;* @example call rksubs.txt RKVisualAlert #true
  51. ;* @status tested good
  52. sub RKVisualAlert
  53. set !0 black
  54. set !1 red
  55. set !a 0
  56. set !b 1
  57. if %0 > 0 && %1 = #true
  58. {
  59. set %SoundCue #true
  60. }
  61. set *GlobalPause #True
  62. set *GlobalReason %2
  63. VAloop:
  64. menu Clear
  65. menu Window Title Roadkill's VisualAlerter
  66. menu Window Color ! . !a
  67. menu Window Size 500 300
  68. menu Font Name MS Sans Serif
  69. menu Font Size 40
  70. menu Font Style b
  71. menu Font bgcolor ! . !a
  72. menu Font Color ! . !b
  73. menu Font Transparent #false
  74. menu Font Align center
  75. menu Text fook 50 50 FOOOKKKKK!!$ DO$ SOMETHING!
  76. menu font color white
  77. menu font size 15
  78. menu Font Align center
  79. menu Show
  80. if %SoundCue <> #False && %STimer < #SCNT
  81. {
  82. sound %SoundFile
  83. set %STimer #SCNT + 4
  84. }
  85. wait 2
  86. set !a ( !a - 1 ) abs ; 1
  87. set !b ( !b - 1 ) abs ; 0
  88. if #contname <> generic_gump && %2 = Gump
  89. {
  90. goto stopalert
  91. }
  92. if #weight < 510 && %2 = Weight
  93. {
  94. goto stopalert
  95. }
  96. goto VAloop
  97. stopalert:
  98. set *GlobalPause #False
  99. set *GlobalReason #SPC
  100. menu clear
  101. menu hide
  102. return
  103.  
  104. Sub ScanForHostiles
  105. FindItem #CharID
  106. if %SFHT < #SCNT
  107. {
  108. Set %SCHWT %1
  109. FindItem HS_IS G_18
  110. For #FINDINDEX 1 #FINDCNT
  111. {
  112. While #FindRep = 5
  113. {
  114. sound %SoundFile
  115. wait 4s
  116. OnHotKey ESC
  117. {
  118. wait 1s
  119. return
  120. }
  121. }
  122. }
  123. Set %SFHT #SCNT + %SCHWT
  124. }
  125. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement