AniDB O'Matic - Documentation: Local file renaming: Difference between revisions

Line 385: Line 385:
==Functions==
==Functions==
{|
{|
|-valign="top"
|at(lang)||text||Returns a main/official anime title in '''lang'''. '''lang''' can be either a text or a number. <br>Example: at(2) = japanese title<br>Example: at('japanese (transcription)') = japanese transcription<br>Example: at('en') = english title
|at(lang)||text||Returns a main/official anime title in '''lang'''. '''lang''' can be either a text or a number. <br>Example: at(2) = japanese title<br>Example: at('japanese (transcription)') = japanese transcription<br>Example: at('en') = english title
|-
|-valign="top"
|contains(find, text)||boolean||Returns true if '''find''' is found in '''text'''.<br>Example: contains('bcd', 'abcdef') = true
|contains(find, text)||boolean||Returns true if '''find''' is found in '''text'''.<br>Example: contains('bcd', 'abcdef') = true
|-
|-valign="top"
|copy(text, start[, length])||string||Returns '''length''' letters from letter number '''start''' of '''text'''.<br>Example: copy('abcdefgh', 3, 2) = 'cd'
|copy(text, start[, length])||string||Returns '''length''' letters from letter number '''start''' of '''text'''.<br>Example: copy('abcdefgh', 3, 2) = 'cd'
|-
|-valign="top"
|et(lang)||text||Returns an episode title in '''lang'''. '''lang''' can be either a text or a number.<br>Example: et(2) = japanese title<br>Example: et('en') = english title
|et(lang)||text||Returns an episode title in '''lang'''. '''lang''' can be either a text or a number.<br>Example: et(2) = japanese title<br>Example: et('en') = english title
|-
|-valign="top"
|getanime(name, id)||object||Sets the variable '''name''' to the anime object for '''id'''.<br>Example: getanime('a2', 78)
|getanime(name, id)||object||Sets the variable '''name''' to the anime object for '''id'''.<br>Example: getanime('a2', 78)
|-
|-valign="top"
|getepisode(name, id)||object||Sets the variable '''name''' to the episode object for '''id'''.<br>Example: getepisode('e2', 8878)
|getepisode(name, id)||object||Sets the variable '''name''' to the episode object for '''id'''.<br>Example: getepisode('e2', 8878)
|-
|-valign="top"
|if(test, trueval[, falseval])||any||If statement, returns '''trueval''' if '''test''' is true, otherwise returns '''falseval'''.<br> Example: if(23=23, 'equal', 'not equal') = 'equal'
|if(test, trueval[, falseval])||any||If statement, returns '''trueval''' if '''test''' is true, otherwise returns '''falseval'''.<br> Example: if(23=23, 'equal', 'not equal') = 'equal'
|-
|-valign="top"
|in(find, text...)||boolean||Checks if '''find''' is present in a number of '''text''' parameters.<br>Example: in('bb', 'aa', 'bb', 'cc', 'dd') = true
|in(find, text...)||boolean||Checks if '''find''' is present in a number of '''text''' parameters.<br>Example: in('bb', 'aa', 'bb', 'cc', 'dd') = true
|-
|-valign="top"
|join(glue, text...)||string||Joins together two or more '''text'''s, empty parameters are ignored with no glue added.<br>Example: join(' ', 'a', 'b', 'c') = 'a b c'
|join(glue, text...)||string||Joins together two or more '''text'''s, empty parameters are ignored with no glue added.<br>Example: join(' ', 'a', 'b', 'c') = 'a b c'
|-
|-valign="top"
|lc(text)||string||Converts '''text''' to lower case.<br>Example: lc('ABCDEF') = 'abcdef'
|lc(text)||string||Converts '''text''' to lower case.<br>Example: lc('ABCDEF') = 'abcdef'
|-
|-valign="top"
|length(text)||number||Returns the length of '''text'''.<br>Example: length('abcdef') = 6
|length(text)||number||Returns the length of '''text'''.<br>Example: length('abcdef') = 6
|-
|-valign="top"
|limit(text, length[, end])||string||Limits the length of '''text''' to at most '''length''' characters. '''End''' is optional, if specified and the text is cropped, it'll be added at the end of text.<br>Example: limit(e, 100) or limit('abcdefghijklmnop', 7, '...') = 'abcd...'
|limit(text, length[, end])||string||Limits the length of '''text''' to at most '''length''' characters. '''End''' is optional, if specified and the text is cropped, it'll be added at the end of text.<br>Example: limit(e, 100) or limit('abcdefghijklmnop', 7, '...') = 'abcd...'
|-
|-valign="top"
|max(number...)||number||Returns the highest supplied number<br>Example: max(1, 7, 3, 9, 2) = 9
|max(number...)||number||Returns the highest supplied number<br>Example: max(1, 7, 3, 9, 2) = 9
|-
|-valign="top"
|min(number...)||number||Returns the lowest supplied number<br>Example: min(1, 7, 3, 9, 2) = 1
|min(number...)||number||Returns the lowest supplied number<br>Example: min(1, 7, 3, 9, 2) = 1
|-
|-valign="top"
|numeric(var)||boolean||Returns true if '''var''' contains a numeric value.<br>Example: numeric('11') = true
|numeric(var)||boolean||Returns true if '''var''' contains a numeric value.<br>Example: numeric('11') = true
|-
|-valign="top"
|pad(text, newlength[, padchar])||string||Pads '''text''' on both sides to make it '''length''' characters long.<br>Example ?pad('hello', 9, '_') = '__hello__'
|pad(text, newlength[, padchar])||string||Pads '''text''' on both sides to make it '''length''' characters long.<br>Example ?pad('hello', 9, '_') = '__hello__'
|-
|-valign="top"
|padl(text, newlength[, padchar])||string||Pads '''text''' on the left side to make it '''length''' characters long.<br>Example ?padl('hello', 9, '_') = '____hello'
|padl(text, newlength[, padchar])||string||Pads '''text''' on the left side to make it '''length''' characters long.<br>Example ?padl('hello', 9, '_') = '____hello'
|-
|-valign="top"
|padr(text, newlength[, padchar])||string||Pads '''text''' on the right side to make it '''length''' characters long.<br>Example ?padr('hello', 9, '_') = 'hello____'
|padr(text, newlength[, padchar])||string||Pads '''text''' on the right side to make it '''length''' characters long.<br>Example ?padr('hello', 9, '_') = 'hello____'
|-
|-valign="top"
|replace(text, find[, replace])||string||Replaces all occurences of '''find''' with '''replace''' in '''text'''.<br>Example: replace('HELLO THERE!', 'THERE', 'TREES') = 'HELLO TREES!'
|replace(text, find[, replace])||string||Replaces all occurences of '''find''' with '''replace''' in '''text'''.<br>Example: replace('HELLO THERE!', 'THERE', 'TREES') = 'HELLO TREES!'
|-
|-valign="top"
|replacei(text, find[, replace])||string||Case insensitive replace of all occurences of '''find''' with '''replace''' in '''text'''.<br>Example: replace('HELLO tHeRe!', 'ThErE', 'TREES') = 'HELLO TREES!'
|replacei(text, find[, replace])||string||Case insensitive replace of all occurences of '''find''' with '''replace''' in '''text'''.<br>Example: replace('HELLO tHeRe!', 'ThErE', 'TREES') = 'HELLO TREES!'
|-
|-valign="top"
|replacerepeat(text, find[, replace])||string||Runs replace repeatedly until the result stops changing.
|replacerepeat(text, find[, replace])||string||Runs replace repeatedly until the result stops changing.
|-
|-valign="top"
|sc(text)||string||Converts '''text''' to sentence case.<br>Example: sc('HELLO THERE!') = 'Hello there!'
|sc(text)||string||Converts '''text''' to sentence case.<br>Example: sc('HELLO THERE!') = 'Hello there!'
|-
|-valign="top"
|set(name, data)||nothing||Declares a new variable called '''name''' containing '''data'''.<br>Example: set('temp', 'text')
|set(name, data)||nothing||Declares a new variable called '''name''' containing '''data'''.<br>Example: set('temp', 'text')
|-
|-valign="top"
|split(text, find, index)||string||Splits '''text''' on '''find''' and returns the specified '''index'''. Index starts from 1.<br>Example: split('2011-05-19', '-', 2) = 05
|split(text, find, index)||string||Splits '''text''' on '''find''' and returns the specified '''index'''. Index starts from 1.<br>Example: split('2011-05-19', '-', 2) = 05
|-
|-valign="top"
|start(text, find)||boolean||Checks if '''find''' matches the start of '''text'''.<br>Example: start('1999', '199') = true
|start(text, find)||boolean||Checks if '''find''' matches the start of '''text'''.<br>Example: start('1999', '199') = true
|-
|-valign="top"
|starti(text, find)||boolean||Checks if '''find''' matches the start of '''text'''. Case insensitive.<br>Example: start('1999', '199') = true
|starti(text, find)||boolean||Checks if '''find''' matches the start of '''text'''. Case insensitive.<br>Example: start('1999', '199') = true
|-
|-valign="top"
|substr(text, start[, length])||string||Alias for copy.
|substr(text, start[, length])||string||Alias for copy.
|-
|-valign="top"
|tc(text)||string||Converts '''text''' to title case.<br>Example: tc('HELLO THERE!') = 'Hello There!'
|tc(text)||string||Converts '''text''' to title case.<br>Example: tc('HELLO THERE!') = 'Hello There!'
|-
|-valign="top"
|trim(text)||string||Removes leading and trailing spaces from '''text'''.
|trim(text)||string||Removes leading and trailing spaces from '''text'''.
|-
|-valign="top"
|uc(text)||string||Converts '''text''' to upper case.<br>Example: uc('abcd') = 'ABCD'
|uc(text)||string||Converts '''text''' to upper case.<br>Example: uc('abcd') = 'ABCD'
|}
|}
254

edits

MediaWiki spam blocked by CleanTalk.
MediaWiki spam blocked by CleanTalk.