Adreos Insane Net Dragon Posts: 147 | Jan 10, 2016 10:50 AM Useful mIRC scripts and codes |
I have scripted with mIRC for a while. I thought I'd share some of my more useful ones here. Important Notes, Please Read First - Notes Codes These scripts are designed for mIRC only. They may not work on any other client. To input the scripts you need to go to TOOLS menu in mIRC then click SCRIPT EDITOR Text in italics is not part of any code. It is notes about the code In this post =word= will denote mandatory parts the code must have, though you have to replace =word= with your own information In this post [word] will denote optional parts the code may have, though you have to replace [word] with your own information if you choose to do so. Only one instance of an ON call or alias is allowed The script editor may not contain two instances of an /alias or ON call. If two different scripts require the same /alias or ON call, combine them. - Example on me:*:connect: { AND /nick %changenick } on me:*:connect: { may be combined into /id } on me:*:connect: { /nick %changenick /id } In remote, when creating ON call put wildcards last. The more wild an ON call is, the further down it must be. Ex: on me:*:JOIN:#room: goes before on me:*:JOIN:#: goes before on *:*:JOIN:#: Terms
- Syntax If you are editing or making your own mIRC scripts there are some important things to know.
- Color Codes The following is a list of mIRC color codes. All are proceeded by the upside down ¬
- Identity Commands These codes serve to identify you to NICKSERV If you haven't registered a name you do so by /msg nickserv register =password= =email= This =password= is what will be used whenever a password is required. On some servers, such as sorcery.net, this will accepting a conformation e-mail sent to =email= to complete registration. Also whatever name you had when you use the register will be your =group= Aliases - /id - Short Version /id /msg nickserv identify =password= - Long Version This command will send the indentify command to nickserv when executed. /id { if ( =server1= ) { /msg nickserv identify =password= } elseif ( =server2= ) { /msg nickserv identify =password= } else { echo Server: $server } } If you only connect to one server you can use the shortened version. The long version will send a different password to different servers if you connect to more then one. If there is no server it recognizes it will tell you the server ID so you can modify the code. You may use as many elseif as you need, or none. The =server= for sorcery.net is $server == aesir.sorcery.net || $server == ember.sorcery.net || $server == paranor.sorcery.net In all cases, the code you execute is /id - /ghost /ghost /msg nickserv ghost $$1 This will cause NICKSERV to kick off the nick you have specified. You must have already identified on another nick to use this command, or you can add =password= to the end of it. The command you use it /ghost =nick= If NICKSERV does not automatically change your nick to =nick= on the server, like it does on sorcery.net, you may use this code to automatically switch nicks. It is used in the same way as /ghost /take /msg nickserv ghost $$1 | /.timer 1 10 /nick $$1 - /register /register /msg nickserv group =group= =password= This will add your current NICK to your name group. The command you use is /reigster This command may be split like /id for multiple servers - /drop /drop /msg nickserv drop Unregisters your current nick The command you use is /drop - Name alert This code is used to alert you when your name is said in a chat room. Comes with a timeout so it can only be activated if your name has not been said for a minute. REMOTE on !*:text:*=NICK=*:#: { Replace =NICK= with your main name you use. if ( %ntime < $ctime ) { noop $tip(tip, Hey =NICK=! , $nick speaks of you in # ,info.ico,,,) /join # } %ntime = $ctime + 60 } - Auto ID This code will automatically ID you to NICKSERV when its requested REMOTE on *:NOTICE:*:*: { if ( $nick == NickServ && $1- == This nickname is registered and protected. If it is your ) { /id } } If you do not have the /id alias command installed replace /id with /msg nickserv identify =password= - Startup Nick Correction This code resets your nicks to the proper ones when you start mIRC so you don't join with some other name. REMOTE on *:START:{ Replace =MAIN NICK= with your usual nickname and =ALTERNATE NICK= with another nickname. It is a good idea to have both registered to NICKSERV if either is. /mnick =MAIN NICK= /anick =ALTERNATE NICK= } - Nick Reset Warning, the next two pieces of code are highly complex This code will switch you from your alternate nick to your primary nick when you primary quits, usually from a timeout or other error REMOTE on !*:QUIT: { Replace =MAIN NICK= with your main nickname and =ALTERNATE NICK= with your alternate nickname if ( $nick == =MAIN NICK= && $me == =ALTERNATE NICK= ) { /nick =MAIN NICK= } } - Word highlighting This code will highlight certain word, or words, in incoming text. REMOTE on ^*:text:*:*: { var %a = $1- var %marker if ( $nick isvoice # ) { %marker = + } if ( $nick ishop # ) { %marker = % } if ( $nick isop # ) { %marker = @ } %a = $replace( %a , =WORD1= , =COLOR==WORD1==TEXTCOLOR= ) echo -mirctbfl normal $iif(#,#,$nick) $+() %a haltdef } on ^*:action:*:*: { =WORD1= is the word you want highlighted var %a = $1- var %marker if ( $nick isvoice # ) { %marker = + } if ( $nick ishop # ) { %marker = % } if ( $nick isop # ) { %marker = @ } %a = $replace( %a , =WORD1= , =COLOR==WORD1==ACTIONCOLOR= ) echo -mirctbfl normal $iif(#,#,$nick) 6* %marker $+ $nick %a haltdef } =COLOR= is the highlight color =TEXTCOLOR= is the normal color of regular spoken text. Normally this is 1 (black) but it may be different if you customized your client =ACTIONCOLOR= is the action color of regular spoken text (That made using the /me command). Normally this is 6 (purple) but it may be different if you customized your client The lines %a = $replace( %a , =WORD1= , =COLOR==WORD1==TEXTCOLOR= ) and %a = $replace( %a , =WORD1= , =COLOR==WORD1==ACTIONCOLOR= ) may be repeated as many times as desired for different words. Please be aware the upside down ¬ precedes =COLOR=, =TEXTCOLOR=, and =ACTIONCOLOR= When you copy/paste this code it should be copied with it. If it does not you will have to add it manually. For a list of colors, please see the color codes in the NOTES section of this post. - Alert System This complex system will display popup alerts and (optionally) run a sound when someone speaks. Be warned, there is a lot to this code ALIASES /room /set %roomdata. [ $+ [ # ] ] $1 /alert { if ( %alertall == true ) { { echo 5Alerts Disabled } { %alertall = false } } else { { echo 3Alerts Enabled } { %alertall = true } } } /oocalert { if ( %alertooc == true ) { { echo 5OOC Alerts Disabled } { %alertooc = false } } else { { echo 3OOC Alerts Enabled } { %alertooc = true } } } /alertall { if ( %alertooc == true && %alertall == true ) { echo 5All Alerts Disabled %alertooc = false %alertall = false } else { echo 3All Alerts Enabled %alertooc = true %alertall = true } } on me:*:JOIN:#: { var %thisroom %thisroom = %roomdata. [ $+ [ # ] ] if ( %thisroom != ooc ) { /set %roomdata. [ $+ [ # ] ] ic } } on !*:text:*:#: { if ( %roomdata. [ $+ [ # ] ] == ic && %alertall == true ) { noop $tip(tip, IC Alert - $nick , $1- ,info.ico,,,) /splay =SOUNDFILE= } elseif ( %roomdata. [ $+ [ # ] ] == ooc && %alertooc == true ) { noop $tip(tip, OOC Alert - $nick , $1- ,info.ico,,,) /splay =SOUNDFILE= } } on !*:action:*:#: { if ( %roomdata. [ $+ [ # ] ] == ic && %alertall == true ) { noop $tip(tip, IC Alert - $nick , $1- ,info.ico,,,) /splay =SOUNDFILE= } elseif ( %roomdata. [ $+ [ # ] ] == ooc && %alertooc == true ) { noop $tip(tip, OOC Alert - $nick , $1- ,info.ico,,,) /splay =SOUNDFILE= } } The [/u]/splay =SOUNDFILE=[/u] lines may be omitted if you do not want sound to play Commands you use /room =TYPE= This adjusts the room type. =TYPE= should be ic or ooc /alert These turn on/off the alert system for IC messages, OOC messages, and both messages entirely /oocalert /alertall - Code explained on me:*:JOIN:#: { var %thisroom %thisroom = %roomdata. [ $+ [ # ] ] if ( %thisroom != ooc ) { /set %roomdata. [ $+ [ # ] ] ic } } on !*:text:*:#: { if ( %roomdata. [ $+ [ # ] ] == ic && %alertall == true ) { noop $tip(tip, IC Alert - $nick , $1- ,info.ico,,,) /splay =SOUNDFILE= } elseif ( %roomdata. [ $+ [ # ] ] == ooc && %alertooc == true ) { noop $tip(tip, OOC Alert - $nick , $1- ,info.ico,,,) /splay =SOUNDFILE= } } | |
When C4 comes a knocking, BOOM! | |