Door Games Unlimited

Welcome, Guest.


Subject: console.putmsg alternative that returns a string Date: Thu Oct 02 2014 08:23:32
From: Psi-Jack To: Nightfox

  Re: console.putmsg alternative that returns a string
  By: Nightfox to Psi-Jack on Wed Oct 01 2014 07:44 am

 Ni>  Re: console.putmsg alternative that returns a string
 Ni>  By: Psi-Jack to Nightfox on Wed Oct 01 2014 09:32:55

 Ps>> I believe what you're looking for is bbs.atcode():

 Ps>> text = text.replace(/@([^@]+)@/g, function(m, code) {
 Ps>> return bbs.atcode(code);
 Ps>> });

 Ni> I saw bbs.atcode() in the docs..  I was hoping for something that handles
 Ni> a whole string, similar to console.putmsg().  bbs.atcode() only interprets
 Ni> a single @-code, which requires writing some more code, but I suppose that
 Ni> will have to do.  Thanks.

Hmm, yeah. I don't think there's anything else. This text.replace itself goes
through each beginning and ending @ code block and translates each one, at
least as far as I can tell it does. the variable, text, becomes the full
at-code translated result. 

Either way, you're welcome, and hope it helps. :)

---
>>>[Psi-Jack -//- Decker]
 ■ Synchronet ■ Decker's Heaven -//- bbs.deckersheaven.com

Previous Message       Next Message
In Reply To: console.putmsg alternative that returns a string (Nightfox)
Replies: console.putmsg alternative that returns a string (Nightfox)