TinTin++ setup for Aardwolf MUD
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
3.5 KiB

  1. #CLASS pathwalk kill
  2. #CLASS pathwalk open
  3. #NOP Class Name: pathwalk
  4. #NOP File Name: pathwalk.tin
  5. #NOP Description:
  6. #NOP This simple script will utilize a variable (pos_number) set from GMCP to check if you are fighting before
  7. #NOP walking the next node of a path. If the 'pos_number' variable is '8', it will create a ticker to determine
  8. #NOP when you are no longer in a fight and resume walking the path. It also allows you to send commands while
  9. #NOP walking a path as opposed to #PATH RUN.
  10. #NOP Usage:
  11. #NOP 1. Store a path somehow (#path load <blah>, #map find <blah>)
  12. #NOP 2. Type 'rp'
  13. #NOP 3. Settings should clear on end of path, use 'rpof' if all else fails.
  14. #NOP
  15. #NOP Setting 'pos_number' variable from GMCP:
  16. #NOP I would highly recommend using more complete gmcp data capturing script(s)
  17. #NOP such as these:
  18. #NOP
  19. #NOP http://code.google.com/p/aardwolf-tintin/source/browse/gmcp.tin
  20. #NOP http://code.google.com/p/aardwolf-tintin/zzGMCP_to_stat.tin
  21. #NOP
  22. #NOP Otherwise, you will need to do something like this:
  23. #NOP
  24. #NOP #EVENT {IAC SB GMCP char.status IAC SE}
  25. #NOP {
  26. #NOP #variable GMCP[CHAR][STATUS] {%0};
  27. #NOP #variable pos_number {$GMCP[CHAR][STATUS][state]}
  28. #NOP }
  29. #NOP
  30. #NOP Known Bugs
  31. #NOP Problem with pathwalking after using some portal objects during the speedwalk.
  32. #NOP This will be the main alias for initiating a path run(walk)
  33. #ALIAS rp
  34. {
  35. #NOP Setting 'mapping' variable to 0 is required if using a gmcp mapper script to prevent double MAP EXIT ROOM events ;
  36. #VARIABLE {mapping} {0};
  37. #EVENT {MAP EXIT ROOM}
  38. {
  39. #NOP Check to see if we're fighting ;
  40. #IF {$pos_number == 8}
  41. {
  42. #NOP If fighting, create a ticker to watch for not fighting state, and display a message. ;
  43. #SHOW <179>[<119>Speedwalk<179>]<119>Fighting - creating ticker.<099>;
  44. #TICKER {path_wait}
  45. {
  46. #NOP This is important: You MUST have something that sets this variable from gmcp. ;
  47. #IF {$pos_number != 8}
  48. {
  49. #NOP When we're done fighting, remove the ticker and get back to the path. ;
  50. #UNTICKER {path_wait};
  51. #PATH walk
  52. };
  53. #ELSE
  54. {
  55. #NOP Let's display something while in a fight just for confirmation. ;
  56. #SHOW <179>[<119>Speedwalk<179>]<129>waiting...
  57. }
  58. } {.5}
  59. };
  60. #ELSE
  61. {
  62. #NOP If we're not fighting, just send the next path node and display something nice. ;
  63. #SHOW <179>[<119>Speedwalk<179>]<099>;
  64. #PATH walk
  65. }
  66. };
  67. #NOP This will handle cleaning everything up on normal termination of a path. ;
  68. #event {END OF PATH}
  69. {
  70. #SHOW <179>[<119>Speedwalk<179>]<129>Done.<099>;
  71. #VARIABLE mapping 1;
  72. #UNEVENT {MAP EXIT ROOM};
  73. #UNEVENT {END OF PATH};
  74. };
  75. #NOP Oops, something must be wrong, let's get out of the path and clean up. ;
  76. #ACTION {^Alas, you cannot go that way.}
  77. {
  78. #VARIABLE mapping 1;
  79. #UNEVENT {MAP EXIT ROOM};
  80. #UNEVENT {END OF PATH};
  81. #UNACTION {^Alas, you cannot go that way.}
  82. };
  83. #NOP Hrm, somehow the MAP EXIT ROOM event is still on but we have no nodes left in the path. ;
  84. #ACTION {#END OF PATH}
  85. {
  86. #NOP As before, setting the 'mapping' variable is only necessary if you use a gmcp mapping script that manually moves you in the tintin map. ;
  87. #VARIABLE mapping 1;
  88. #UNEVENT {MAP EXIT ROOM};
  89. #UNEVENT {END OF PATH};
  90. #UNACTION {#END OF PATH}
  91. };
  92. #NOP Let's make the rp alias start the path too. ;
  93. #PATH walk
  94. }
  95. #NOP If for some reason you need to clear the speedwalk, use this
  96. #ALIAS {rpof}
  97. {
  98. #PATH load {#nop};
  99. #PATH walk
  100. }
  101. #CLASS pathwalk close