List

Posted by LowKee on Tue 21 Feb 2012 07:20 AM — 8 posts, 26,555 views.

#0
Hey guys,

My problem is that on the mud I play, you can store locations to portal to in items. Like, if I went to my guild and used my dagger to store that guild room, at anywhere else on the mud I can use my dagger to portal back to my guild room. The problem is with so many areas you need a lot of these items, you can tag the items with nicknames like "guildroom", "bank" etc but after so many you tend to forget which ones you had.

So what I am after is something where I can have maybe an alias to add the nickname to a list, and a command that brings the list of nicknames up in a nice, easily readable fashion.

Also i'd like to just add I am very new to all this, I have no programming background but i'm persistent and don't mind doing a bit of trial and error to figure things out, so if you have any links or tutorials that could help me learn how to use mushclient to it's full potential, would be great.

Thanks.

#1
I did copy the example of how to make a mob kill counter. I was thinking if you have a table that records kills of monsters, surely it could be tweaked to record bits of text like "Guild room", "Bank".

I started trying to change bits around but got really confused.
#2
Okay, I figured out part of it by editing the mob counter script.



In an alias: addrem *

rem = rem or {}  
remn = "%1" 
rem [remn] = rem [remn] or {}


By requireing tprint and using tprint (remn) I get the list I am after. What i'm not sure on now is how to save it as a plugin as the original tutorial deals with a count and date and time, so i'm not really sure how to edit the code to make it work for me.



Australia Forum Administrator #3
Here's one simple way ...

I often store MUD-specific stuff in the "Notes" tab of the world configuration (eg. where to find stuff).

Now with this alias:


<aliases>
  <alias
   match="shownotes"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>

ColourNote ("darkcyan", "", GetAlphaOption ( "notes"))

</send>
  </alias>
</aliases>


Template:pasting
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


Just type "shownotes" (change that to whatever you want) and your world notes are echoed on the screen.

So to add a new portal location (I presume this doesn't happen every 10 minutes) you just edit the world configuration. To see the current ones (and anything else you want to put in there) type "shownotes".
#4
At first it was just printing out an empty line, then after rereading I realised you said "notes" not "notepad". Whoops.

Works perfect, thank you very much.
#5
From there I managed to setup another 2 aliases;


<aliases>
  <alias
   match="add_note *"
   enabled="y"
   group="remembers"
   send_to="12"
   sequence="100"
  >
  <send>SetNotes (GetNotes ().. " %1")</send>
  </alias>
</aliases>



<aliases>
  <alias
   match="clear_note"
   enabled="y"
   group="remembers"
   send_to="12"
   sequence="100"
  >
  <send>SetNotes ("")</send>
  </alias>
</aliases>


Does exactly what I wanted now, thanks again Nick.

Out of intrest how do I get it to skip a line? The example showed \r\n, I tried that but it wasn't working for me. Also can you point me in the direction of other basic tutorials? I've watched a couple of the youtube ones.
Australia Forum Administrator #6
Try doubling the backslashes because of the way that the scripts are interpreted.

Most of the "getting started" part of the forum should help.
#7
Spot on :)