$chr(#) search Dialog

By Scakk on Jul 05, 2008

This little dialog will search for the $chr() for up to 5 characters at one time.

Image

Image

Image

menu channel {
  ASC:dialog $iif($dialog(ASC), -va, -m) ASC ASC
}
dialog ASC {
  title "$chr(#) lookup"
  size -1 -1 150 30
  edit "", 1, 5 5 75 20, autohs
  edit "", 2, 5 33 140 20, read autohs center
  edit "", 3, 5 58 140 20, read autohs center
  edit "", 4, 5 83 140 20, read autohs center
  edit "", 5, 5 108 140 20, read autohs center
  edit "", 6, 5 133 140 20, read autohs center
  button "Look Up", 7, 85 5 60 20
}
on *:dialog:ASC:*:*: {
  if ($devent == init) { did -r $dname 1-6 | did -b $dname 7 }
  if ($devent == edit) { $iif($len($did(1)) <= 5, did -e $dname 7, did -b $dname 7) }
  if ($devent == sclick) {
    if ($did == 7) {
      if ($len($did(1)) < 1) { dialog -s $dname -1 -1 150 30 | did -r $dname 1-6 | did -b $dname 7 }
      if ($len($did(1)) == 1) { dialog -s $dname -1 -1 150 55 | set %asc $did(1).text | $chars(%asc) }
      if ($len($did(1)) == 2) { dialog -s $dname -1 -1 150 80 | set %asc $did(1).text | $chars(%asc) }
      if ($len($did(1)) == 3) { dialog -s $dname -1 -1 150 105 | set %asc $did(1).text | $chars(%asc) }
      if ($len($did(1)) == 4) { dialog -s $dname -1 -1 150 130 | set %asc $did(1).text | $chars(%asc) }
      if ($len($did(1)) == 5) { dialog -s $dname -1 -1 150 155 | set %asc $did(1).text | $chars(%asc) }
    }
  }
}
alias chars {
  $iif($mid(%asc,5,1) != $null, set %z5 $ $+ chr( $+ $asc($mid(%asc,5,1)) $+ ), dialog -s ASC -1 -1 150 130 )
  $iif($mid(%asc,4,1) != $null, set %z4 $ $+ chr( $+ $asc($mid(%asc,4,1)) $+ ), dialog -s ASC -1 -1 150 105 )
  $iif($mid(%asc,3,1) != $null, set %z3 $ $+ chr( $+ $asc($mid(%asc,3,1)) $+ ), dialog -s ASC -1 -1 150 80 )
  $iif($mid(%asc,2,1) != $null, set %z2 $ $+ chr( $+ $asc($mid(%asc,2,1)) $+ ), dialog -s ASC -1 -1 150 55 )
  $iif($mid(%asc,1,1) != $null, set %z $ $+ chr( $+ $asc($mid(%asc,1,1)) $+ ), dialog -s ASC -1 -1 150 30 ) 
  $iif(%z5, did -ra ASC 6 $chr(91) $replace($mid(%asc,5,1),$chr(2),Bold,$chr(3),Color,$chr(15),Reset,$chr(22),Reverse,$chr(31),Underline,$chr(32),Space,$chr(160),Hard space) $chr(93) = $replace(%z5,$chr(2),Bold,$chr(3),Color,$chr(15),Reset,$chr(22),Reverse,$chr(31),Underline,$chr(32),Space,$chr(160),Hard space)) 
  $iif(%z4, did -ra ASC 5 $chr(91) $replace($mid(%asc,4,1),$chr(2),Bold,$chr(3),Color,$chr(15),Reset,$chr(22),Reverse,$chr(31),Underline,$chr(32),Space,$chr(160),Hard space) $chr(93) = $replace(%z4,$chr(2),Bold,$chr(3),Color,$chr(15),Reset,$chr(22),Reverse,$chr(31),Underline,$chr(32),Space,$chr(160),Hard space))
  $iif(%z3, did -ra ASC 4 $chr(91) $replace($mid(%asc,3,1),$chr(2),Bold,$chr(3),Color,$chr(15),Reset,$chr(22),Reverse,$chr(31),Underline,$chr(32),Space,$chr(160),Hard space) $chr(93) = $replace(%z3,$chr(2),Bold,$chr(3),Color,$chr(15),Reset,$chr(22),Reverse,$chr(31),Underline,$chr(32),Space,$chr(160),Hard space))
  $iif(%z2, did -ra ASC 3 $chr(91) $replace($mid(%asc,2,1),$chr(2),Bold,$chr(3),Color,$chr(15),Reset,$chr(22),Reverse,$chr(31),Underline,$chr(32),Space,$chr(160),Hard space) $chr(93) = $replace(%z2,$chr(2),Bold,$chr(3),Color,$chr(15),Reset,$chr(22),Reverse,$chr(31),Underline,$chr(32),Space,$chr(160),Hard space)) 
  $iif(%z, did -ra ASC 2 $chr(91) $replace($mid(%asc,1,1),$chr(2),Bold,$chr(3),Color,$chr(15),Reset,$chr(22),Reverse,$chr(31),Underline,$chr(32),Space,$chr(160),Hard space) $chr(93) = $replace(%z,$chr(2),Bold,$chr(3),Color,$chr(15),Reset,$chr(22),Reverse,$chr(31),Underline,$chr(32),Space,$chr(160),Hard space))
  unset %z* unset %asc
}

Comments

Sign in to comment.
Scakk   -  Jul 07, 2008

http://www.hawkee.com/snippet/4663/ I scripted a version that allows unlimited look ups at once. It also has an add to clipboard function.

 Respond  
vaseline28   -  Jul 06, 2008

Copy to Clipboard would be nice I agree!

 Respond  
Typo   -  Jul 06, 2008

The idea was more than that, it was also to be able to send the $chr(#) to the clipboard without 5 new \"Send to clipboard\" buttons.

The script is great the way it is sure but I just thought I would pass on ideas to improve it.

Besides, what about like this very short line I might want changed to chr\'s...

ctrl+b ctrl+u ctrl+k ##,## ctrl+k ctrl+b ctrl+u

That is just to set the color with bold and underline and then unset them all right? But to get the $chr\'s for it all i would have to use his script twice and hand enter the $chr items to where i needed them building my final line by myself after multiple steps.

Anyhow thats just my ideas/opinions so take em or leave em.

 Respond  
vaseline28   -  Jul 06, 2008

I don\'t agree about the ListBox, I think this works nicely as it is. A user could easily search another timer if more are needed.

Lovely script Scakk! 9/10

 Respond  
Eugenio   -  Jul 05, 2008

yeah that clipboard option would pwnz0r

 Respond  
Typo   -  Jul 05, 2008

I agree, it\'s a pretty nice script but I have a suggestion.

Maybe use a listbox to show the results instead of limiting it to 5 characters. Then the user could enter as many as they needed and still have them all returned. Then you could also maybe add a send to clipboard option for whichever line(s) they select in the listbox to send the $chr(#)/$chr(#)\'s to the clipboard for easy pasting.

Just a suggestion tho.

Well done.

 Respond  
Eugenio   -  Jul 05, 2008

damn this pwnz0rs......so usefull and easy to use.
/me rates 9

 Respond  
EL   -  Jul 05, 2008

Ima agree with Jamie.\"Rate it or Hate it?\"...8/10.`-.-´

 Respond  
Jamiie   -  Jul 05, 2008

Nice snippet. Does exactly what it\'s supposed to do.

8/10

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.