Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » Finished MUD Scripts
Scirkhan
Apprentice


Joined: 14 Sep 2007
Posts: 167
Location: aztx

PostPosted: Sun Aug 07, 2011 2:18 am   

Path recording class
 
To start, type mark.
Walk around.
To end, type path <path name> (example: path Midgaard)

Code:
#CLASS {Path}
#ALIAS mark {#class Path/Record 1;#var Path/Record/lastPath {@Path/Record/currentRecording};#var Path/Record/currentRecording {};#show %ansi( hi, cyan)Beginning of path set}
#ALIAS path {#var Path/pathBackups {%addkey(@Path/pathBackups, %-1, @Path/Record/currentRecording)}
#var {Path/Record/%-1} {@Path/Record/currentRecording}
#show %ansi(hi,cyan)@Path/Record/currentRecording saved to %-1
#class Path/Record 0}
#ALIAS pathadd {#var Path/Record/currentRecording {%additem( %-1, @Path/Record/currentRecording)};#show %ansi( hi, cyan)%-1 added to current recording}
#ALIAS pathdel {#show %ansi( hi, cyan)%item( @Path/Record/currentRecording, %numitems( @Path/Record/currentRecording)) %ansi( hi, red)removed;#DELITEM Path/Record/currentRecording %numitems( @Path/Record/currentRecording)}
#ALIAS pause {#class Path/Record 0;#show Recording paused}
#ALIAS resume {#class Path/Record 1;#show Recording resumed}
#VAR pathBackups {}
#CLASS 0
#CLASS {Path|Record}
#ALIAS s {~s;#var Path/Record/currentRecording {%additem( "s", @Path/Record/currentRecording)}}
#ALIAS n {~n;#var Path/Record/currentRecording {%additem( "n", @Path/Record/currentRecording)}}
#ALIAS e {~e;#var Path/Record/currentRecording {%additem( "e", @Path/Record/currentRecording)}}
#ALIAS w {~w;#var Path/Record/currentRecording {%additem( "w", @Path/Record/currentRecording)}}
#ALIAS u {~u;#var Path/Record/currentRecording {%additem( "u", @Path/Record/currentRecording)}}
#ALIAS d {~d;#var Path/Record/currentRecording {%additem( "d", @Path/Record/currentRecording)}}
#ALIAS nw {~nw;#var Path/Record/currentRecording {%additem( "nw", @Path/Record/currentRecording)}}
#ALIAS ne {~ne;#var Path/Record/currentRecording {%additem( "ne", @Path/Record/currentRecording)}}
#ALIAS sw {~sw;#var Path/Record/currentRecording {%additem( "sw", @Path/Record/currentRecording)}}
#ALIAS se {~se;#var Path/Record/currentRecording {%additem( "se", @Path/Record/currentRecording)}}
#VAR lastPath {}
#VAR currentRecording {}
#CLASS 0


You may not like the pause and resume aliases. I was thinking of adding a pathcopy alias.
Please test it out, I'm still working on it but would like someone to look at it.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sun Aug 07, 2011 3:17 am   
 
Sorry to burst your bubble, but zmud has a built-in path recorder, under the actions menu.
Reply with quote
Scirkhan
Apprentice


Joined: 14 Sep 2007
Posts: 167
Location: aztx

PostPosted: Sun Aug 07, 2011 3:30 am   
 
I don't know, but if you spent any time looking at this code, you should have been capable of figuring out that I know that.
And btw, creating/using your own "paths" has its advantages.
Hence, why I made this.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sun Aug 07, 2011 4:03 pm   
 
OK, I actually read the code this time, and I don't get exactly what the use of it would be. It doesn't actually create paths? There are lists of directions stored in variables, but you have no alias to run them?
Reply with quote
Scirkhan
Apprentice


Joined: 14 Sep 2007
Posts: 167
Location: aztx

PostPosted: Sun Aug 07, 2011 8:54 pm   
 
Exactly, There isn't an alias to run them. Those variables are the paths.

I create a second variable and use this to run a path:
#exec {%pop( Midgaard)}

But I hate pop. I was also thinking about creating a path that records everything you send to the mud.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sun Aug 07, 2011 9:00 pm   
 
Well, it would help a lot if you did make an alias to run them. How are people supposed to know that they're supposed to use that to run the path? And don't you think it's a PITA to have to spam #exec %pop(whatever) to run your path? And I'm sure you'll forget to restore the variable from the backup one time...
Reply with quote
Scirkhan
Apprentice


Joined: 14 Sep 2007
Posts: 167
Location: aztx

PostPosted: Sun Aug 07, 2011 9:28 pm   
 
I usually make a separate class, that has a template for the path, and another variable to run the path. Now that I think about it, I don't need that. I can use %item somehow, reducing the variable down to one that never gets anything deleted. The alias, trigger, command, button, uh whatever is just used to start the path, or to move, and would contain #exec %pop(whatever) (will be changed in my own use to %item etc).

Okay, so you think I should add a usage script to my path class? I have recording (with backup) so far. If I do I think I will make an oninput trigger to record everything, I will also remove the directional aliases. I will have to change the way paths are now stored.

If I do this, I think it would emulate the #path (function/thing..) very closely. So.. make my path recording class (script?) into a complete path script?
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sun Aug 07, 2011 9:32 pm   
 
Well, I think it already does emulate built-in paths very closely. I'm still not sure what the advantage of yours over built-in paths is...
Reply with quote
Scirkhan
Apprentice


Joined: 14 Sep 2007
Posts: 167
Location: aztx

PostPosted: Sun Aug 07, 2011 9:42 pm   
 
It only emulates the recording closely, not walking etc :(
I can pause one path, start another.. resume another, and another etc. Mine don't just start running again because of #ok or something, either. Another advantage is it would work better with the map. I was having trouble recently with #path and the map, something about opening doors and using directions, so I used #ok, etc, blah blah blah but it still had that problem (just seemed to repeat it) I figured because the map is doing it too, then another problem came up. *yawn*

Well, since I had already created two variables for two paths (so I could pause/resume/#walk) on another mud, I thought about creating this. I think I had another problem with #paths, but I don't remember what it was. I just got fed up, and I have determined that #path does not work "properly."

I can use the map for a lot of very cool stuff, like exploring every room on a map, etc. But of course, there are still paths. So I made this, I hope its (or will be) cool :(
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Finished MUD Scripts All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net