Top

Converting Octal & Hex & ASCII --


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  Jul 31, 2009
Last Updated  Jul 31, 2009
Tags  44  addon  asc  ascii  change  chr  codes  decimal  help  hex  html  ini  jonesy  jonesy44  mirc  numbers  oct  octal  regex  script  text 

Introduction

5 Seperate aliases to do some fairly simple tasks

- html2chr: converts html encoded ascii characters to normal symbols
-- helpful for sockets as it scans the entire line

- oct2chr: converts octal numbers to ascii character symbols
- oct: retrieves octal code for ascii symbol

- hex2chr: converts hexidecimal numbers to ascii character symbols
- hex: retrieves hexidecimal code for ascii symbol

Rate & Comment & Likes if you find it helpful ;)

Grab the Code

; syntax: $html2chr(txt)
; -- returns "txt" with converted &#<x> values
; -- e.g. $html2chr(&#100) -- "d"
alias html2chr return $replace($regsubex($1-,/(&#(\d*));?/g,$chr(\2)),&nbsp;,$chr(32),&amp;,&)
 
; syntax: $oct2chr(txt)
; -- returns "txt", converting any 3 number selections from octal to their ascii symbols
; -- e.g. $oct2chr(100) -- "@"
alias oct2chr return $regsubex($1-,/(\d{3})/g,$chr($base(\1,8,10,0)))
; syntax: $oct(X)
; -- returns octal value of character "X"
; -- e.g. $oct(@) -- "100"
alias oct return $base($asc($1),10,8,3)
 
; syntax: $hex2chr(txt)
; -- returns "txt", converting any hex values into their ascii symbols
alias hex2chr return $regsubex($1-,/(\d{2}|\w+)/g,$chr($base(\1,16,10,0)))
; syntax: $hex(X)
; -- returns hex value of character "X"
; -- e.g. $hex(?) -- "3F"
alias hex return $base($asc($1),10,16,0)

Comments

  (3)  RSS
D2K7
Comments: 24
 
mIRC Snippet:  Converting Octal & Hex & ASCII --
Posted on Jul 31, 2009 9:12 pm
i will rate 5 out of 10 bcuz it aint that Usefull to meh but good code :D
jonesy44
Comments: 1,856
 
mIRC Snippet:  Converting Octal & Hex & ASCII --
Posted on Aug 1, 2009 6:53 pm
Perhaps not helpful to you :L
D2K7
Comments: 24
 
mIRC Snippet:  Converting Octal & Hex & ASCII --
Posted on Aug 12, 2009 8:32 pm
Mhm

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom