myX Input

By h3lp on Jul 15, 2008

Hello,

After some time leave mIRC scripting, i come back with something new. I've tried to combine all possible input function and compile into one. More challenging when first time designing menu using $submenu().

User will be able to set their own interested style and word without seeing the code, and able to set to use the addon at the selected channel/query only. That is my first purpose on creating this addon.

I have tried to code it beautiful as possible, with less error occur. Please do try and comment. Let me know what am i lacking of. All your comment will be guiding me through mIRC scripting. Thank you.


  How to Use

1) go to a channel/query
2) right click, and turn the script on (Remember, all channel/query have it's own set)
3) right click again, you will see the menu is expending.
4) To try out something really fast, go to "Colour Under [OFF]" and set it to ON.
5) try to type anything (channel/query) and enter.
6) You will see your input will be coloured and underlined.
7) How to set nick completor/word completor/code highlight. I will explain.
8) Go to word completor, (On it first), then go to "add new word"
9) An Input box will be popped up, and ask to enter something. Now try "Lol" (Enter)
10) Now, it will ask what is the full word meaning. Type in "Laugh Out Loud" (with or without color/bold/underline)
11) Now, to try the word you just key in, go to the (Channel/query) and type: hi lol (enter)
12) you will see, your word will be "hi Laugh Out Loud"
13) Now, let say, you want to delete the "lol".
14) Go to word completor again (make sure it's on), and you will see the "Delete [lol] [Laugh Out Loud]" is in the poppup.
15) Click the poppup, and done with deleting the entry.

This will take some time to understand, but i guess, it will be a pleasure after know how to use it. :)

p/s: Sorry for not explain how to use it earlier. I thought everyone will know how to use it at first time.

-h3lp

;--------------------------------------------;
;              myX Properties                ;
;    Created by h3lp/Arepie @ WebChat.Org    ;
;                                            ;
;                myX Input                   ;
;              Version 2.2.4                 ;
;                                            ;
;--------------------------------------------;
;        Release Under MIT License           ;
;--------------------------------------------;
; The MIT License is a free software license ;
; originating at the Massachusetts Institute ;
;  of Technology (MIT). It is a permissive   ;
;  license, meaning that it permits reuse    ;
;     within proprietary software on the     ;
; condition that the license is distributed  ;
;  with that software, and GPL-compatible,   ;
; meaning that the GPL permits combination   ;
;   and redistribution with software that    ;
;          uses the MIT License.             ;
;--------------------------------------------;

;------- [Input Engine] to the string
alias -l inputengine {
  var %tmp_input $1-
  %tmp_input = $iif($($+(%,$cid,$active,word),2),$wordcom(%tmp_input),%tmp_input)
  %tmp_input = $iif($($+(%,$cid,$active,nickcom),2),$regsubex(%tmp_input,/((\w|[[:punct:]])+)/g,$iif(\1 ison $active || \1 == $active,$replace($($+(%,myxinput,.,nickcom),4),-|-,\1),\1)),%tmp_input)
  %tmp_input = $iif($($+(%,$cid,$active,chl),2),$chl(%tmp_input),%tmp_input)
  %tmp_input = $iif($($+(%,$cid,$active,updown),2),$regsubex(%tmp_input,/(\w)/g,$iif($r(0,1),$upper(\1),\1)),%tmp_input)
  %tmp_input = $iif($($+(%,$cid,$active,ascii),2),$regsubex(%tmp_input,/(\w)/g,$iif($r(0,1),$replace(\1,a,à,b,ß,c,ç,e,ë,i,ï,n,ñ,o,õ,u,ù,y,ÿ),\1)),%tmp_input)
  %tmp_input = $iif($($+(%,$cid,$active,core),2),$regsubex(%tmp_input,/(?:(\b(\w|\d)|((\w|\d)\b)))/ig,$+($chr(3),$iif($($+(%,$active,$cid,color),2),$v1,4),$chr(31),\1,$chr(31),$chr(3),$iif($($+(%,$active,$cid,colorb),2),$v1),$chr(2),$chr(2))),%tmp_input))
  return %tmp_input
}

;------ [$submenu()]
alias -l colournunder {
  if ($($+(%,$cid,$active,core),2)) {
    if ($1 == begin) return -
    else if ($1 == 1) return Set $active Front Color:set $+(%,$active,$cid,color) $($$?="Enter Color Number",0)
    else if ($1 == 2) return Set $active Bg Color:set $+(%,$active,$cid,colorb) $($$?="Enter Bg Color Number",0)
    else if ($1 == 3) return Unset $active Colors:unset $+(%,$active,$cid,color*)
    else if ($1 == end) return
  }
}

alias -l displayWord {
  if ($($+(%,$cid,$active,word),2)) {
    if ($1 == begin) return -
    else if ($var($+(%,myxinput,.,word,.,*),$1)) return $($+(Delete,$chr(32),[,$($$gettok($v1,3,46),4),],$chr(32),[,$strip($($v1,4)),])) : unset $v1
    else if ($1 == end) return -
  }
}

alias -l displayWordStart {
  if ($($+(%,$cid,$active,word),2)) {
    if ($1 == begin) return -
    else if ($1 == 1) return Add New Word:makeword
    else if ($1 == end) return -
  }
}

alias -l displayWordEnd {
  if ($($+(%,$cid,$active,word),2)) {
    if ($1 == begin) return -
    else if ($1 == 1) return Unset All:unset $($+(%,myxinput,.,word,.,*),0)
    else if ($1 == end) return -
  }
}

alias -l displayNickCom {
  if ($($+(%,$cid,$active,nickcom),2)) {
    if ($1 == begin) return -
    else if ($var($+(%,myxinput,.,nickcom),$1)) return $($+(Delete,$chr(32),[,$($$gettok($v1,2,46),4),],$chr(32),[,$strip($($v1,4)),])) : unset $$v1
    else if ($1 == end) return -
  }
}

alias -l displayNickComStart {
  if ($($+(%,$cid,$active,nickcom),2)) && (!$($+(%,myxinput,.,nickcom),2)) {
    if ($1 == begin) return -
    else if ($1 == 1) return Set Design:makenickcom
    else if ($1 == end) return -
  }
}

alias -l displayHighlight {
  if ($($+(%,$cid,$active,chl),2)) {
    if ($1 == begin) return -
    else if ($var($+(%,myxinput,.,hightlight,.,*),$1)) return $($+(Delete,$chr(32),[,$($$gettok($v1,3,46),4),],$chr(32),[,$strip($($v1,4)),])) : unset $v1
    else if ($1 == end) return -
  }
}

alias -l displayHighlightStart {
  if ($($+(%,$cid,$active,chl),2)) {
    if ($1 == begin) return -
    else if ($1 == 1) return Add New HighLight:makehighlight
    else if ($1 == end) return -
  }
}

alias -l displayHighlightEnd {
  if ($($+(%,$cid,$active,chl),2)) {
    if ($1 == begin) return -
    else if ($1 == 1) return Unset All:unset $($+(%,myxinput,.,hightlight,.,*),0)
    else if ($1 == end) return -
  }
}

;------ [HighLight String]
alias -l chr2asc {
  return $+($chr(36),$chr(43),$chr(40),$left($regsubex($replace($1-,:,;),/(.)/g,$+($!chr,$chr(40),$asc(\1),$chr(41),$chr(44))),-1),$chr(41))
}

alias -l v_var {
  if ($regex($1-,/(\x3A|\x28|\x29|\x7C)/g)) {
    noop $input( The character you insert did not support in this version. $crlf Try to avoid from using:- $crlf " $chr(40) " $crlf " $chr(41) " $crlf " $(:,0) " $crlf " $chr(124) ", o)
    return $null
  }
  else return $1-
}

alias -l makeword {
  var %tmp_v = $chr2asc($$v_var($$input("Enter the shourcut word $crlf eg: bbl",ye)))
  set $+(%,myxinput,.,word,.,%tmp_v) $chr2asc($$v_var($$input(" Enter the full word for the shortcut $+(",$strip($(%tmp_v,2)),") $crlf eg: Be Back Later",ye)))
}

alias -l makenickcom {
  var %tmp_y = $chr2asc($$v_var($$input(Enter the front design of nick completor $crlf eg: $([[,0),ye)))
  var %tmp_z = $chr2asc($$v_var($$input(Enter the end design of nick completor $crlf eg: $(]],0),ye)))
  set $+(%,myxinput,.,nickcom) $+($chr(36),$chr(43),$chr(40),%tmp_y,$chr(44),-|-,$chr(44),%tmp_z,$chr(41))
}

alias -l makehighlight {
  var %tmp_v = $chr2asc($$v_var($$input("Enter the symbol or keyword $crlf eg: $($,0)",ye)))
  set $+(%,myxinput,.,hightlight,.,%tmp_v) $base($$v_var($$input(" Enter the colour number for $+(",$strip($(%tmp_v,2)),") $crlf eg: 4",ye)),10,10,2)
}

alias -l wordcom {
  var %y = 1, %str = $1-
  while ($($var($+(%,myxinput,.,word,.,*),%y),4) != $null) {
    var %q = $($gettok($var($+(%,myxinput,.,word,.,*),%y),3,46),4), %w = $v1
    %str = $regsubex(%str,/((\s|\b) $+ %q $+ (\s|\b))/ig,$+($chr(32),%w,$chr(32)))
    inc %y
  }
  return %str
}

alias -l chl {
  var %y = 1, %str = $regsubex($1-,/(\x28|\x29)/g,$+($chr(3),10,\1,$chr(15)))
  while ($($var($+(%,myxinput,.,hightlight,.,*),%y),4) != $null) {
    var %q = $($gettok($var($+(%,myxinput,.,hightlight,.,*),%y),3,46),4), %w = $v1
    %str = $regsubex(%str,/( $+ $iif($regex(%q,/(?:([[:punct:]]))/),$+(\,%q),$+(\b,%q,\b)) $+ )/ig,$+($chr(3),%w,\1,$chr(15)))
    inc %y
  }
  return %str
}

;------- [Pasting engine]
alias -l myxpaste {
  var %a = $iif($($+(%,$cid,$active,chl),2),$iif($input("Are you pasting codes?",y),1,0),0), %d = 1, %t = 1.5
  msg $1 ;---- $+(Pasting,$chr(32),[,$iif(%a,Code,Text),]) ----
  while (%d <= $cb(0)) {
    if ($cb(%d)) {
      $+(.timer,.,myx_paste,.,$1,.,$cid,.,%d) 1 %t msg $1 $iif(%a,$!chl( $!cb( %d ) ),$!inputengine( $!cb( %d ) ))
      %t = $calc(2 + %d)
    }
    inc %d
  }
  $+(.timer,.,myx_paste,.,$1,.,$cid,.,%d) 1 %t msg $1 ;---- [ End ] ----
}

;------- [On Input Event]
on *:input:*:{
  if ($inpaste) && ($($+(%,$active,$cid,inputoff),2)) {
    haltdef
    $+(.timer,#,.,paste,.,$cid) 1 0.2 myxpaste $active
  }
  else if ($($+(%,$active,$cid,inputoff),2)) {
    if (!$regex($1-,/(^\/|^\!)/Sig)) && (!$ctrlenter) && ($($+(%,$active,$cid,inputoff),2)) {
      haltdef
      msg $active $iif(c isincs $chan(#).mode,$strip($inputengine($1-)),$inputengine($1-))
    }
    elseif ($ctrlenter) { haltdef | msg $active $1- }
  }
}

;------- [Poppup]
menu query,channel {
  $iif(!$($+(%,$active,$cid,inputoff),2),[myX Input] $+([,$active,]) [Off]):set $+(%,$active,$cid,inputoff) 1
  $iif($($+(%,$active,$cid,inputoff),2),[myX Input] $+([,$active,]) [On])
  .Off:unset $+(%,$active,$cid,inputoff)
  .-
  .Nick Completor [[ $iif($($+(%,$cid,$active,nickcom),2),ON,OFF) ]]
  ..$iif($($+(%,$cid,$active,nickcom),2),Off,On):$iif($($+(%,$cid,$active,nickcom),2),unset,set) $+(%,$cid,$active,nickcom) 1
  ..-
  ..$submenu($displayNickComStart($1))
  ..-
  ..$submenu($displayNickCom($1))
  .Word Completor [[ $iif($($+(%,$cid,$active,word),2),ON,OFF) ]]
  ..$iif($($+(%,$cid,$active,word),2),Off,On):$iif($($+(%,$cid,$active,word),2),unset, set) $+(%,$cid,$active,word) 1
  ..-
  ..$submenu($displayWordStart($1))
  ..-
  ..$submenu($displayWord($1))
  ..-
  ..$submenu($displayWordEnd($1))
  .-
  .Code Highlight [[ $iif($($+(%,$cid,$active,chl),2),ON,OFF) ]]
  ..$iif(!$($+(%,$cid,$active,chl),2),On,Off):$iif($($+(%,$cid,$active,chl),2),unset, set) $+(%,$cid,$active,chl) 1
  ..-
  ..$submenu($displayHighlightStart($1))
  ..-
  ..$submenu($displayHighlight($1))
  ..-
  ..$submenu($displayHighlightEnd($1))
  .-
  .UpDown Char [[ $iif($($+(%,$cid,$active,updown),2),ON,OFF) ]]
  ..$iif($($+(%,$cid,$active,updown),2),Off,On):$iif($($+(%,$cid,$active,updown),2),unset,set) $+(%,$cid,$active,updown) 1
  .Leet ASCii [[ $iif($($+(%,$cid,$active,ascii),2),ON,OFF) ]]
  ..$iif($($+(%,$cid,$active,ascii),2),Off,On):$iif($($+(%,$cid,$active,ascii),2),unset,set) $+(%,$cid,$active,ascii) 1
  .Colour Under [[ $iif($($+(%,$cid,$active,core),2),ON,OFF) ]]
  ..$iif($($+(%,$cid,$active,core),2),Off,On):$iif($($+(%,$cid,$active,core),2),unset,set) $+(%,$cid,$active,core) 1
  ..-
  ..$submenu($colournunder($1))
  .-
}

Comments

Sign in to comment.
Typo   -  Jul 16, 2008

Ok

I did get it working. The problem I had before is I never set the colors. Your new instructions you added was a vast improvementdid to before but did not say to do this either however, I figured it out.

This script is kind of a hassle to use. Just to try the colour underline option it takes 3 times of going into the menu. Once to turn the Colour Underline ON, now that enabled a submenu so I go in again to set the foreground color and I have to go back again to set a background color.
The settinge are similiar for everything else in the script.
This desperately needs a dialog.
It would be a thousand times better if it were easy and intuitive to use and a good dialog based control panel would solve that problem. I know it would be a lot more coding but it would really be worth it.

The dialog I would build would look something like this.
You have 6 tabs. 1:Nick Completer 2:Word Completer 3:Code Highlight 4:UpDown Char 5:Leet Ascii 6:Colour Under. Each one has its own list of channels and an edit field with an add button to add new channels and a remove button to remove the channel that has been selected in the list. This allows total control over the channels from within the dialog. You can see similiar channel lists in my Typos Multi-Messenger and Typos Highlighter dialogs.
Anyhow, I was saying how if u click on a channel in the channel list u can click remove to get rid of it but thats not all you make happen. On the side, top or bottom of the channel list are the settings for the section were in, for instance tab one would have the settings for the Nick Completer and when you click on a channel in the channel list in that tab it shows that channels settings for the nick completer.

I know this is a lot of work but I really feal it would be worth your time to do it.

Sorry if it seams like I\'m picking on you as that is not the case.

If your not familiar with dialogs that this will be a pretty tough venture to do but by the time your done you will be very familiar with dialogs. There is a dialog tutorial in the dialog section here and like I said you could check out the dialogs in some of my or anyone elses scripts to see how we use them.
If you already know dialogs ignore all that crap.

Good luck.

 Respond  
h3lp   -  Jul 15, 2008

updated.. thanks typo for let me know..

 Respond  
Typo   -  Jul 15, 2008

I have to admit I was very dissapointed with this script.
After reading the introduction I had high expectations but the very first thing I noticed in the code was no dialog. This struck me as odd but I copied the code and pasted into remotes and then went to use it figuring maybe he just found a good way to make this without dialogs.

After loading it I right click in the active window and all I see is a menu option saying myxinput, the nickname and the word off (I was in a query window) so I leave the query window since I did not understand what I was seeing and look in the script itself for help. None was present so then I tried right clicking in the status window and checked the toolbar too, nothing, so I finally go into a channel and try the right click there but I get the same thing.[myXinput] [#Chanel] [Off] and nothing else just like in the query window except with a channel name now so thsis time I clicked it. Nothing happens at all. I look in the status window, nothing.

Finally I noticed that the right click menu had changed so I look to see whats new. There is a whole submenu now that has things like Nick Completer, Word Completer, Code Highlight, UpDown Char, Leet Ascii and Colour Under.

I try the first one, I turn it on and try some typing.......Nothing happens.
I try the second one, I turn it on and d osome typing.......Not a thing happens.

Now I\'m about done with this thing so I turned them all on, disabled my theme script and tried some typing again.

Nothing happened.

I was in the channel I turned it on in the whole time but couldnt get it working.

I give up for now until its been updated with more info so I can figure it out.

I think the first thing you need to work on is a complete help guide of some sort and I highly reccomend you consider putting this whole thing into a dialog which would make it look great.

Right now I\'m just curious if I wasn;t using it right or if it just doesnt work or if I have another script aside from the theme script I disabled thats interfering with it.

I won\'t rate this yet incase you decide to address the lack of help so I can maybe get it to work and really give it a worthy rating.

 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.