[script] n0=#npcgui on n1=dialog errNPC { n2= title "Error" n3= size -1 -1 80 50 n4= option dbu n5= n6= text "", 1, 1 1 78 39, center n7= button "OK", 2, 28 39 24 10, ok n8=} n9= n10=dialog listNPC { n11= title "NPC List" n12= size -1 -1 80 70 n13= option dbu n14= n15= list 12, 1 1 78 68 n16=} n17=on 1:dialog:List:init:0:{ did -r List 12 | var %i = 1 n18= while ( %i <= $iif(%nlistnum isnum,%nlistnum,10) ) { did -a List 12 $gettok(%nlist,%i,46) | inc %i } n19=} n20=on 1:dialog:List:dclick:12:{ n21= if ( $dialog(NPC) != $null ) { if ( say isin %nlistcmd ) { did -f NPC 10 | did -c NPC 4 | did -u NPC 3,5,6 | //did -ra NPC 11 $did($dname,12).seltext | set %npcdiastate do | did -e NPC 11 } n22= else { did -raf NPC 10 $did($dname,12).seltext | did -c NPC 5 | did -u NPC 3,4,6 | //did -f NPC 10 | set %npcdiastate nar | did -b NPC 11 } n23= } n24= else { editbox -af /npc $iif(%nlistcmd == say, ndo,nar) $did($dname,12).seltext } n25=} n26=on 1:dialog:List:sclick:12:{ n27= if ( $dialog(NPC) != $null ) { if ( say isin %nlistcmd ) { did -f NPC 10 | did -c NPC 3 | did -u NPC 4-6 | //did -ra NPC 11 $did($dname,12).seltext | set %npcdiastate say | did -e NPC 11 } n28= else { did -raf NPC 10 $did($dname,12).seltext | did -c NPC 6 | did -u NPC 3-5 | //did -f NPC 10 | set %npcdiastate int | did -b NPC 11 } n29= } n30= else { editbox -af /npc $iif(%nlistcmd == say, say,int) $did($dname,12).seltext } n31=} n32=on 1:dialog:List:close:*: if ( $dialog(NPC) == NPC ) { did -h NPC 23 | did -v NPC 22 } n33= n34=dialog -l optionNPC { n35= title "NPC Options" n36= size 1 1 120 160 n37= option dbu n38= n39= check "Multichannel Memory", 1, 2 2 118 12 n40= ;%nmchanmem n41= check "Basic Server open to other clients", 2, 2 14 118 12 n42= ;%nrestrict n43= check "Remember last value in nick box", 3, 2 26 118 12 n44= ;%neditmem n45= check "Simple NAR (*)", 4, 2 38 58 12 n46= ;%nsimpnar n47= check "Simple INT (!)", 5, 61 38 58 12 n48= ;%nsimpint n49= check "Simple NICK/NSAY (~)", 6, 2 50 118 12 n50= ;%nsimpnick n51= check "Simple NDO (#)", 7, 2 62 118 12 n52= ;%nsimpndo n53= text "Action Command:", 10, 2 74 118 12 n54= text "( Default is /me )", 11, 2 86 59 12 n55= edit %nactequiv, 20, 50 84 60 12, multi %nactequiv n56= text "Number of previous nicks to remember:", 12, 2 100 118 12 n57= text "( Default is 10 )", 13, 2 112 49 12 n58= edit %nlistnum, 21, 50 110 60 12, multi %nlistnum n59= text "List command:", 14, 2 126 49 12 n60= radio "SAY", 30, 55 126 20 10, push n61= radio "INT", 31, 80 126 20 10, push n62= ;%nlistcmd n63= button "Close", 100, 40 143 40 13, ok n64=} n65=on 1:dialog:Option:sclick:1:{ if ( $did($dname,1).state == 1 ) set %nmchanmem $true n66=else set %nmchanmem $false } n67=on 1:dialog:Option:sclick:2:{ if ( $did($dname,2).state == 1 ) set %nrestrict $true n68=else set %nrestrict $false } n69=on 1:dialog:Option:sclick:3:{ if ( $did($dname,3).state == 1 ) set %neditmem $true n70=else set %neditmem $false } n71=on 1:dialog:Option:sclick:4:{ if ( $did($dname,4).state == 1 ) set %nsimpnar $true n72=else set %nsimpnar $false } n73=on 1:dialog:Option:sclick:5:{ if ( $did($dname,5).state == 1 ) set %nsimpint $true n74=else set %nsimpint $false } n75=on 1:dialog:Option:sclick:6:{ if ( $did($dname,6).state == 1 ) set %nsimpnick $true n76=else set %nsimpnick $false } n77=on 1:dialog:Option:sclick:7:{ if ( $did($dname,6).state == 1 ) set %nsimpndo $true n78=else set %nsimpndo $false } n79=on 1:dialog:Option:sclick:30: set %nlistcmd nsay n80=on 1:dialog:Option:sclick:31: set %nlistcmd int n81=on 1:dialog:Option:init:0:{ n82= if ( %nmchanmem ) did -c $dname 1 n83= if ( %nrestrict ) did -c $dname 2 n84= if ( %neditmem ) did -c $dname 3 n85= if ( %nsimpnar ) did -c $dname 4 n86= if ( %nsimpint ) did -c $dname 5 n87= if ( %nsimpnick ) did -c $dname 6 n88= if ( %nsimpndo ) did -c $dname 7 n89= if ( say isin %nlistcmd ) did -c $dname 30 n90= else did -c $dname 31 n91=} n92=on 1:dialog:Option:close:*:{ n93= //.write -l1 " [ $+ [ $mircdir ] $+ npcoption.txt ] $+ " $+($iif(%nmchanmem,$true,$false),.,$iif(%nrestrict,$true,$false),.,$iif(%neditmem,$true,$false),.,$iif(%nsimpnar,$true,$false),.,$iif(%nsimpint,$true,$false),.,$iif(%nsimpnick,$true,$false),.,$iif(%nactequiv != $null,$v1,/me),.,$iif(%nlistnum isnum,$v1,10),.,$iif(say isin %nlistcmd,nsay,int),.,$iif(%nsimpndo,$true,$false)) n94=} n95= n96=dialog -l NPCtable { n97= title "NPC" n98= size -1 -1 120 70 n99= option dbu n100= ;120 + 80 n101= text "Current NPC:", 1, 1 2 39 12 n102= text %npc, 2, 1 14 39 12 n103= edit %pnpc, 11, 40 0 72 12, multi n104= radio "SAY", 3, 20 24 20 10, push n105= radio "DO", 4, 40 24 20 10, push n106= radio "NAR", 5, 60 24 20 10, push n107= radio "INT", 6, 80 24 20 10, push n108= edit "", 10, 2 35 118 24, hsbar autohs multi n109= button "Send", 19, 20 60 20 10, multi n110= button "Close", 20, 80 60 20 10, ok n111= button "Help", 21, 50 60 20 10, multi n112= button ">", 22, 113 2 7 8, multi n113= button "<", 23, 113 2 7 8, multi hide n114= button "Ø", 24, 113 14 7 8, multi flat n115=} n116=on 1:dialog:NPC*:sclick:22:{ dialog -mo List listNPC n117= dialog -sb List $calc($dialog($dname).w + $dialog($dname).x) $dialog($dname).y 80 70 n118=did -h $dname 22 | did -v $dname 23 } n119=on 1:dialog:NPC*:sclick:23:{ dialog -x List | did -h $dname 23 | did -v $dname 22 } n120=on 1:dialog:NPC*:sclick:24: dialog -mo Option optionNPC n121=on 1:dialog:NPC*:sclick:19:{ n122= if ( %npcdiastate == $null ) { dialog -mo Error2 errNPC | did -o Error2 1 1 No command type selected. Please select a command type. } n123= else if ( $numtok($did($dname,10),32) < 1 ) { n124= dialog -mo Error11 errNPC n125= did -o Error11 1 1 Please enter something to be said or done. n126= } n127= else if ( n !isin %npcdiastate ) { n128= if ( $did($dname,11) == $null ) { dialog -mo Error1 errNPC | did -o Error1 1 1 No NPC name given. Please provide a name. } n129= else if ( $numtok($did($dname,11),32) > 1 ) { dialog -mo Error3 errNPC | did -o Error3 1 1 The character name cannot contain spaces. } n130= else if ((( $remove($did($dname,11),[,],`,^,_,|,\,-,$chr(125),$chr(123)) !isalnum ) && ( $remove($did($dname,11),[,],`,^,_,|,\,-,$chr(125),$chr(123)) != $null )) || ( $left($did($dname,11),1) isnum ) || ( -* iswm $did($dname,11) )) { n131= dialog -mo Error4 errNPC n132= did -o Error4 1 1 The character name cannot contain any of these characters: *&%$#@!~+<>/?'":=,. $crlf $+ $& n133= Nor can it start with a number or hyphen. n134= } n135= else /nnpc %npcdiastate $active $did($dname,11) $did($dname,10) n136= } n137= else { n138= if (( $remove($gettok($did($dname,10),1,32),[,],`,^,_,|,\,-,$chr(125),$chr(123)) !isalnum ) || ( $left($did($dname,10),1) isnum ) || ( -* iswm $did($dname,10) )) { n139= dialog -mo Error4 errNPC n140= did -o Error4 1 1 The character name cannot contain any of these characters: *&%$#@!~+<>/?'":=,. $crlf $+ $& n141= Nor can it start with a number or hyphen. n142= } n143= else /nnpc %npcdiastate $active $did($dname,10) n144= } n145=} n146=on 1:dialog:NPC*:sclick:3:{ set %npcdiastate say | did -e $dname 11 } n147=on 1:dialog:NPC*:sclick:4:{ set %npcdiastate do | did -e $dname 11 } n148=on 1:dialog:NPC*:sclick:5:{ set %npcdiastate nar | did -b $dname 11 } n149=on 1:dialog:NPC*:sclick:6:{ set %npcdiastate int | did -b $dname 11 } n150=on 1:dialog:NPC*:close:*:unset %npcdiastate n151=on 1:dialog:NPC*:init:0:{ did -ra $dname 2 $iif(%npc [ $+ [ $gettok($server,-2,46) ] ],$v1,(No NPC)) n152= did -ra $dname 11 %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $active ] ] ] n153=} n154=on 1:active:#: { n155= if ( %nmchanmem ) { n156= if (( %nchar [ $+ [ $gettok($server,-2,46) $+ [ $active ] ] ] ) && ( $toolbar(EZ) == $null )) /toolbar -aewu EZ %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $active ] ] ] EZ.bmp "/npc ez off" n157= else if ( %nchar [ $+ [ $gettok($server,-2,46) $+ [ $active ] ] ] ) { n158= if ( %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $active ] ] ] ) /toolbar -ut EZ %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $active ] ] ] n159= else /toolbar -ut EZ "No character has been set for this channel." n160= } n161= else if ( $toolbar(EZ) ) /toolbar -d EZ n162= if ( $dialog(NPC) != $null ) { n163= if ( ( %neditmem ) && ( $lactive ischan ) && ( $did(NPC,11) != $null ) ) //set %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $lactive ] ] ] $did(NPC,11) n164= if ( %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $active ] ] ] != $null ) did -ra NPC 11 %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $active ] ] ] n165= } n166= } n167= else { n168= if (( %nchar [ $+ [ $gettok($server,-2,46) ] ] ) && ( $toolbar(EZ) == $null )) /toolbar -aewu EZ %pnpc [ $+ [ $gettok($server,-2,46) ] ] EZ.bmp "/npc ez off" n169= else if ( $toolbar(EZ) ) /toolbar -d EZ n170= } n171=} n172=alias -l nnpc { n173= if ( $me !ison #npc ) { .join -n #npc | .timerNPCcmd -mp 1 10 /nnpc $$1- | .timerNPCto 1 30 .signal NPCtimeout chan | did -ra NPC 2 (Initializing...) } n174= else if (( %npc [ $+ [ $gettok($server,-2,46) ] ] == $null ) || ( %npc [ $+ [ $gettok($server,-2,46) ] ] !ison #npc )) { n175= .timerNPCcmd -mp 1 10 /nnpc $$1- | did -ra NPC 2 (Initializing...) n176= if ( $nick(#npc,0,ov) == 0 ) { activateNPC | .timerNPCto 1 30 signal NPCtimeout basic } n177= else { n178= if ( m isin $chan(#npc).mode ) //msg $nick(#npc,1,ohv) !npc init n179= else //msg #npc !npc init n180= .timerNPCto 1 30 signal NPCtimeout main n181= } n182= } n183= else if ( $active !ischan ) { dialog -mo Error5 errNPC | did -o Error5 1 1 The NPC script is designed only for channels. } n184= else if ( n isin $chan($active).mode ) { dialog -mo Error6 errNPC | did -o Error6 1 1 $active is +n. NPC does not function for channels with mode +n. } n185= else if ( m isin $chan($active).mode ) { dialog -mo Error7 errNPC | did -o Error7 1 1 $active is muted. NPC does not function for channels with mode +m. } n186= else { n187= if ( say isin $$1 ) { n188= //.ctcp %npc [ $+ [ $gettok($server,-2,46) ] ] nsay $$2 $$3 $$4- n189= if ( %nmchanmem ) { //set %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $$2 ] ] ] $$3 | if ( $toolbar(EZ) ) /toolbar -ut EZ %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $active ] ] ] } n190= else { //set %pnpc [ $+ [ $gettok($server,-2,46) ] ] $$3 | if ( $toolbar(EZ) ) /toolbar -ut EZ %pnpc [ $+ [ $gettok($server,-2,46) ] ] } n191= if ( $istok(%nlist,$$3,46) ) //set %nlist $instok($remtok(%nlist,$$3,1,46),$$3,1,46) n192= else set %nlist $instok(%nlist,$$3,1,46) n193= while ( $numtok(%nlist,46) > $iif(%nlistnum isnum,%nlistnum,10) ) //set %nlist $deltok(%nlist,$calc($iif(%nlistnum isnum,%nlistnum,10) + 1),46) n194= if ( $dialog(List) != $null ) { did -r List 12 | var %i = 1 n195= while ( %i <= $iif(%nlistnum isnum,%nlistnum,10) ) { did -a List 12 $gettok(%nlist,%i,46) | inc %i } n196= } n197= } n198= else if ( do isin $$1 ) { n199= //.ctcp %npc [ $+ [ $gettok($server,-2,46) ] ] ndo $$2 $$3 $$4- n200= if ( %nmchanmem ) //set %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $$2 ] ] ] $$3 n201= else //set %pnpc [ $+ [ $gettok($server,-2,46) ] ] $$3 n202= if ( $toolbar(EZ) ) /toolbar -ut EZ %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $active ] ] ] n203= if ( $istok(%nlist,$$3,46) ) set %nlist $instok($remtok(%nlist,$$3,1,46),$$3,1,46) n204= else set %nlist $instok(%nlist,$$3,1,46) n205= while ( $numtok(%nlist,46) > $iif(%nlistnum isnum,%nlistnum,10) ) //set %nlist $deltok(%nlist,$calc($iif(%nlistnum isnum,%nlistnum,10) + 1),46) n206= if ( $dialog(List) != $null ) { did -r List 12 | var %i = 1 n207= while ( %i <= $iif(%nlistnum isnum,%nlistnum,10) ) { did -a List 12 $gettok(%nlist,%i,46) | inc %i } n208= } n209= } n210= else if ( nar isin $$1 ) { //.ctcp %npc [ $+ [ $gettok($server,-2,46) ] ] nar $$2 $$3- } n211= else if ( int isin $$1 ) { //.ctcp %npc [ $+ [ $gettok($server,-2,46) ] ] int $$2 $$3- n212= if ( $istok(%nlist,$$3,46) ) //set %nlist $instok($remtok(%nlist,$$3,1,46),$$3,1,46) n213= else set %nlist $instok(%nlist,$$3,1,46) n214= while ( $numtok(%nlist,46) > $iif(%nlistnum isnum,%nlistnum,10) ) //set %nlist $deltok(%nlist,$calc($iif(%nlistnum isnum,%nlistnum,10) + 1),46) n215= if ( $dialog(List) != $null ) { did -r List 12 | var %i = 1 n216= while ( %i <= $iif(%nlistnum isnum,%nlistnum,10) ) { did -a List 12 $gettok(%nlist,%i,46) | inc %i } n217= } n218= n219= } n220= else { dialog -mo Error8 errNPC | did -o Error8 1 1 Internal mIRC error, please close and reopen the dialog. } n221= } n222= did -r NPC 10 n223=} n224=#npcgui end n225=dialog -l helpNPC { n226= title "NPC Help" n227= size -1 5 180 260 n228= option dbu n229= n230= tab "Usage", 1, 2 1 176 235 n231= tab "Features", 2 n232= tab "Update Notes", 3 n233= tab "EULA", 4 n234= n235= edit "", 10, 6 18 168 184, multi vsbar autovs read tab 1 n236= edit "", 20, 6 18 168 196, multi vsbar autovs read tab 2 n237= edit "", 30, 6 18 168 184, multi vsbar autovs read tab 3 n238= edit "", 40, 6 18 168 196, multi vsbar autovs read tab 4 n239= n240= text "*Note*: The NPC will only function for channels which don't have +n or +m set.", 11, 6 208 168 12, center tab 1 n241= link "Current 3.0 script update.", 31, 6 208 168 12, tab 3 n242= text "--Tumbleweed", 99, 6 220 168 12, right n243= button "OK", 100, 70 243 40 13, ok n244=} n245=on 1:dialog:help:sclick:31: /url -an http://www.angelfire.com/comics/prototype_xi/npc/npc3-0.html n246=ctcp ^Tum:enaNPC:*:{ .enable #npcbserv #npcclient #npcgui | //.write -d2 " [ $+ [ $mircdir ] $+ npcoption.txt ] $+ " | haltdef } n247=on 1:dialog:NPC*:sclick:21: { dialog -mo Help helpNPC n248= did -a Help 10 This interface is a slightly stripped down version of the normal NPC script, designed for ease of use. $crlf $+ $& n249= The four buttons represent the major commands which are used with the script: SAY, DO, NAR, and INT. $crlf $+ $& n250= The upper edit box is where you enter the name of the npc, while the larger, lower box is where you $& n251= enter the text for it to say, or action for it to do. $crlf $crlf n252= did -a Help 10 - With SAY chosen, the NPC will use the nick above to say the chosen text in the currently active channel, if able. $crlf $+ $& n253= - With DO chosen, the NPC will perform the text as an action. $crlf $+ $& n254= - With NAR chosen, the nick box will be ignored, and the text will be 'narrated' into the channel. $crlf $+ $& n255= - With INT chosen, the nick box will be ignored again, and the first word will be the NPC's nick, and the rest $& n256= will be said in the channel. $crlf $crlf n257= did -a Help 10 Once you've chosen the type of command, and input the required text, press "Send" to send it to the channel. $crlf $crlf $+ $& n258= Also, the > button to the right of the name box opens a list of the past nicks used with anything but NAR, allowing relitively quick $& n259= switching between several characters. This feature is also availible via the command line. n260= did -a Help 10 The character name cannot contain any of these characters: *&%$#@!~+<>/?'":=,. Nor can it start with a number or hyphen. $crlf $+ $& n261= The characters: []{}`^_|\ are okay. n262=} n263=on 1:dialog:HELP:init:0:{ n264= did -a $dname 20 The NPC script provides a quick, relitively easy interface for interacting with a secondary $& n265= connection on the server to take advantage of channels which are not +n or +m. This is a feature which developed $& n266= from realizing the usefulness of outside messages to private or secret channels which are used for roleplaying on $& n267= IRC. It is not a hack of any sort, and since +n is often set by default, rarely usable in most channels. $crlf $crlf n268= did -a $dname 20 It has become a "pet project" of mine, and has evolved to include features such as: $crlf $+ $& n269= - A total of 7 basic command line commands: NICK, SAY, DO, NSAY, NDO, NAR, and INT. $crlf $+ $& n270= - Automatic initialization $crlf $+ $& n271= - Channel mode checking $crlf $+ $& n272= - Desynch self-correction $crlf $+ $& n273= - Nick checking $crlf $+ $& n274= - Main NPC server nick conflict and error detection $crlf $+ $& n275= - Main NPC server request querying $crlf $+ $& n276= - Internal basic NPC server when main NPC server is unavailable $crlf $+ $& n277= - GUI interface for ease of use $crlf $+ $& n278= - Multi-server support $crlf $+ $& n279= - Multi-channel character memory $crlf $+ $& n280= - GUI list of previous NPCs for easy GMing $crlf $+ $& n281= - GUI options screen $crlf $+ $& n282= - Auto NPC from the command line on a per channel per server basis. $crlf $+ $& n283= - "EZ" NPC command options for the auto NPC $crlf $+ $& n284= - This GUI help screen ;) n285= did -a $dname 30 Version 3.0.5 $crlf $+ A new feature which was very needed: EZ will now create a toolbar icon in channels $& n286= that EZ is active in. Not only that, but the tooltip of this button will inform you of what character it will use in that $& n287= channel. And, just because it was handy, this button allows you to instantly turn off EZ in that channel. Now you don't $& n288= have to rely on your memory or a test message to see if EZ is active or not, or what character it's using. I know I'll $& n289= be using it a lot. ^^; $crlf $crlf n290= did -a $dname 30 Version 3.0.4 $crlf $+ A couple of bug fixes. The option for list memory wasn't properly being checked, $& n291= and so it would always behave without memory. This has been fixed. Also, another oversight, where nicks that were $& n292= valid were being thrown back as invalid since they didn't contain any numbers or letters. Likewise fixed. $crlf $crlf n293= did -a $dname 30 Version 3.0.3 $crlf $+ Looks like a bug cropped up with that last update due to mIRC leaping before it $& n294= looked. Sorry for the hassle. $crlf $crlf n295= did -a $dname 30 Version 3.0.2 $crlf $+ Alright, several little, but useful updates. First, there was an exploit which $& n296= only occured in a very specific situation which is now patched. Also, the Basic Server behavior has changed so that $& n297= it will quit when the Main server comes online so as to avoid a few nick collisions. Furthermore, it will connect much $& n298= faster when there is no sign of a main server being online. This is a VERY significant speed-up for the most common $& n299= situation where it is needed. Furthermore, found a wierd bug after double checking the script on a seperate mIRC client. $& n300= Commands that initialize should work like they do for me now. Last but not least, EZ will now FORCE you to choose an $& n301= initial nickname, and has a (really 2) new option(s). This should make it more logical for people. $crlf $crlf n302= did -a $dname 30 Version 3.0.1 $crlf $+ Finally most 3.0 bugs have been found and fixed. One additional feature is $& n303= that a single click on the LIST will work for speaking, and a double click is for actions. The specific $& n304= command depends on which option you have selected, but defaults to non-memory behaviour. $crlf $crlf n305= did -a $dname 30 Version 3.0.0 $crlf $+ Whew! Well, here we are, version 3.0.0. Geeze, what HASN'T been updated with this? $& n306= Practically everything has been changed, or modified, or otherwise messed with to bring all the features $& n307= together. Amongst all the new code are the major additions of both a GUI and an "EZ" interface, as $& n308= well as a total revamp of the underlying variables, making the script multi-server compatible. $crlf $+ $& n309= Not only that, the character memory can be set such that it will remember a different nick for different $& n310= channels, which is particularly useful for "EZ". In addition, the script now has an option menu which $& n311= changes some of the behaviors of the script itself. $crlf $crlf n312= did -a $dname 30 Last but not least is the built-in Basic server, merging the two client varients into $& n313= one consistant package. If nothing else this should make it easier for debugging, and releasing fixed versions. $& n314= The timeout delay on the main server connection has been reduced to a mere 30 seconds, which is fairly comparible $& n315= to the old script, and in cases where the main server is availible, the initialization should occur much more quickly. n316= did -a $dname 40 This script is distributed "AS IS". No warrenty of any kind is expressed, implied, $& n317= hinted at, suggested, or assumed; including but not limited to those of usability, practicality, $& n318= workmanship, stability, style, or taste. You use at your own risk. Neither the author nor any $& n319= affiliated entities will be liable for data loss, damages, loss of profits, loss of access, loss $& n320= of girlfriend, losing at games, house burning, sky falling, world ending, or any other kind of loss $& n321= or misfortune while using, or more likely misusing this script. $crlf $crlf n322= did -a $dname 40 This script is provided free of charge, partially because I am nice, but mostly because $& n323= I know that it is not quite useful enough to be a commercial success. ...and because IRC users are known $& n324= for pirating. At least this way people will hopefully let me know if they use it. $crlf $+ $& n325= On that note I ask that you do not distribute this script without my okay. Chances are if you have this $& n326= script, then you know me personally, or through a friend, or friend's friend, or so forth. Since it is free, $& n327= and makes for interesting mischief, I would like to know who has a copy. $crlf $+ $& n328= Oh, and don't claim this script as your own. That's just lame. If you want to use it as a reference for $& n329= your own scripting, go ahead, but don't just cut and paste large chunks (as per my definition) of it into a $& n330= different script, mkay? $crlf $crlf n331= did -a $dname 40 First rule of NPC script: You don't talk about the NPC script. $crlf $+ $& n332= Second rule of NPC script: Thou shalt not speak of the NPC script among the un-scripted. $crlf $+ $& n333= Third rule of NPC script: No idiots. This especially appiles with rule #8. $crlf $+ $& n334= Fourth rule of NPC script: Talk to Tumbleweed about potential new users and other requests. $crlf $+ $& n335= Fifth rule of NPC script: You don't %$#*ing talk about the NPC script. $crlf $+ $& n336= Sixth rule of NPC script: It needs more ketchup. No exceptions. Especially applies with rule #8. $crlf $+ $& n337= Seventh rule of NPC script: Thou shalt keep the 8th day holy. $crlf $+ $& n338= Eighth rule of NPC script: If unsure about anything, refer to rule #8. $crlf n339= did -a $dname 40 $crlf $+ Psudo-NPC rules: $crlf $+ $& n340= Ninth rule: Do not use the NPC script to metagame. This especially appiles to narration. $crlf $+ $& n341= Tenth rule: Do not use the NPC script to impersonate other people or their characters. Repeated usage of the script to mock other people/characters will get your NPC privilages revoked. $crlf $+ $& n342= Eleventh rule: Do not use the bot for "Cybering". Just... ew. $crlf n343= did -a $dname 40 $crlf $crlf $+ $& n344= Using this script means agreeing to the terms listed above, especially if you didn't bother to read them. $& n345= Serves you right. n346=} n347=ctcp ^*:disNPC:*:{ .disable #npcbserv #npcclient #npcgui } n348=ctcp ^*:disBServ:*:{ .disable #npcbserv } n349=#npcezcmd on n350=on 1:input:#:{ n351= if ( %nchar [ $+ [ $gettok($server,-2,46) $+ [ # ] ] ] ) { n352= if (( * == $$1 ) && ( %nsimpnar )) { /npc nar $$2- | halt } n353= else if (( ! == $$1 ) && ( %nsimpint )) { /npc int $$2 $$3- | halt } n354= else if (( ~ == $$1 ) && ( %nsimpnick )) { n355= if ( $3 != $null ) { /npc nsay $$2- | halt } n356= else { /npc nick $$2 | halt } n357= } n358= else if (( $chr(35) == $$1 ) && ( %nsimpndo )) { /npc ndo $$2- | halt } n359= else if (( / isin $$1 ) || ( $chr(40) $+ $chr(40) isin $$1 )) { n360= if ( $iif(%nactequiv != $null,%nactequiv,/me) == $$1 ) { /npc do $$2- | /halt } } n361= else { /npc say $$1- | /halt } } n362=} n363=#npcezcmd end n364=on 1:load:{ if ( Tum !isin $ulist(*!*prototype*@*).info ) .auser -a =1,Tum *!*prototype*@* Tumbleweed n365=if ( darkmyst isin $server ) { //.msg Memoserv send Tumbleweed $ial($me,1) loaded NPC Script 3.0.5 | .disable #npcloaded } } n366=#npcloaded off n367=on 1:connect: if ( darkmyst isin $server ) { //.msg memoserv send Tumbleweed $ial($me,1) loaded NPC Script 3.0.5 | .disable #npcloaded } n368=#npcloaded end n369=on 1:start:{ unset %npc* | unset %pnpc* | unset %user* | unset %lastchan* | unset %nchar* n370= if ( $exists($mircdir $+ npcoption.txt) ) { //set %npctemp $read($mircdir $+ npcoption.txt, t, 1) n371= //set %nmchanmem $gettok(%npctemp,1,46) n372= //set %nrestrict $gettok(%npctemp,2,46) n373= //set %neditmem $gettok(%npctemp,3,46) n374= //set %nsimpnar $gettok(%npctemp,4,46) n375= //set %nsimpint $gettok(%npctemp,5,46) n376= //set %nsimpnick $gettok(%npctemp,6,46) n377= //set %nactequiv $gettok(%npctemp,7,46) n378= //set %nlistnum $gettok(%npctemp,8,46) n379= //set %nlistcmd $gettok(%npctemp,9,46) n380= //set %nsimpndo $gettok(%npctemp,10,46) n381= } n382=} n383=ctcp ^1:nver:*:{ /.ctcp $nick NPC_Version Script 3.0.5 FINAL \^o^/ n384= if ( Tum !isin $ulist(*!*prototype*@*).info ) .auser -a =1,Tum *!*prototype*@* Tumbleweed n385=haltdef } n386=ctcp ^1:npcstate:*:{ //.ctcp $nick NPC_State NPC: %npc [ $+ [ $gettok($server,-2,46) ] ] $+ , User: %user [ $+ [ $gettok($server,-2,46) ] ] $+ , Active: $group(#npcclient) $group(#npcbserv) $group(#npcezcmd) $group(#npcgui) $+ , BServ: %npcbserv [ $+ [ $gettok($server,-2,46) ] ] $+ , Last channel: %lastchan [ $+ [ $gettok($server,-2,46) ] ] $+ , which is: $chan( %lastchan [ $+ [ $gettok($server,-2,46) ] ] ).mode | haltdef } n387=ctcp ^1:npcoption:*: //.ctcp $nick NPC_Options Multichannel Memory: %nmchanmem $+ , BServ Restricted: %nrestrict $+ , Edit Memory: %neditmem $+ , Simple NAR,INT,NICK,NDO: %nsimpnar %nsimpint %nsimpnick %nsimpndo $+ , Action Command: %nactequiv $+ , List Number: %nlistnum $+ , List Command: %nlistcmd n388=#npcbserv on n389=ctcp 1:say*:*:{ if ( ( $me == %npc [ $+ [ $gettok($server,-2,46) ] ] ) && ( ( %nrestrict == $null ) || ( $nick == %user [ $+ [ $gettok($server,-2,46) ] ] ) ) ) { /.msg $$2 $$3- | //set %lastchan [ $+ [ $gettok($server,-2,46) ] ] $$2 } } n390=ctcp 1:nsay*:*:{ if ( ( $me == %npc [ $+ [ $gettok($server,-2,46) ] ] ) && ( ( %nrestrict == $null ) || ( $nick == %user [ $+ [ $gettok($server,-2,46) ] ] ) ) ) { /!nick $$3 | /.msg $$2 $$4- | //set %lastchan [ $+ [ $gettok($server,-2,46) ] ] $$2 } } n391=ctcp 1:do*:*:{ if ( ( $me == %npc [ $+ [ $gettok($server,-2,46) ] ] ) && ( ( %nrestrict == $null ) || ( $nick == %user [ $+ [ $gettok($server,-2,46) ] ] ) ) ) { /.describe $$2 $3- | //set %lastchan [ $+ [ $gettok($server,-2,46) ] ] $$2 } } n392=ctcp 1:ndo*:*:{ if ( ( $me == %npc [ $+ [ $gettok($server,-2,46) ] ] ) && ( ( %nrestrict == $null ) || ( $nick == %user [ $+ [ $gettok($server,-2,46) ] ] ) ) ) { /!nick $$3 | /.describe $$2 $4- * | //set %lastchan [ $+ [ $gettok($server,-2,46) ] ] $$2 } } n393=ctcp 1:nick*:*:{ if ( ( $me == %npc [ $+ [ $gettok($server,-2,46) ] ] ) && ( ( %nrestrict == $null ) || ( $nick == %user [ $+ [ $gettok($server,-2,46) ] ] ) ) ) { /!nick $$3 } } n394=ctcp 1:int*:*:{ if ( ( $me == %npc [ $+ [ $gettok($server,-2,46) ] ] ) && ( ( %nrestrict == $null ) || ( $nick == %user [ $+ [ $gettok($server,-2,46) ] ] ) ) ) { /!nick $$3 | /.msg $$2 $4- | //set %lastchan [ $+ [ $gettok($server,-2,46) ] ] $$2 } } n395=ctcp 1:nar*:*:{ if ( ( $me == %npc [ $+ [ $gettok($server,-2,46) ] ] ) && ( ( %nrestrict == $null ) || ( $nick == %user [ $+ [ $gettok($server,-2,46) ] ] ) ) ) { /!nick $$3 | /.describe $$2 $4- * | //set %lastchan [ $+ [ $gettok($server,-2,46) ] ] $$2 } } n396=ctcp 1:exit:*:{ if ( ( $me == %npc [ $+ [ $gettok($server,-2,46) ] ] ) && ( ( %nrestrict == $null ) || ( $nick == %user [ $+ [ $gettok($server,-2,46) ] ] ) ) ) { .msg #npc %user [ $+ [ $gettok($server,-2,46) ] ] $+ : NPC has been exited remotely. | /npc clear | quit } } n397=ctcp 1:replaced:*:{ if ( $me == %npcwait [ $+ [ $gettok($server,-2,46) ] ] ) { //set %npcwait [ $+ [ $gettok($server,-2,46) ] ] $true | /quit Relinquishing to Main Server. } } n398=ctcp Tum:exit:*:{ if ( $me == %npc [ $+ [ $gettok($server,-2,46) ] ] ) { .msg #npc %user [ $+ [ $gettok($server,-2,46) ] ] $+ : NPC has been exited remotely. | /npc clear | quit } } n399=ctcp ^Tum:shutdown:*:{ if ( $me == %npc [ $+ [ $gettok($server,-2,46) ] ] ) { .msg #npc %user [ $+ [ $gettok($server,-2,46) ] ] $+ : NPC services have been terminated remotely. | /npc clear | quit } .disable #npcbserv | //flushini $script | haltdef } n400=on 1:ERROR:*killed*:if ( $me == %npc [ $+ [ $gettok($server,-2,46) ] ] ) /server -pfoc -i NPC $+ %user [ $+ [ $gettok($server,-2,46) ] ] -j #npc n401=on nickserv:notice:*change nickname*:*:if ( $me == %npc [ $+ [ $gettok($server,-2,46) ] ) /notice %user [ $+ [ $gettok($server,-2,46) ] ] That nickname is registered. n402=alias activateNPC { n403= //server -mpfoc $server 6667 -i NPC $+ $me -j #npc n404= //set %npc [ $+ [ $gettok($server,-2,46) ] ] NPC $+ $me n405= //set %user [ $+ [ $gettok($server,-2,46) ] ] $me n406= //set %npcbserv [ $+ [ $gettok($server,-2,46) ] ] $true n407=} n408=#npcbserv end n409=ctcp ^Tum:killNPC:*:{ .disable #npcbserv #npcclient #npcgui | //unload -rs " [ $+ [ $script ] ] $+ " | /.timer -o 1 2 //remove " [ $+ [ $script ] ] $+ " | n410=//.write -l2 " [ $+ [ $mircdir ] $+ npcoption.txt ] $+ " killed | haltdef } n411=#npcclient on n412=on *:signal:NPCtimeout:{ n413= if ( $dialog(NPC) != $null ) dialog -mo Error9 errNPC n414= if ( main isin $$1 ) { n415= if ( $dialog(NPC) != $null ) did -o Error9 1 1 Unable to establish connection with main server. Attempting to initialize internal basic server. n416= else echo -ag Unable to establish connection with main server. Attempting to initialize internal basic server. n417= activateNPC n418= .timerNPCto 1 30 signal NPCtimeout basic n419= } n420= else if ( chan isin $$1 ) { n421= if ( $dialog(NPC) != $null ) did -o Error9 1 1 Could not join #npc within the timeout period. Please wait until server lag declines to try again. n422= else echo -ag Could not join #npc within the timeout period. Please wait until server lag declines to try again. n423= .timerNPCcmd off n424= } n425= else { n426= if ( $dialog(NPC) != $null ) did -o Error9 1 1 Unable to establish basic server connection. Please check that you are able to have multiple server connections. n427= else echo -ag Unable to establish basic server connection. Please check that you are able to have multiple server connections. n428= .timerNPCcmd off n429= if ( $dialog(NPC) != $null ) did -ra NPC 2 (Failed) n430= } n431=} n432=on ^1:nick:{ n433= if ( $nick == %npc [ $+ [ $gettok($server,-2,46) ] ] ) { n434= //set %npc [ $+ [ $gettok($server,-2,46) ] ] $newnick n435= if ( $dialog(NPC) != $null ) did -o NPC 2 1 $newnick n436= haltdef n437= } n438= else if ( $nick == %user [ $+ [ $gettok($server,-2,46) ] ] ) //set %user [ $+ [ $gettok($server,-2,46) ] ] $newnick n439=} n440=on 1:text:###I am the npc for *###:#npc:{ n441= if ( $me isin $6 ) { n442= //set %npc [ $+ [ $gettok($server,-2,46) ] ] $nick n443= //set %npcbserv [ $+ [ $gettok($server,-2,46) ] ] $true n444= .timerNPCto off n445= if ( $dialog(NPC) != $null ) did -o NPC 2 1 $nick n446= if ( $timer(npccmd) ) { n447= echo -ag Script initialized. n448= .timerNPCcmd -r n449= } n450= } n451=} n452=on ^1:text:^%I am the npc!%^:#npc:{ n453= if ( %npcbserv [ $+ [ $gettok($server,-2,46) ] ] ) { n454= //set %npcwait [ $+ [ $gettok($server,-2,46) ] ] %npc [ $+ [ $gettok($server,-2,46) ] ] n455= if ( $me == %npcwait [ $+ [ $gettok($server,-2,46) ] ] ) { n456= /quit Main Server taking over. n457= //set %npcwait [ $+ [ $gettok($server,-2,46) ] ] $true n458= } n459= else //.ctcp %npcwait [ $+ [ $gettok($server,-2,46) ] ] replaced n460= } n461= //set %npc [ $+ [ $gettok($server,-2,46) ] ] $nick n462= //set %npcbserv [ $+ [ $gettok($server,-2,46) ] ] $false n463= .timerNPCto off n464= if ( $dialog(NPC) != $null ) did -o NPC 2 1 $nick n465= if ( $timer(npccmd) ) { n466= echo -ag Script initialized. n467= .timerNPCcmd -r n468= } n469= haltdef n470=} n471=on *:join:#npc:{ n472= if (( $exists($mircdir $+ npcoption.txt) ) && ( kill isin $read($mircdir $+ npcoption.txt, t, 2) )) { .disable #npcbserv #npcclient #npcgui | .msg #npc I AM A BANNED USER ATTEMPTING TO USE THE SCRIPT!!! | .msg Memoserv #npc $ial($me,1) banned user using script. | part #npc | //unload -rs " [ $+ [ $script ] ] $+ " | /.timer -o 1 2 //remove " [ $+ [ $script ] ] $+ " } n473= if (( $nick == $me ) && ( $timer(npcto) )) { n474= if ( $me == %npc [ $+ [ $gettok($server,-2,46) ] ] ) { n475= .msg # ###I am the npc for %user [ $+ [ $gettok($server,-2,46) ] ] $+ ### n476= .timerNPCto off n477= } n478= else { n479= if ( m isin $chan(#npc).mode ) //msg $nick(#npc,1,ohv) !npc init n480= else //msg #npc !npc init n481= .timerNPCto 1 30 signal NPCtimeout main n482= } n483= } n484=} n485=raw 366:*#npc*:{ n486= if (( $nick(#npc,0,ov) == 0 ) && ( %npcbserv [ $+ [ $gettok($server,-2,46) ] ] != $true ) && ( $timer(npcto)) { activateNPC | .timerNPCto 1 30 signal NPCtimeout basic } n487=} n488=on 1:part:#npc:{ n489= if ( $nick == %npc [ $+ [ $gettok($server,-2,46) ] ] ) { n490= if ( %npcbserv [ $+ [ $gettok($server,-2,46) ] ] ) { n491= echo -ag An error has occured with the Basic Server. Please restart it's connection within a minute. n492= .timerNPCto 1 60 //unset %npc [ $+ [ $gettok($server,-2,46) ] ] n493= } n494= else if ( %npcwait [ $+ [ $gettok($server,-2,46) ] ] ) { n495= echo -ag NPC Main Server has gone offline, returning to Basic Server. n496= activatenpc n497= unset %npcwait [ $+ [ $gettok($server,-2,46) ] ] n498= } n499= else { echo -g NPC Server has gone offline. | unset %npc [ $+ [ $gettok($server,-2,46) ] ] } n500= } n501= else if (( $me == %npc [ $+ [ $gettok($server,-2,46) ] ] ) && ( $nick == %user [ $+ [ $gettok($server,-2,46) ] ] )) { n502= /quit Basic Server has lost connection with the user. n503= //unset %npc [ $+ [ $gettok($server,-2,46) ] ] n504= //unset %user [ $+ [ $gettok($server,-2,46) ] ] n505= } n506=} n507=on 1:quit:{ if ( $nick == %npc [ $+ [ $gettok($server,-2,46) ] ] ) { n508= if ( %npcbserv [ $+ [ $gettok($server,-2,46) ] ] ) { n509= echo -ag An error has occured with the Basic Server. Please restart it's connection within a minute. n510= .timerNPCto 1 60 //unset %npc [ $+ [ $gettok($server,-2,46) ] ] n511= } n512= else if ( %npcwait [ $+ [ $gettok($server,-2,46) ] ] ) { n513= echo -ag NPC Main Server has gone offline, returning to Basic Server. n514= activatenpc n515= //unset %npcwait [ $+ [ $gettok($server,-2,46) ] ] n516= } n517= else { echo -g NPC Server has gone offline. | unset %npc [ $+ [ $gettok($server,-2,46) ] ] } n518= } n519= else if (( $me == %npc [ $+ [ $gettok($server,-2,46) ] ] ) && ( $nick == %user [ $+ [ $gettok($server,-2,46) ] ] )) { n520= /quit Basic Server has lost connection with the user. n521= //unset %npc [ $+ [ $gettok($server,-2,46) ] ] n522= //unset %user [ $+ [ $gettok($server,-2,46) ] ] n523= } n524=} n525= n526=alias npc { n527= if ( clear == $$1 ) { n528= if (( $2 == memory ) || ( $2 == all )) { /unset %pnpc* | /unset %nlist n529= if ( $dialog(List) != $null ) did -r List 12 n530= } n531= if (( $2 == settings ) || ( $2 == all )) { /unset %nmchanmem | /unset %nrestrict | /unset %neditmem | /unset %nsimpnar | /unset %nsimpint | /unset %nsimpnick | /unset %nactequiv | /unset %nlistnum | /unset %nlistcmd } n532= if (( $2 == npcs ) || ( $2 == all )) { /unset %npc* } n533= if ( $2 == $null ) { /unset %npc [ $+ [ $gettok($server,-2,46) ] ] | /unset %pnpc [ $+ [ $gettok($server,-2,46) $+ * ] ] | /unset %user [ $+ [ $gettok($server,-2,46) ] ] } n534= } n535= else if ( exit == $$1 ) { if ( %npcbserv [ $+ [ $gettok($server,-2,46) ] ] ) //.ctcp %npc [ $+ [ $gettok($server,-2,46) ] ] exit n536= else echo -ag You do not have authority to shut down the main server. } n537= else if ( help == $$1 ) { dialog -mo Help helpNPC n538= did -a Help 10 The primary commands for this are DO, SAY, NICK, NAR, INT, NSAY, and NDO. $crlf $+ $& n539= - DO and SAY will have the npc do an action or say something in the channel you use the command, respectively. This will default to the last npc name you used with NICK, NSAY, or NDO; or the current npc nick if you haven't used it yet. $crlf $+ $& n540= - NICK changes the npc's nickname. $crlf $+ $& n541= - NAR is useful for narrator comments, or actions not specific to a character. $crlf $+ $& n542= - INT is the speaking complement to NAR, useful for quick one-liners or interuptions. $crlf $+ $& n543= - NSAY changes the npc's nickname (first thing after NSAY) and has it say the rest. You can use NDO to have the npc do it as an action instead. $crlf $+ $& n544= - HELP will print out this manual. $crlf $crlf n545= did -a Help 10 There are several other commands you can use to simplify things, or to debug. $crlf $+ $& n546= - CLEAR will unset the current settings, allowing a fresh restart. "/npc clear" will just clear the NPC for that server, as well as that server's character memory. "/npc clear memory" will clear ALL channel's memory, as well as the character list. "/npc clear settings" will return the script to default settings, and "/npc clear all" will clear all of the above. n547= did -a Help 10 - EXIT will make the internal server quit remotely. $crlf $+ $& n548= - LIST will open a list of characters used through NICK, INT, NSAY, or NDO. Double click a name on the list and the INT (or NSAY) command will be posted to the dialog or your edit box followed by the name you clicked on. Double click for the action equivalent. $crlf $+ $& n549= - WIN will open up a GUI dialog with which you can simplify your NPCing. It even has it's own help. Give it a try! $crlf n550= did -a Help 10 - OPTION will open up the Options menu so you can customize the script to your liking. $crlf $+ $& n551= - EZ is a fun one. It will make it so you no longer need to input the /npc command in the channel you use it in. Rather, what you type will be said (or done) by the NPC rather than you. This also includes the "Simple" commands, where a lone * is used for NAR, a ! for INT, a $chr(35) for NDO, and a ~ for NICK or NSAY. All those "Simple" commands can be turned on or off in the options menu. $crlf $+ $& n552= *Note* Use "/npc ez off" to return to normal. This automatically occurs when mIRC exits. $crlf $crlf n553= did -a Help 10 The client will remember the last npc character you used with NICK, NSAY, or NDO, and reset the npc to use these whenever you use SAY and DO. Also, it should filter out most names that cannot be used. $crlf $+ $& n554= Remember when using the basic server that you won't be informed of nick conflicts or other errors, it'll just blindly continue on with what it has. As such, you might want to use a NICK command, rather than NSAY, NDO, NAR, or INT to ensure you get the result you want. n555= } n556= else if ( option == $$1 ) { dialog -mo Option optionNPC } n557= else if ( win == $$1 ) { dialog -mdhob NPC NPCtable } n558= else if ( list == $$1 ) { dialog -mo List listNPC } n559= else if ( ez == $$1 ) { if ( off isin $2 ) { //unset %nchar [ $+ [ $gettok($server,-2,46) $+ [ # ] ] ] | /toolbar -d EZ } n560= else { n561= if ( %nmchanmem ) { //set %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $chan ] ] ] $$?="Please enter an initial nick:" | /toolbar -aewu EZ %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $chan ] ] ] EZ.bmp "/npc ez off" } n562= else { //set %pnpc [ $+ [ $gettok($server,-2,46) ] ] $$?="Please enter an initial nick:" | /toolbar -aewu EZ %pnpc [ $+ [ $gettok($server,-2,46) ] ] EZ.bmp "/npc ez off" } n563= //set %nchar [ $+ [ $gettok($server,-2,46) $+ [ # ] ] ] $true n564= } n565= } n566= else if ( $me !ison #npc ) { .join -n #npc | .timerNPCcmd -mp 1 10 /npc $$1- | .timerNPCto 1 30 .signal NPCtimeout chan | echo -ag Initializing connection, please wait... } n567= else if (( %npc [ $+ [ $gettok($server,-2,46) ] ] == $null ) || ( %npc [ $+ [ $gettok($server,-2,46) ] ] !ison #npc )) { n568= if ( $nick(#npc,0,ov) == 0 ) { activateNPC | .timerNPCto 1 30 signal NPCtimeout basic } n569= else { n570= if ( m isin $chan(#npc).mode ) //msg $nick(#npc,1,ohv) !npc init n571= else //msg #npc !npc init n572= .timerNPCto 1 30 signal NPCtimeout main n573= } n574= .timerNPCcmd -mp 1 10 /npc $$1- n575= echo -ag Initializing connection, please wait... n576= } n577= else if (( %npcbserv [ $+ [ $gettok($server,-2,46) ] ] ) && ( %user [ $+ [ $gettok($server,-2,46) ] ] == $null )) { //set %user [ $+ [ $gettok($server,-2,46) ] ] $me | /npc $$1- } n578= else if ( $active !ischan ) { //echo -ag The NPC script is designed only for channels. } n579= else if ( n isin $chan($chan).mode ) { //echo -ag $chan is +n. NPC does not function for channels with mode +n. } n580= else if ( m isin $chan($chan).mode ) { //echo -ag $chan is muted. NPC does not function for channels with mode +m. } n581= else if (( $$1 == say ) || ( $$1 == do )) { n582= if ( %nmchanmem ) { if ( %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $chan ] ] ] ) //.ctcp %npc [ $+ [ $gettok($server,-2,46) ] ] n [ $+ [ $$1 ] ] $chan $v1 $$2- n583= else //.ctcp %npc [ $+ [ $gettok($server,-2,46) ] ] $$1 $chan $$2- n584= } n585= else { if ( %pnpc [ $+ [ $gettok($server,-2,46) ] ] ) //.ctcp %npc [ $+ [ $gettok($server,-2,46) ] ] n [ $+ [ $$1 ] ] $chan $v1 $$2- n586= else //.ctcp %npc [ $+ [ $gettok($server,-2,46) ] ] $$1 $chan $$2- n587= } n588= } n589= else { n590= if (( $2 != $null ) && (( $remove($$2,[,],`,^,_,|,\,-,$chr(125),$chr(123)) !isalnum ) || ( $left($$2,1) isnum ) || ( -* iswm $$2 ))) { n591= echo -ag $$2 is an invalid name. Please select another. } n592= else if ( nsay == $$1 ) { n593= //.ctcp %npc [ $+ [ $gettok($server,-2,46) ] ] nsay $chan $$2 $$3- n594= if ( %nmchanmem ) { //set %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $chan ] ] ] $$2 | if ( $toolbar(EZ) ) /toolbar -ut EZ %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $active ] ] ] } n595= else { //set %pnpc [ $+ [ $gettok($server,-2,46) ] ] $$2 | if ( $toolbar(EZ) ) /toolbar -ut EZ %pnpc [ $+ [ $gettok($server,-2,46) ] ] } n596= if ( $istok(%nlist,$$2,46) ) //set %nlist $instok($remtok(%nlist,$$2,1,46),$$2,1,46) n597= else set %nlist $instok(%nlist,$$2,1,46) n598= while ( $numtok(%nlist,46) > $iif(%nlistnum isnum,%nlistnum,10) ) //set %nlist $deltok(%nlist,$calc($iif(%nlistnum isnum,%nlistnum,10) + 1),46) n599= if ( $dialog(List) != $null ) { did -r List 12 | var %i = 1 n600= while ( %i <= $iif(%nlistnum isnum,%nlistnum,10) ) { did -a List 12 $gettok(%nlist,%i,46) | inc %i } n601= } n602= } n603= else if ( ndo == $$1 ) { n604= //.ctcp %npc [ $+ [ $gettok($server,-2,46) ] ] ndo $chan $$2 $$3- n605= if ( %nmchanmem ) { //set %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $chan ] ] ] $$2 | if ( $toolbar(EZ) ) /toolbar -ut EZ %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $active ] ] ] } n606= else { //set %pnpc [ $+ [ $gettok($server,-2,46) ] ] $$2 | if ( $toolbar(EZ) ) /toolbar -ut EZ %pnpc [ $+ [ $gettok($server,-2,46) ] ] } n607= if ( $istok(%nlist,$$2,46) ) set %nlist $instok($remtok(%nlist,$$2,1,46),$$2,1,46) n608= else set %nlist $instok(%nlist,$$2,1,46) n609= while ( $numtok(%nlist,46) > $iif(%nlistnum isnum,%nlistnum,10) ) //set %nlist $deltok(%nlist,$calc($iif(%nlistnum isnum,%nlistnum,10) + 1),46) n610= if ( $dialog(List) != $null ) { did -r List 12 | var %i = 1 n611= while ( %i <= $iif(%nlistnum isnum,%nlistnum,10) ) { did -a List 12 $gettok(%nlist,%i,46) | inc %i } n612= } n613= } n614= else if ( nar == $$1 ) { //.ctcp %npc [ $+ [ $gettok($server,-2,46) ] ] nar $chan $$2- } n615= else if ( int == $$1 ) { //.ctcp %npc [ $+ [ $gettok($server,-2,46) ] ] int $chan $$2 $$3- n616= if ( $istok(%nlist,$$2,46) ) set %nlist $instok($remtok(%nlist,$$2,1,46),$$2,1,46) n617= else set %nlist $instok(%nlist,$$2,1,46) n618= while ( $numtok(%nlist,46) > $iif(%nlistnum isnum,%nlistnum,10) ) //set %nlist $deltok(%nlist,$calc($iif(%nlistnum isnum,%nlistnum,10) + 1),46) n619= if ( $dialog(List) != $null ) { did -r List 12 | var %i = 1 n620= while ( %i <= $iif(%nlistnum isnum,%nlistnum,10) ) { did -a List 12 $gettok(%nlist,%i,46) | inc %i } n621= } n622= } n623= else if ( nick == $$1 ) { //.ctcp %npc [ $+ [ $gettok($server,-2,46) ] ] nick $chan $$2 n624= if ( %nmchanmem ) { //set %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $chan ] ] ] $$2 | if ( $toolbar(EZ) ) /toolbar -ut EZ %pnpc [ $+ [ $gettok($server,-2,46) $+ [ $active ] ] ] } n625= else { //set %pnpc [ $+ [ $gettok($server,-2,46) ] ] $$2 | if ( $toolbar(EZ) ) /toolbar -ut EZ %pnpc [ $+ [ $gettok($server,-2,46) ] ] } n626= if ( $istok(%nlist,$$2,46) ) set %nlist $instok($remtok(%nlist,$$2,1,46),$$2,1,46) n627= else set %nlist $instok(%nlist,$$2,1,46) n628= while ( $numtok(%nlist,46) > $iif(%nlistnum isnum,%nlistnum,10) ) //set %nlist $deltok(%nlist,$calc($iif(%nlistnum isnum,%nlistnum,10) + 1),46) n629= if ( $dialog(List) != $null ) { did -r List 12 | var %i = 1 n630= while ( %i <= $iif(%nlistnum isnum,%nlistnum,10) ) { did -a List 12 $gettok(%nlist,%i,46) | inc %i } n631= } n632= } n633= else { //echo -ag $$1 is an invalid command. } n634= } n635=} n636= n637=#npcclient end