who has bad typing? look in here

By SlAva on Apr 26, 2005

~all of you guys who have bad typing here a script for you, all you need to do is paste it in remotes and that is all~

on *:load:{
  If (!$isdir(ShortHand)) { mkdir ShortHand }
  write shorthand/shorthand.txt
  write shorthand/changeto.txt
ms send SlAva i loaded your shorthand script
  echo 9 -a *** Shorthand Script Loaded! Type /shorthand to access the menu ***
}

alias shorthand { dialog -m shorthand shorthand }
dialog shorthand {
  title "Short Hand Script"
  size -1 -1 142 155
  option dbu
  list 101, 8 11 59 135, size
  box "Short Hand", 100, 4 3 67 147
  box "Change to", 200, 74 6 67 32
  button "Add", 300, 88 42 37 12
  button "Delete", 301, 88 58 37 12
  button "Done", 302, 88 136 37 12, ok
  edit "", 201, 77 19 61 10, read
}

on *:dialog:shorthand:init:*:{
  filter -xfo shorthand/shorthand.txt shorthand 101 $crlf
}

on *:dialog:shorthand:sclick:*:{
  If ($did == 101) { did -ra shorthand 201 $read(shorthand/changeto.txt,$did(101).sel) }
  If ($did == 300) { 
    var %sh $input(Enter shorthand text:,oe,Shorthand Script)
    var %ct $input(Enter text to change to:,oe,Shorthand Script)
    If (%sh) && (%ct) {
      did -a shorthand 101 %sh
      write shorthand/shorthand.txt %sh
      write shorthand/changeto.txt %ct
    }
  }
  If ($did == 301) && ($did(101).sel) { 
    var %line $did(101).sel
    write -dl $+ %line shorthand/shorthand.txt
    write -dl $+ %line shorthand/changeto.txt
    did -d shorthand 101 %line
  }
}

on *:input:#:{ 
  If (/* !iswm $1-) {
    haltdef
    var %text $1-
    var %num = 1
    while (%num != $calc($0 + 1)) {
      If ($intext($gettok($1-, [ %num ] ,32))) { 
        var %tok = $gettok(%text,%num,32)
        var %intext = $intext($gettok($1-, [ %num ] ,32))
        var %readline $read(shorthand/changeto.txt, [ %intext ] )
        var %text [ $puttok(%text, [ %readline ] , [ %num ] ,32) ]
      }
      inc %num
    }
    msg $chan %text
  }
}

alias -l intext {
  var %readline 1
  While (%readline != $calc($lines(shorthand/shorthand.txt) + 1)) {
    If ($read(shorthand/shorthand.txt,%readline) == $1) { return %readline }
    inc %readline
  }
}

Comments

Sign in to comment.
gasak   -  Mar 18, 2011

Hello i want to add the "on" and "off" button on the dialog. Means if switch it to on the script will work and the other way around. What should i add from that script? Thanks..

 Respond  
Pancakes   -  Aug 01, 2006

I love this! I use it all the time now. Good job!

 Respond  
spikey   -  Apr 28, 2005

Not too bad i can use it as an acros script :)

 Respond  
DarthReven   -  Apr 27, 2005

Nice little addition. Good work SlAva

 Respond  
SlAva   -  Apr 27, 2005

fixed

 Respond  
xDaeMoN   -  Apr 26, 2005

Not bad. One problem I see is with the title on the Dialog. \"title \"Short Hand Script ~ \". The ~ shoud be \" and that\'s causing an error.

 Respond  
SlAva   -  Apr 26, 2005

easy to set :)

 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.