Difference between revisions of "Code"

From Masq
m
Line 1: Line 1:
Various snippets of code can make one's life easier (or more complicated), and this is where you can grab them for your character.
+
Various snippets of code can make one's life easier (or more complicated), and this is where you can grab them for your character. Copy them from the page, then paste them into your MU* client, and enjoy!
  
 
== Texting Code ==
 
== Texting Code ==
 
{|
 
{|
 
|-
 
|-
|'''This code is for sending IC text messages from a phone.  Copy and paste all three attributes onto yourself, then use ''+text whoever=whatever'' to send your messages.'''
+
|'''This code is for sending IC text messages from a phone.  You'll need all three attributes. Syntax: ''+text name=message'''''
 
|-
 
|-
 
|style="padding: 1em;border: 1px dashed #2f6fab;color: black;background-color: #f9f9f9;line-height: 1.25em;font-family: monospace;"|&cmd-text me=$+text *=*:think if(isdbref(num(*%0)),[if(lte(strlen(%1),160),[u(fun-text_send,%0,%1)],[u(fun-text_proc,%0,%1)])],"%0" doesn't seem to be a valid player. Please try again!)
 
|style="padding: 1em;border: 1px dashed #2f6fab;color: black;background-color: #f9f9f9;line-height: 1.25em;font-family: monospace;"|&cmd-text me=$+text *=*:think if(isdbref(num(*%0)),[if(lte(strlen(%1),160),[u(fun-text_send,%0,%1)],[u(fun-text_proc,%0,%1)])],"%0" doesn't seem to be a valid player. Please try again!)
Line 13: Line 13:
 
|-
 
|-
 
|Original code by [[Zack]], modified by [[Jai]].
 
|Original code by [[Zack]], modified by [[Jai]].
 +
|-
 +
|}
 +
 +
== Directed +Where ==
 +
{|
 +
|-
 +
|'''This code works like +where, but for a specific person.  Syntax: ''+where name'''''
 +
|-
 +
|style="padding: 1em;border: 1px dashed #2f6fab;color: black;background-color: #f9f9f9;line-height: 1.25em;font-family: monospace;"|&cmd-where me=$+where *:think [ansi(hr,REPORT:)] [name([pmatch(%0)])] is currently at: [name([loc(*%0)])]
 +
|-
 +
|Code by [[Petra]]
 +
|-
 +
|}
 +
 +
== Idle Time Checker ==
 +
{|
 +
|-
 +
|'''This code reports how long a specific person has been idle.  Syntax: ''+idle name'''''
 +
|-
 +
|style="padding: 1em;border: 1px dashed #2f6fab;color: black;background-color: #f9f9f9;line-height: 1.25em;font-family: monospace;"|&cmd-idle me=$+idle *:think [ansi(hr,REPORT:)] [name(pmatch(%0))] has been idle [exptime(idle(%0))].
 +
|-
 +
|Code by [[Petra]]
 
|-
 
|-
 
|}
 
|}

Revision as of 15:11, 22 November 2010

Various snippets of code can make one's life easier (or more complicated), and this is where you can grab them for your character. Copy them from the page, then paste them into your MU* client, and enjoy!

Texting Code

This code is for sending IC text messages from a phone. You'll need all three attributes. Syntax: +text name=message
&cmd-text me=$+text *=*:think if(isdbref(num(*%0)),[if(lte(strlen(%1),160),[u(fun-text_send,%0,%1)],[u(fun-text_proc,%0,%1)])],"%0" doesn't seem to be a valid player. Please try again!)
&fun-text_proc me=[setq(0,%1)][setq(1,mid(%q0,0,160))][if(match(mid(%q0,160,1), ),[setq(0,mid(%q0,160,strlen(%q0)))],[setq(2,[strtrunc(%q1,sub(strlen(%q1),strlen(last(%q1))))])][setq(1,%q2)][setq(0,mid(%q0,strlen(%q2),strlen(%q0)))])][u(fun-text_send,%0,%q1)][if(strlen(%q0),u(fun-text_proc,%0,%q0))]
&fun-text_send me=[pemit(%#,You text to [name(*%0)]: %1)][pemit(num(*%0),You receive a text from %N: %1)]
Original code by Zack, modified by Jai.

Directed +Where

This code works like +where, but for a specific person. Syntax: +where name
&cmd-where me=$+where *:think [ansi(hr,REPORT:)] [name([pmatch(%0)])] is currently at: [name([loc(*%0)])]
Code by Petra

Idle Time Checker

This code reports how long a specific person has been idle. Syntax: +idle name
&cmd-idle me=$+idle *:think [ansi(hr,REPORT:)] [name(pmatch(%0))] has been idle [exptime(idle(%0))].
Code by Petra