Top

chr encoder


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  7.0 (of 1 scores)
Date Added  Jul 30, 2009
Last Updated  Jul 30, 2009
Tags  chr  decoder  encoder  irc  mirc 

Introduction

This snippet turns the input in a $chr string

example:
if the input is 'Hi Sam!'
the output will be: $+($chr(72),$chr(105),$chr(32),$chr(83),$chr(97),$chr(109),$chr(33))

if you wan't to get it in normal text again: //echo -at <string>

Enjoy it

Grab the Code

menu channel,status {
  - 
  CHR encoder:dialog -m chr chr
}
dialog chr {
  title "Text Encoder"
  size -1 -1 150 173
  option dbu
  tab "Encoder",1,1 0 149 172
  box "Input:", 2, 8 15 133 38,tab 1
  edit "",3,12 24 125 25,tab 1 center multi
  box "Output:", 4, 8 53 133 98,tab 1
  edit "",5,12 62 125 85,tab 1 center multi read
  button "Generate code!",6, 97 153 45 18,tab 1 disabled
  text "©Patatje-oorlog Designs" 100, 8 158 62 11,disabled
}
on *:dialog:chr:*:*:{
  if ($devent == init) {
    did -h $dname 5
  }
  if ($devent == edit) { 
    if ($did == 3) { if ($did(3) == $null) { did -b $dname 6 } | else { did -e $dname 6 } } 
  }
  if ($devent == sclick) {
    if ($did == 6) {
      did -r $dname 5
      did -v $dname 5
      set %i 1
      :start
      if (%i > $len($did(3))) { unset %i | goto end }
      if (%i == 1) { var %chr-encoder $+($chr(36),+,$chr(40),$chr(36),chr,$chr(40),$asc($left($mid($did(3),%i),1)),$chr(41)) | inc %i 1 | goto start }
      else { var %chr-encoder $+(%chr-encoder,$chr(44),$chr(36),chr,$chr(40),$asc($left($mid($did(3),%i),1)),$chr(41),$iif(%i == $len($did(3)),$chr(41))) | inc %i 1 | goto start }
      :end
      did -i $dname 5 1 %chr-encoder
      halt
    }
  }
}

Comments

  (6)  RSS
Atr
Comments: 60
 
mIRC Snippet:  chr encoder
Posted on Jul 30, 2009 1:59 pm
That is a nice piece of work (now I can easily find out the chr codes, which is a hell of a lot easier!)

Thanks for this, good job.


Suggestion; maybe make something inside the dialog that turns it back? Rather than typing //echo -at <string>
MaSOuD
Comments: 32
 
mIRC Snippet:  chr encoder
Posted on Jul 30, 2009 4:33 pm
Good work, but i suggesting you to use Loop instead of GOTO like this:

while (%i <= $len($did(3))) {
if (%i == 1) { var %chr-encoder $+($chr(36),+,$chr(40),$chr(36),chr,$chr(40),$asc($left($mid($did(3),%i),1)),$chr(41)) }
else { var %chr-encoder $+(%chr-encoder,$chr(44),$chr(36),chr,$chr(40),$asc($left($mid($did(3),%i),1)),$chr(41),$iif(%i == $len($did(3)),$chr(41))) }
inc %i
}
aitor1976
Comments: 6
 
mIRC Snippet:  chr encoder
Posted on Jul 31, 2009 4:56 am
hy sorry,He(She) excuses podrias to put in binary code 001001110011 please
thank.
Patatje-oorlog
Comments: 19
 
mIRC Snippet:  chr encoder
Posted on Aug 3, 2009 1:32 pm
@ Atr:
I am still looking for a solution for that. I will update this script when i have the decode part done :P

@ MaSOuD:
Thx, i will add that later on (goto worked fine so i didn't bother to remake it with a while :P)

@ aitor1976]
I don't understand you lol, but i have a encoder that, if you type a number in the input field, the binairy code of this number will be outputted, i can post this script also if you wan't? xD
jonesy44
Comments: 1,856
 
mIRC Snippet:  chr encoder
Posted on Aug 3, 2009 6:26 pm
You could always use regex..

Code:
; set string to %str
var %str =
; convert each character to its ASCII value & add $chr() tags either side
return $regsubex(%str,/(.)/g,$+($,chr,$chr(40),$asc(\1),$chr(41),$chr(32),$iif(\n != \0,$!+),$chr(32)))


You could expand its usage further..
MaSOuD
Comments: 32
 
mIRC Snippet:  chr encoder
Posted on Aug 4, 2009 10:16 am
As you wish dear... that was just a suggestion to make your code shorter and better.
And it never bothering you, because u just need to copy/paste the code that i wrote to your code. (If you won't be lazy, lol)

Commenting Options

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

  
Bottom