Advertisement
sorvani

DelayTalk.mac

May 9th, 2012
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.44 KB | None | 0 0
  1. |delaytalk.mac
  2. |
  3. | Written by: Sorvani (Koro on PEQ TGC)
  4. | Last Modified: 09/02/2010
  5. |
  6. | This macro will delay speak something with all members of your group.
  7. | Obviously if you are trying to set the delay to 0 seconds you do not need this macro,
  8. | just use /bcaa //say BLAH BLAH BLAH
  9. |
  10. | Parameter 1: Delay in seconds between target command and character's speech
  11. | Parameter 2: channel to use (say g gu ttell)
  12. | Parameter 3-7: text to say. If the text is more than five words surround it in quotes. example: "Please bind my soul you sexy NPC"
  13. | If you say more than 5 words without quoting it, it WILL truncate your phrase to 5 words.
  14. | USAGE
  15. | If you have Rytan targeted in Gloomingdeep, the above command would get him to buff your entire party.
  16. | /macro delaytalk.mac 1 say blessed
  17. |
  18. | Have soul binder bind you.
  19. | /macro delaytalk.mac 1 say bind my soul
  20. |
  21. | useful for player created buff bots have your team /ttell your target
  22. | /macro delaytalk.mac 10 ttell ds
  23. |
  24. | i recommend creating an alias for your most common usages such as 1 second in /say.
  25. | /alias /dt1 /mac delaytalk 1 say
  26. | now /dt1 blessed would replace the above example for Rytan
  27. |
  28. | This next one I use to stagger my hails so I can what the bot screens more closely for
  29. | the character flag text or whatever event the hail is supposed to cause.
  30. | /alias /dh /mac delaytalk 1 hail
  31.  
  32.  
  33. |Set these two constants to whatever channels you prefer to use.
  34. |Some people like /bc instead of bct, but it works the same either way.
  35. #define ERR_CHAN "/echo"
  36. #define CMD_CHAN "/bct"
  37.  
  38. Sub Main
  39. /declare GroupLoop int local 0
  40. /declare TargetID int local ${Target.ID}
  41. /declare TargetDelay string local
  42. /declare TalkChan string local
  43. /declare TalkThis string local
  44. /declare TalkPerson string local
  45.  
  46. /if (!${TargetID}) {
  47. ERR_CHAN you must have a target before using this macro, exiting ${Macro.Name}.
  48. /return
  49. }
  50.  
  51. /if (${Defined[Param0]}) {
  52. /vardata TargetDelay Param0
  53. /if (${TargetDelay}==0) {
  54. ERR_CHAN RTFM please. You know, all that text at the top of the macro...
  55. }
  56. } else {
  57. |delay between each character was not speicifed, inform user and exit
  58. ERR_CHAN No delay specified, exiting ${Macro.Name}.
  59. /return
  60. }
  61.  
  62. /if (${Defined[Param1]}) {
  63. /vardata TalkChan Param1
  64. } else {
  65. |channel to use was not specified, inform user and exit
  66. ERR_CHAN No talk channel specified, exiting ${Macro.Name}.
  67. /return
  68. }
  69.  
  70. |if the talk channel was hail then no other text will be used
  71. /if (${TalkChan.Equal[hail]}) {
  72. /varset TalkChan hail
  73. } else {
  74. |if the talk channel was anything else, then accept up to 5 unquoted words as the text to say
  75. /if (${Defined[Param6]}) {
  76. /varset TalkThis ${Param2} ${Param3} ${Param4} ${Param5} ${Param6}
  77. } else /if (${Defined[Param5]}) {
  78. /varset TalkThis ${Param2} ${Param3} ${Param4} ${Param5}
  79. } else /if (${Defined[Param4]}) {
  80. /varset TalkThis ${Param2} ${Param3} ${Param4}
  81. } else /if (${Defined[Param3]}) {
  82. /varset TalkThis ${Param2} ${Param3}
  83. } else /if (${Defined[Param2]}) {
  84. /varset TalkThis ${Param2}
  85. } else {
  86. |nothing to say was specified, inform user and exit
  87. ERR_CHAN No talk text specified, exiting ${Macro.Name}.
  88. /return
  89. }
  90. }
  91.  
  92. |the loop counts backwards to ensure the person running the macro doesn't zone first
  93. |as a result of the command or some other such event.
  94. |/mac delaytalk say Nedaria would break if the person running the macro zoned first.
  95. /for GroupLoop ${Group.Members} downto 0
  96. |Get the name of the group memeber who will be speaking
  97. /vardata TalkPerson Group.Member[${GroupLoop}].Name
  98. |clear that group member's current target
  99. CMD_CHAN ${TalkPerson} //squelch /target clear
  100. |quick delay for gui
  101. /delay 1
  102. |have the group member target the macro user's target
  103. CMD_CHAN ${TalkPerson} //target ID ${TargetID}
  104. |If this is the first person in the macro, no need to delay the full delay.
  105. |just wait 1s for target aquisition. The point of the full delay is to wait
  106. |for the target to finish doing whatever they do in response to your text,
  107. |the delay is not just for targeting purposes.
  108. /if (${GroupLoop}==${Group.Members}) {
  109. /delay 1s
  110. } else {
  111. /delay ${TargetDelay}s
  112. }
  113. |have the group member speak the text to the targeted NPC/PC
  114. /if (${TalkChan.Equal[hail]}) {
  115. CMD_CHAN ${TalkPerson} //${TalkChan}
  116. } else {
  117. CMD_CHAN ${TalkPerson} //${TalkChan} ${TalkThis}
  118. }
  119. /next GroupLoop
  120. /return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement