; ; /Dialog Example Script ; Written by Stuart Browne (AKA Bekar) ; EFNet #mIRC Op. ; January 10, 1999 ; mIRC v5.5+ ; ; type /keyboard to begin ; ; Known Bugs: the Check Push button (Caps Lock) wont trigger an sclick event, thus the caps lock gets ; locked on until you hit shift a few times.. (5.5 bug) ; alias KeyboardError { dialog -m KeyboardError KeyboardError } ON *:OPEN:*: { if ($dialog(keyboard) != $null) { generatetargetcombo } } ON *:CLOSE:*: { if ($dialog(keyboard) != $null) { generatetargetcombo } } dialog Keyboarderror { title "!! WARNING !!" size -1 -1 200 70 text "An error has occured, press OK to continue", 1, 5 10 180 30, center button "&OK", 2, 80 40 40 20, ok } alias keyboard { dialog -m keyboard keyboard did -c Keyboard 139 did -c Keyboard 146 generatetargetcombo did -c Keyboard 143 1 %Keyboard.State = $did(keyboard,139).state $did(keyboard,140).state $did(keyboard,141).state $did(keyboard,146).state $did(keyboard,147).state } alias generatetargetcombo { set -u0 %Keyboard.Selected $did(keyboard,143,1).sel did -r keyboard 143 set -u0 %Keyboard.Count 1 if ($chan(0) > 0) { :LoopA did -a Keyboard 143 $chan(%Keyboard.Count) inc %Keyboard.Count if (%Keyboard.Count <= $Chan(0)) { goto LoopA } } set -u0 %Keyboard.Count 1 if ($chat(0) > 0) { :LoopB did -a Keyboard 143 = $+ $chat(%Keyboard.Count) inc %Keyboard.Count if (%Keyboard.Count <= $Chat(0)) { goto LoopB } } set -u0 %Keyboard.Count 1 if ($query(0) > 0) { :LoopC did -a Keyboard 143 $Query(%Keyboard.Count) inc %Keyboard.Count if (%Keyboard.Count <= $Query(0)) { goto LoopC } } did -c keyboard 143 %Keyboard.Selected } dialog keyboard { title "Keyboard" size -1 -1 375 200 button "q", 1, 40 35 25 25, default button "w", 2, 65 35 25 25, default button "e", 3, 90 35 25 25, default button "r", 4, 115 35 25 25, default button "t", 5, 140 35 25 25, default button "y", 6, 165 35 25 25, default button "u", 7, 190 35 25 25, default button "i", 8, 215 35 25 25, default button "o", 9, 240 35 25 25, default button "p", 10, 265 35 25 25, default button "a", 11, 50 60 25 25, default button "s", 12, 75 60 25 25, default button "d", 13, 100 60 25 25, default button "f", 14, 125 60 25 25, default button "g", 15, 150 60 25 25, default button "h", 16, 175 60 25 25, default button "j", 17, 200 60 25 25, default button "k", 18, 225 60 25 25, default button "l", 19, 250 60 25 25, default button "z", 20, 60 85 25 25, default button "x", 21, 85 85 25 25, default button "c", 22, 110 85 25 25, default button "v", 23, 135 85 25 25, default button "b", 24, 160 85 25 25, default button "n", 25, 185 85 25 25, default button "m", 26, 210 85 25 25, default button ",", 200, 235 85 25 25, default button ".", 201, 260 85 25 25, default button "/", 202, 285 85 25 25, default button ";", 203, 275 60 25 25, default button "'", 204, 300 60 25 25, default button "`", 205, 10 10 25 25, default button "[", 206, 290 35 25 25, default button "]", 207, 315 35 25 25, default button "\", 208, 340 35 25 25, default button "-", 209, 285 10 25 25, default button "0", 210, 260 10 25 25, default button "1", 211, 35 10 25 25, default button "2", 212, 60 10 25 25, default button "3", 213, 85 10 25 25, default button "4", 214, 110 10 25 25, default button "5", 215, 135 10 25 25, default button "6", 216, 160 10 25 25, default button "7", 217, 185 10 25 25, default button "8", 218, 210 10 25 25, default button "9", 219, 235 10 25 25, default button "=", 220, 310 10 25 25, default button "Shift", 131, 10 85 50 25, default button "Shift", 134, 310 85 55 25, default check "Caps", 132, 10 60 40 25, push button "Tab", 133, 10 35 30 25, default button "Enter", 135, 325 60 40 25, default button "<--", 137, 335 10 30 25, default edit "",136, 150 138 90 20, autohs text "Text:", 145, 110 140 40 20, center button "Space", 27, 112 170 150 25, default button "Close", 99, 285 170 0 0, ok box "Command:", 138, 10 115 90 80 radio "Normal", 139, 15 130 70 20,select radio "Action", 140, 15 150 70 20 radio "", 141, 15 170 15 15 edit "", 142, 30 168 60 20, autohs box "Target:", 144, 280 115 90 80 radio "", 146, 285 135 15 15 combo 143, 300 133 60 100, drop radio "", 147, 285 170 15 15 edit "", 148, 300 168 60 20, autohs } ON *:DIALOG:KEYBOARD:SCLICK:131,132,134: { set -u0 %Keyboard q,w,e,r,t,y,u,i,o,p,a,s,d,f,g,h,j,k,l,z,x,c,v,b,n,m if ($did != 132) { if ($did(132).state == 0) { did -c keyboard 132 } else { did -u keyboard 132 } } set -u0 %Keyboard.Count 1 :LoopA did -r Keyboard %Keyboard.Count if ($did(132).state = 0) { did -a Keyboard %Keyboard.Count $lower($gettok(%Keyboard,%Keyboard.Count,44)) } else { did -a Keyboard %Keyboard.Count $upper($gettok(%Keyboard,%Keyboard.Count,44)) } inc %Keyboard.Count if (%Keyboard.Count < 27) { goto LoopA } set -u0 %KeyboardSpecial <,>,?,:,",~,{,},|,_,),!,@,#,$,%,^,&,*,(,+ set -u0 %KeyboardNormal 44 $+ ,.,/,;,',`,[,],\,-,0,1,2,3,4,5,6,7,8,9,= set -u0 %Keyboard.Count 1 :LoopB did -r Keyboard $calc(%Keyboard.Count + 199) if (%Keyboard.Count != 1) { if ($did(keyboard,132).state = 0) { did -a Keyboard $calc(%Keyboard.Count + 199) $gettok(%KeyboardNormal, %Keyboard.Count, 44) } else { if (%Keyboard.Count != 18) { did -a Keyboard $calc(%Keyboard.Count + 199) $gettok(%KeyboardSpecial, %Keyboard.Count, 44) } else { did -a keyboard 217 && } } } else { if ($did(keyboard,132).state = 0) { did -a Keyboard 200 , } else { did -a Keyboard 200 < } } inc %Keyboard.Count if (%Keyboard.Count < 22) { goto LoopB } } ON *:DIALOG:KEYBOARD:SCLICK:27: { did -o keyboard 136 1 $did(136).text $+ $chr(160) } ON *:DIALOG:KEYBOARD:SCLICK:133: { did -o keyboard 136 1 $did(136).text $+ $chr(9) } ON *:DIALOG:KEYBOARD:EDIT:142: { did -u keyboard 140 did -u keyboard 139 did -c keyboard 141 } ON *:DIALOG:KEYBOARD:SCLICK:135: { if ($did(139).state == 1) { set -u0 %Keyboard.Command QUERY } elseif ($did(140).state == 1) { set -u0 %Keyboard.Command DESCRIBE } else { if ($did(142).text == $null) || ($isalias($did(142).text) == $false) { KeyboardError return } else { set -u0 %Keyboard.Command $upper($did(142).text) } } if ($did(146).state == 1) { set -u0 %Keyboard.Target $did(143).text } else { if ($did(148).text != $null) { set -u0 %Keyboard.Target $did(148).text } else { KeyboardError return } } %Keyboard.Command %Keyboard.Target $replace($did(136,1).text,$chr(160),$chr(32)) did -r keyboard 136 } ON *:DIALOG:KEYBOARD:SCLICK:137: { if ($did(136,1).len > 1) { did -o keyboard 136 1 $mid( $did(136).text ,1, $calc($did(136,1).len - 1) ) } else { if ($did(136,1).len == 1) { did -r keyboard 136 } else { beep } } } ON *:DIALOG:KEYBOARD:SCLICK:*: { if ($did > 150) || ($did < 138) { if ($did != 217) { did -o keyboard 136 1 $did(136).text $+ $did($did).text } else { did -o keyboard 136 1 $did(136).text $+ & } } else { if ($istok(139:140:141:146:147,$did,58)) { keyboarddoradios $did %keyboard.state } } } alias keyboarddoradios { if ($6 == $null) { return } if (($1 == 139) || ($1 == 140) || ($1 == 141)) { if ($5 == 1) { did -c keyboard 146 } elseif ($6 == 1) { did -c keyboard 147 } } else { if ($2 == 1) { did -c keyboard 139 } elseif ($3 == 1) { did -c keyboard 140 } elseif ($4 == 1) { did -c keyboard 141 } } %Keyboard.State = $did(keyboard,139).state $did(keyboard,140).state $did(keyboard,141).state $did(keyboard,146).state $did(keyboard,147).state }