Help:Editing

From SphereWiki
Jump to: navigation, search
Help
Available languages


For standard wiki editing help, try MediaWiki's Editing Pages help guide.

In addition to the standard wiki formatting techniques, SphereWiki also uses some custom tags which are detailed below:


spherescript

The <spherescript> tag can be used to easily embed SphereScript code into a wiki page without having to cover it with wiki/html formatting tags. There are a few option attributes which can be set to customize the output of the tag. The full syntax of the tag along with the default settings for each attribute, is:


<spherescript color="darkblue" mono="1" format="1" tab="4"> script </spherescript>


Attribute Meaning
color What colour font to use.
mono Whether or not to use a fixed-width font
format Whether or not to automatically format the script (currently, auto-indents)
tab How many spaces to output for each level of indentation.


For example:

<spherescript>
[FUNCTION f_testscript]
LOCAL.TEST = <R100>
IF (<LOCAL.TEST> > 90)
	SRC.SYSMESSAGE You win this script!
ELSE
	SRC.SYSMESSAGE Unlucky, you lost!
ENDIF
RETURN
</spherescript>

Becomes:

[FUNCTION f_testscript]
LOCAL.TEST = <R100>
IF (<LOCAL.TEST> > 90)
    SRC.SYSMESSAGE You win this script!
ELSE
    SRC.SYSMESSAGE Unlucky, you lost!
ENDIF
RETURN


If automatic formatting is enabled (which it is by default), then the script will be automatically indented, for example:

<spherescript>
[ITEMDEF i_testitem]
ID=i_gold

ON=@DClick
SRC.SYSMESSAGE You double-clicked the item...
IF (<SRC.STR> < 100)
SRC.SYSMESSAGE but you don't have enough strength!
ELSE
SRC.SYSMESSAGE and you have enough strength!
IF (<SRC.INT> > 100)
SRC.SYSMESSAGE You're pretty clever too!
FORCHARS 18
SAY We agree!
ENDFOR
ENDIF
ENDIF
</spherescript>

Becomes:

[ITEMDEF i_testitem]
ID=i_gold

ON=@DClick
    SRC.SYSMESSAGE You double-clicked the item...
    IF (<SRC.STR> < 100)
        SRC.SYSMESSAGE but you don't have enough strength!
    ELSE
        SRC.SYSMESSAGE and you have enough strength!
        IF (<SRC.INT> > 100)
            SRC.SYSMESSAGE You're pretty clever too!
            FORCHARS 18
                SAY We agree!
            ENDFOR
        ENDIF
    ENDIF