In memory of Ben “bushing” Byer, who passed away on Monday, February 8th, 2016.

Difference between revisions of "CHANS reference"

From WiiBrew
Jump to navigation Jump to search
(←Created page with 'This page describes the CHANS functions, objects, and types/enums that can be used by CHANS scripts. For information on using CHANS, for filenames and locations etc, see [...')
 
m (Hallowizer moved page CHANS Reference to CHANS reference: Sentence case)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This page describes the CHANS functions, objects, and types/enums that can be used by [[CHANS]] scripts. For information on using CHANS, for filenames and locations etc, see [[WiiConnect24#CHANS_Usage|WiiConnect24]].
+
This page describes the CHANS functions, objects, and types/enums that can be used by [[CHANS]] scripts. For information on using CHANS, for filenames and locations etc, see [[WiiConnect24#CHANS Usage|WiiConnect24]]. To access object functions etc, use: objname.property, where objname is the object name, and property is the function name etc.
  
 
== General ==
 
== General ==
Line 7: Line 7:
 
== KD ==
 
== KD ==
  
This section is for info on functions etc that can only be used by KD scripts for [[WiiConnect24#CHANS_Usage|processing]] mail. To access imported objects functions etc, use: objname.property, where objname is the imported object name, and property is the function name etc.
+
This section is for info on functions etc that can only be used by KD scripts for [[WiiConnect24#CHANS Usage|processing]] mail. See [[WiiConnect24#Mail headers|WiiConnect24]] for info on mail headers.
  
 
Imported objects:
 
Imported objects:
Line 49: Line 49:
 
| 1 for failure, zero for success
 
| 1 for failure, zero for success
 
|  
 
|  
| Checks for the success for the previous NWC24 object function call.
+
| Checks for the success for the previous NWC24 and mail object function call.
 
|-
 
|-
 
| Enum
 
| Enum
Line 57: Line 57:
 
| MSGTYPE_PUBLIC, MSGTYPE_WII_MENU
 
| MSGTYPE_PUBLIC, MSGTYPE_WII_MENU
 
| Message types, unknown what mail header makes mail "public" and "normal".
 
| Message types, unknown what mail header makes mail "public" and "normal".
 +
|}
 +
 +
==== Mail ====
 +
This is the mail object returned by NWC24.getReceivedMsg and NWC24.getReplyMsg.
 +
{| class="wikitable"
 +
|-
 +
! Type
 +
! Name
 +
! Number of parameters for function
 +
! Return value for function
 +
! Possible values for enums
 +
! Description
 +
|-
 +
| Function
 +
| init
 +
| 1
 +
| none
 +
|
 +
| Initializes a mail object, needed for mail objects returned by NWC24.getReplyMsg. The input parameter is NWC24.MSGTYPE.
 +
|-
 +
| Function
 +
| commit
 +
| 1
 +
| none
 +
|
 +
| Saves the mail to [[:/shared2/wc24/mbox/wc24send.mbx|wc24send.mbx]] for reply mail, to be sent later.
 +
|-
 +
| Function
 +
| getType
 +
| 0
 +
| NWC24.MSGTYPE
 +
|
 +
| Gets the mail type.
 +
|-
 +
| Function
 +
| setToId
 +
| 1
 +
| none
 +
|
 +
| Sets the X-Wii-Id header to input parameter? The input parameter used is usually the NWC24.getMyUserId() retval.
 +
|-
 +
| Function
 +
| setAltName
 +
| 1
 +
| none
 +
|
 +
| Sets the X-Wii-AltName header to input parameter?
 +
|-
 +
| Function
 +
| setMBNoReply
 +
| 1
 +
| none
 +
|
 +
| Sets the X-Wii-MB-NoReply header to input parameter?(Input can be value 1.)
 +
|-
 +
| Function
 +
| readSubject
 +
| 0
 +
| Mail subject
 +
|
 +
| Gets the mail subject?
 +
|-
 +
| Function
 +
| setText
 +
| 1
 +
| none
 +
|
 +
| Sets the mail text body to input parameter?
 +
|-
 +
| Function
 +
| getTag
 +
| 0
 +
| X-Wii-Tag header?
 +
|
 +
| Gets the X-Wii-Tag header?
 +
|-
 +
| Function
 +
| setTag
 +
| 1
 +
| none
 +
|
 +
| Sets the X-Wii-Tag header to input parameter?
 +
|-
 +
| Function
 +
| setLedPattern
 +
| 1
 +
| none
 +
|
 +
| Disc drive LED related? Example input parameter: 8217.
 
|}
 
|}
  
 
== System menu banners  ==
 
== System menu banners  ==
  
This section is for info on functions etc that can only be used by system menu banner [[WiiConnect24#CHANS_Usage|scripts]]. Fill me in!
+
This section is for info on functions etc that can only be used by system menu banner [[WiiConnect24#CHANS Usage|scripts]]. Fill me in!
  
  
  
 
{{stub}}
 
{{stub}}

Latest revision as of 20:04, 10 August 2021

This page describes the CHANS functions, objects, and types/enums that can be used by CHANS scripts. For information on using CHANS, for filenames and locations etc, see WiiConnect24. To access object functions etc, use: objname.property, where objname is the object name, and property is the function name etc.

General

This section is for info on functions etc that is used in both KD and sysmenu VMs.

KD

This section is for info on functions etc that can only be used by KD scripts for processing mail. See WiiConnect24 for info on mail headers.

Imported objects:

  • NWC24


NWC24

Type Name Number of parameters for function Return value for function Possible values for enums Description
Function getStorage 0 0 for failure, FILE fd otherwise Opens storage.bin in title's wc24scr.vff under data directory.
Function getReceivedMsg 0 Mail object on success Gets a mail object for the received mail being processed.
Function getReplyMsg 0 Mail object on success Gets a mail object for replying to the mail being processed.
Function isFailed 0 1 for failure, zero for success Checks for the success for the previous NWC24 and mail object function call.
Enum MSGTYPE MSGTYPE_PUBLIC, MSGTYPE_WII_MENU Message types, unknown what mail header makes mail "public" and "normal".

Mail

This is the mail object returned by NWC24.getReceivedMsg and NWC24.getReplyMsg.

Type Name Number of parameters for function Return value for function Possible values for enums Description
Function init 1 none Initializes a mail object, needed for mail objects returned by NWC24.getReplyMsg. The input parameter is NWC24.MSGTYPE.
Function commit 1 none Saves the mail to wc24send.mbx for reply mail, to be sent later.
Function getType 0 NWC24.MSGTYPE Gets the mail type.
Function setToId 1 none Sets the X-Wii-Id header to input parameter? The input parameter used is usually the NWC24.getMyUserId() retval.
Function setAltName 1 none Sets the X-Wii-AltName header to input parameter?
Function setMBNoReply 1 none Sets the X-Wii-MB-NoReply header to input parameter?(Input can be value 1.)
Function readSubject 0 Mail subject Gets the mail subject?
Function setText 1 none Sets the mail text body to input parameter?
Function getTag 0 X-Wii-Tag header? Gets the X-Wii-Tag header?
Function setTag 1 none Sets the X-Wii-Tag header to input parameter?
Function setLedPattern 1 none Disc drive LED related? Example input parameter: 8217.

System menu banners

This section is for info on functions etc that can only be used by system menu banner scripts. Fill me in!