Page 1 of 1

Powwow, saving narrates/tells/etc to a file, and beeping

Posted: Fri Dec 05, 2008 5:30 pm
by science
I've been doing lots of scripting... I'll try posting a few things here and see if people find them interesting. Then maybe I'll post more :)

I don't think it's pasting the ASCII control characters properly. Grab the diamond/inviisble char from here and put it before any "["s http://nschimme.googlepages.com/ansi.htm

Obviously you'll have to change the path of the file for something that'll work on your machine.
#alias -={}
- this alias lets us make comments by starting with the - character. much prettier.

- it'll beep when someone tells you for the first time in @tellbeep_mins
#var @tell_timer=0
#var @tellbeep_mins=5
#alias tellbeep={#var @tellbeep_mins=$1}

- actions to see when people say/tell/narrate, and log to file. and beep if tells
#action >+alert-say [36m$1[36m says &2[0m={#write ("$1 says $2";"/Users/inspire/Projects/mume/says.txt"); #add $1;#print}
#action >+alert-say2 [36m$1[36m $2 &3[0m={#write ("$1 says $3";"/Users/inspire/Projects/mume/says.txt"); #print}
#action >+alert-narrates [33m$1 narrates &2[0m={#write ("$1 narrates $2";"/Users/inspire/Projects/mume/narrates.txt");#add $1; #if (@show_narrate) #print;}
#action >+alert-tell [32m$1 tells you &2[0m={#print;#write ("$1 tells you $2";"/Users/inspire/Projects/mume/tells.txt"); #add $1; #bind ctrl-r ^R=&insert-string tell $1 ;#if (((timer-@tell_timer)/1000) > ((@tellbeep_mins)*60)) {beep}; #(@tell_timer=timer)}

- add to the log when we says/tell something. says don't work, since we can't match on '
#alias tell={#write ("tell $0";"/Users/inspire/Projects/mume/tells.txt");#send ("tell $0")}
#alias say={#write ("say $0";"/Users/inspire/Projects/mume/says.txt");#send ("say $0")}
#alias narrate={#write ("narrate $0";"/Users/inspire/Projects/mume/narrates.txt");#send ("narrate $0")}
#alias nar=narrate $0
#alias na=narrate $0


- Get a list of the latest 40 says by typing 'says'
#al pline=#print (attr "green"+"-------------------------------------------------------------------------------"+noattr);
#var $nl=40;
#alias tells={ #if ("$0"!="") #var $nl=$0; pline; #print ("Last "+$nl+" tells:"); #exe ("#! tail -n "+$nl+" /Users/inspire/Projects/mume/tells.txt");#var $nl=40}
#alias narrates={ #if ("$0"!="") #var $nl=$0; pline; #print ("Last "+$nl+" narrates:"); #exe ("#! tail -n "+$nl+" /Users/inspire/Projects/mume/narrates.txt");#var $nl=40}
#alias says={ #if ("$0"!="") #var $nl=$0; pline; #print ("Last "+$nl+" says:"); #exe ("#! tail -n "+$nl+" /Users/inspire/Projects/mume/says.txt");#var $nl=40}

Hope someone finds this useful :) If so, let me know, and I'll post more stuff. Or just tell me to post more stuff anyways :)

Re: Powwow, saving narrates/tells/etc to a file, and beeping

Posted: Mon Dec 08, 2008 8:35 am
by Chark
You are stopping now? Post more stuff! 8-)

Re: Powwow, saving narrates/tells/etc to a file, and beeping

Posted: Sat Feb 28, 2009 2:53 pm
by Wobbler
You ought to be able to post \027, which is sometimes better when pasting text anyway.