PPF Home
Plugins
Developers
   Font size:      

Ascii (v1.0)

PDF
PDF

Description

Converts plaintext to and from ASCII-code strings, and tells you the length of a string.

This plugin lets you specify a string of text, e.g. "hello", and it will return a string with the ASCII code equivalents of each character, e.g. "68656C6C6F".
The other way around is also supported - specify ASCII code string and get the text.
Hexadecimal ASCII codes is the default, but other bases can be used too.
The plugin also has a command to return the length of a string.

The format of the ASCII-code string is as if each character of the plaintext string was converted to the corresponding code individually, from start to end, and the codes then are appended onto eachother to get the final string. Each code is padded with zeroes in front until it is as long as the longest char is without padding - e.g. in decimal, code values for characters go from 0 to 255, so each character has a 3-char long code: "A" is 065, "B" is 066, "," is 044, "h" is 104.
This goes both ways - to convert a string back, it needs to contain an appropriate number of digits per character(and in total), or it may be converted wrongly.

Note that IRC has a maximum line length per message, so longer strings may be cut off at the end - leading to erroneus results. If this is suspected, try converting back to see if it has happened, and if so, split the text into smaller chunks and try again. The result of these chunks can then be appended to get the full result.

Configuration

The configuration file for this plugin is system/Ascii/AsciiConfig.xml

commandAsc

The command for converting from text to ASCII. This is also the prefix for the commands that specifies the base to use, and are going from text to ASCII. You can set the authLevel to control who is allowed to access the command. The output is used to define where the output from the command will go.

  • authLevel - ANY, ADMIN, MASTER, TRUSTED, NONE
  • output - CHANNEL, PM, NOTICE

      <commandAsc authLevel="none" output="channel">!asc</commandAsc>

    

commandDeAsc

The command for converting from ASCII to text. This is also the prefix for the commands that specifies the base to use, and are going from ASCII to text. You can set the authLevel to control who is allowed to access the command. The output is used to define where the output from the command will go.

  • authLevel - ANY, ADMIN, MASTER, TRUSTED, NONE
  • output - CHANNEL, PM, NOTICE

      <commandDeAsc authLevel="none" output="channel">!deasc</commandDeAsc>

    

commandLength

The command for counting the length of a string. You can set the authLevel to control who is allowed to access the command. The output is used to define where the output from the command will go.

  • authLevel - ANY, ADMIN, MASTER, TRUSTED, NONE
  • output - CHANNEL, PM, NOTICE

      <commandLength authLevel="none" output="channel">!length</commandLength>

    

Commands

!asc

Command: !asc
Description: This will return the ASCII equivalent of the given text.
Auth Level: none
Where to give command: channel, pm
Outputs to: same as given
Example(s):

  • !asc hello

!asc-B

Command: !asc-B
Description: This will return the ASCII equivalent of the given text, in the specified base. B is one of bin, oct, dec, hex, or a number from 2 to 36 inclusive.
Auth Level: none
Where to give command: channel, pm
Outputs to: same as given
Example(s):

  • !asc-oct hello
  • !asc-dec hello
  • !asc-12 hello
  • !asc-3 hello

!deasc

Command: !deasc
Description: This will return the plaintext equivalent of the given ASCII-code string.
Auth Level: none
Where to give command: channel, pm
Outputs to: same as given
Example(s):

  • !deasc 68656C6C6F

!deasc-B

Command: !deasc-B
Description: This will return the plaintext equivalent of the given ASCII-code string, which is in the specified base. B is one of bin, oct, dec, hex, or a number from 2 to 36 inclusive.
Auth Level: none
Where to give command: channel, pm
Outputs to: same as given
Example(s):

  • !deasc-oct 150145154154157
  • !deasc-dec 104101108108111
  • !deasc-12 088085090090093
  • !deasc-3 010212010202011000011000011010

!length

Command: !length
Description: This will return the length of the given string, in characters, including any whitespace.
Auth Level: none
Where to give command: channel, pm
Outputs to: same as given
Example(s):

  • !length hi there, how are you?

Change History

v1.0 First Version by EdorFaus