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

#CLASS pathwalk kill
#CLASS pathwalk open
#NOP Class Name: pathwalk
#NOP File Name: pathwalk.tin
#NOP Description:
#NOP This simple script will utilize a variable (pos_number) set from GMCP to check if you are fighting before
#NOP walking the next node of a path. If the 'pos_number' variable is '8', it will create a ticker to determine
#NOP when you are no longer in a fight and resume walking the path. It also allows you to send commands while
#NOP walking a path as opposed to #PATH RUN.
#NOP Usage:
#NOP 1. Store a path somehow (#path load <blah>, #map find <blah>)
#NOP 2. Type 'rp'
#NOP 3. Settings should clear on end of path, use 'rpof' if all else fails.
#NOP
#NOP Setting 'pos_number' variable from GMCP:
#NOP I would highly recommend using more complete gmcp data capturing script(s)
#NOP such as these:
#NOP
#NOP http://code.google.com/p/aardwolf-tintin/source/browse/gmcp.tin
#NOP http://code.google.com/p/aardwolf-tintin/zzGMCP_to_stat.tin
#NOP
#NOP Otherwise, you will need to do something like this:
#NOP
#NOP #EVENT {IAC SB GMCP char.status IAC SE}
#NOP {
#NOP #variable GMCP[CHAR][STATUS] {%0};
#NOP #variable pos_number {$GMCP[CHAR][STATUS][state]}
#NOP }
#NOP
#NOP Known Bugs
#NOP Problem with pathwalking after using some portal objects during the speedwalk.
#NOP This will be the main alias for initiating a path run(walk)
#ALIAS rp
{
#NOP Setting 'mapping' variable to 0 is required if using a gmcp mapper script to prevent double MAP EXIT ROOM events ;
#VARIABLE {mapping} {0};
#EVENT {MAP EXIT ROOM}
{
#NOP Check to see if we're fighting ;
#IF {$pos_number == 8}
{
#NOP If fighting, create a ticker to watch for not fighting state, and display a message. ;
#SHOW <179>[<119>Speedwalk<179>]<119>Fighting - creating ticker.<099>;
#TICKER {path_wait}
{
#NOP This is important: You MUST have something that sets this variable from gmcp. ;
#IF {$pos_number != 8}
{
#NOP When we're done fighting, remove the ticker and get back to the path. ;
#UNTICKER {path_wait};
#PATH walk
};
#ELSE
{
#NOP Let's display something while in a fight just for confirmation. ;
#SHOW <179>[<119>Speedwalk<179>]<129>waiting...
}
} {.5}
};
#ELSE
{
#NOP If we're not fighting, just send the next path node and display something nice. ;
#SHOW <179>[<119>Speedwalk<179>]<099>;
#PATH walk
}
};
#NOP This will handle cleaning everything up on normal termination of a path. ;
#event {END OF PATH}
{
#SHOW <179>[<119>Speedwalk<179>]<129>Done.<099>;
#VARIABLE mapping 1;
#UNEVENT {MAP EXIT ROOM};
#UNEVENT {END OF PATH};
};
#NOP Oops, something must be wrong, let's get out of the path and clean up. ;
#ACTION {^Alas, you cannot go that way.}
{
#VARIABLE mapping 1;
#UNEVENT {MAP EXIT ROOM};
#UNEVENT {END OF PATH};
#UNACTION {^Alas, you cannot go that way.}
};
#NOP Hrm, somehow the MAP EXIT ROOM event is still on but we have no nodes left in the path. ;
#ACTION {#END OF PATH}
{
#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. ;
#VARIABLE mapping 1;
#UNEVENT {MAP EXIT ROOM};
#UNEVENT {END OF PATH};
#UNACTION {#END OF PATH}
};
#NOP Let's make the rp alias start the path too. ;
#PATH walk
}
#NOP If for some reason you need to clear the speedwalk, use this
#ALIAS {rpof}
{
#PATH load {#nop};
#PATH walk
}
#CLASS pathwalk close