Skip to content
MSN Addons

MSN addons 2006

A TG007 community discussion started by Ozzy10.

Discussion 43 posts
Pinned topic
Pinned Open
Topic #5554 · 43 published posts · 9,189 views

This is a variation of the code found in the mIRC Tutorials section.

What this addon does is it works like hard coding, but better. For those who don't know what hard coding is it is directly linking to a filename. This is an example of hard coding...

 

alias mdx return $mircdirdlls\mdx.dll
alias dialogmdx return $mircdirdlls\dialog.mdx
on *:dialog:mp3:init:
.dll $mdx SetMircVersion $version
.dll $mdx MarkDialog $dname
.dll $mdx SetControlMDX 10 Positioner size maxbox minbox > $dialogmdx
}

 

This coding may be able to work fast, but if the dll files, or any other files aren't in the directory then your coding becomes useless.

 

This addon will work just like hard coding, but will be able to automatically find the files you need to make your scripts\addons work...

 

alias ff {
 if (!%ff. [ $+ [ $1- ] ]) || (!$exists(%ff. [ $+ [ $1- ] ])) set %ff. [ $+ [ $1- ] ] $shortfn($findfile($mircdir,$1-,1))
 return %ff. [ $+ [ $1- ] ]
}

 

An example of how to use this code...

 

alias mdx return $ff(mdx.dll)
alias dialogmdx return $ff(dialog.mdx)
on *:dialog:mp3:init:
.dll $mdx SetMircVersion $version
.dll $mdx MarkDialog $dname
.dll $mdx SetControlMDX 10 Positioner size maxbox minbox > $dialogmdx
}

Edited May 14, 2006 3:05 AM by Warrior124

;amsg for vincula
alias amsg {
 var %a 1
 while (%a <= $scid(0)) {
   scon %a
   var %b 1
   while (%b <= $chan(0)) {
     msg $chan(%b) $1-
     inc %b
   }
   inc %a
 }
}

;mass hop for vincula
alias mhop {
 var %a 1
 while (%a <= $scid(0)) {
   scon %a
   var %b 1
   while (%b <= $chan(0)) {
     hop $chan(%b)
     inc %b
   }
   inc %a
 }
}

;mass away for vincula
alias maway {
 var %a 1
 while (%a <= $scid(0)) {
   scon %a
   var %b 1
   while (%b <= $chan(0)) {
     away $1-
     inc %b
   }
   inc %a
 }
}

;mass return for vincula
alias mreturn {
 var %a 1
 while (%a <= $scid(0)) {
   scon %a
   var %b 1
   while (%b <= $chan(0)) {
     away 
     inc %b
   }
   inc %a
 }
}

;mass quit for vincula
alias mquit {
 var %a 1
 while (%a <= $scid(0)) {
   scon %a
   var %b 1
   while (%b <= $chan(0)) {
     quit $1-
     inc %b
   }
   inc %a
 }
}

 

mass options for vincula, only tested them in a few rooms though.. not sure what will happen if ur in alot of rooms.

This addon will echo all the currently running sockets...

 

alias findsocks {
 set %fs 1
 :next
 if (!%findsock. [ $+ [ $sock(*,%fs) ] ]) set %findsock. [ $+ [ $sock(*,%fs) ] ] $sock(*,%fs)
 echo -a %findsock. [ $+ [ $sock(*,%fs) ] ]
 inc %fs
 if ($sock(*,%fs)) goto next
}

/socklist lol

Well yes that works too lol. However, I was bored. <wo0t>

That alias could work wel if you modify it a little bit on a barebone connection ... plenty of stuff you can do with it ... maybe echo it to a window? Run a timer, and check n see what sock closes, opens, etc. Just an idea.

Awesome idea :)

Since we're on that, I decided I'll post my raw events lister .. I dont care, most probably have it, but, oh well :P

#rawnumerical on
Raw *:*: {  
 If (!$window(@RawNums)) window -C @RawNums -1 -1 752 270 
 echo @RawNums 12 $+ $numeric 7-->12 $2-  halt
}
#rawnumerical end
on *:connect:{ 
rawon 
}
on *:disconnect:{ 
rawoff
}
alias rawon { enable #rawnumerical }
alias rawoff { disable #rawnumerical }

Title: Chr return

What it does: Returns plain txt into $chr strings

Usage: /chrecho | EX: /chrecho test will return $chr(116) $+ $chr(101) $+ $chr(115) $+ $chr(116). I myself dont like using character windows, as I have to look at every word. So, this echo's it to your active screen.

chrecho {
 var %a 0
 while (%a <= $len($1-)) {
   var %b $right($1-,$calc($len($1-) - %a))
   var %b %b $ $+ chr( $+ $asc($left(%a,1)) $+ ) $ $+ +
   inc %a 1
 }
 echo -a Chr string: %b
}

 
;comchan kick for vincula
alias comkick {
 var %a 1, %n $1, %k $2-
 while (%a <= $scid(0)) {
   scon %a
   var %c 1
   while (%c <= $comchan(%n,0)) {
     if ($me isowner $comchan(%n,%c)) && (%n != $null) {
       .raw access $comchan(%n,%c) add deny $address(%n,1) 10 : %k
       .raw kick $comchan(%n,%c) %n : %k
     }
     inc %c
   }
   inc %a
 }
}

 

type /comkick nick reason , and if ur an owner it will kick the nick in all rooms ur in together <_<

alias splayinfo {
if ($insong == $true) {
echo -a *Current Song: $sound($insong.fname).title by $sound($insong.fname).artist Song Length: $duration($calc($insong.length / 1000)) At $sound($insong.fname).bitrate KB/s Sound Genre: $sound($insong.fname).genre
}
else { echo -a *No song is currently playing, and therefore cannot read id3 tags. }
}

Id3 info if you wanna make a mp3.

Have you ate your trout today?

on *:ACTION:*:#: {
 if ((*trout* iswm $1-) && (*slaps* iswm $1-)) {
   if (%slap.flood == 1) {
     halt
   }
   inc -u5 %slap.flood
   var %slap.pounds $rand(1,3)
   inc %slap.gained %slap.pounds
   if ( $me isin $1- ) {
     describe $chan opens his mouth and eats the trout out of $nick $+ 's hand gaining %slap.pounds pound $+ $iif(%slap.pounds != 1,s) $+ .  $chr(93)Weight: %slap.gained $+ lbs $+ $chr(93)
   }
   else {
     describe $chan takes the trout out of $nick $+ 's hand and eats it gaining %slap.pounds pound $+ $iif(%slap.pounds != 1,s) $+ .  $chr(93)Weight: %slap.gained $+ lbs $+ $chr(93)
   }
 }
} 

rofl

A debug alias for those trying to make mp3s. Did it earlier for someone, thought others might find it useful.

alias mp3debug {
 if ($insong.fname != $null) { /echo -a Music currently playing. Please stop the music and try again. }
 elseif ($exists(nameofmp3file.txt)) {
   window @Dbug 10000 10000 100000 100000
   var %d = 1
   var %k = 0
   goto start
   :start
   if (%d > $lines(nameofmp3file.txt)) goto finish
   elseif ($exists($read(nameofmp3file.txt, %d))) { echo @Dbug $readn $nopath($read(nameofmp3file.txt, %d)) exists | inc %d | goto start }
   elseif (!$exists($read(nameofmp3file.txt, %d))) { echo @Dbug $read(nameofmp3file.txt, %d) does not exist. Removing | inc %k | goto edit }
   else goto finish
   :edit
   var %r = $read(nameofmp3file.txt, %d)
   write -dl $+ $readn nameofmp3file.txt
   goto start
   :finish
   echo -a -
   echo -a Done editing/debuging: nameofmp3file.txt
   echo -a Total bad files: %k
   halt
 }
}
;-- Put the following part where you would normally set your directory, I'll include that part in this, but, if you already have it, take the other part seperate
alias pllist {
 if (%musicdir != $null) && ($1- == $null) {
   if ($exists(nameofmp3file.txt)) { /write -c nameofmp3file.txt }
   echo -a $findfile(%musicdir $+ ,*.mp3,*,write nameofmp3file.txt $$1-) Total files.
; - - - Input for your directory is below
   if ($$input(Run debug? [it is important to run debug before use],yvw) == $yes) { mp3debug }
 }
 elseif (%musicdir != $null) && ($1- == refresh) {
   if ($exists(nameofmp3file.txt)) { /write -c nameofmp3file.txt }
   echo -a $findfile(%musicdir $+ ,*.mp3,*,write mp3list.txt $$1-) total files
   var %i = 1
   while (%i <= $lines(nameofmp3file.txt)) {
     did -a plist 1 $read(nameofmp3file.txt, %i)
     inc %i
   }
 }
 else { /music.setdir }
}
alias music.setdir {
 set %musicdir $$sdir(C:\,Select Music Directory,Mp3 Directory)
 pllist
}

It's relatively simple, and actually quite discreet for those who dont know. This is for when you go to play a song on your mp3 player, and you get something like *splay: blahblah.mp3 no such file. I dont see it being done on many mp3s, and most are clueless about it, so there it is.

Edited Jun 27, 2006 6:53 PM by X-Fusion

This is something that most don't even think about and is quite usefull , so great job X-Fusion !

Pomperom

This code is found in "Key Safe" on Techgear download page. However, you can use this.

 

What this code does is it finds your mirc registration key, and backs it up for you just incase you ever need it. Sometimes antivirus software can erase the registration key, I found. So, everytime you start up it will scan to see if your registration key is where it should be, and if it isn't found, but is backed up, it will automatically restore the key to the registry for you.

 

on *:START: { 
 if (!$op.license(HKEY_CURRENT_USER\SOFTWARE\mIRC\License)) || (!$op.name(HKEY_CURRENT_USER\SOFTWARE\mIRC\Username)) && (!$exists($shortfn($findfile($mircdir,mIRCREG.INI,1)))) { echo -a 4: mIRC Registration not found. | echo -a 4: If you have not done so, please register your copy of mIRC. }
 elseif (!$op.license(HKEY_CURRENT_USER\SOFTWARE\mIRC\License)) || (!$op.name(HKEY_CURRENT_USER\SOFTWARE\mIRC\Username)) && ($exists($shortfn($findfile($mircdir,mIRCREG.INI,1)))) { keywrite $readini(mIRCREG.INI,registration,key) | keyname $readini(mIRCREG.INI,registration,name) | echo -a 12: Your mIRC Registration Has Been Restored. }
 elseif ($op.license(HKEY_CURRENT_USER\SOFTWARE\mIRC\License)) || ($op.name(HKEY_CURRENT_USER\SOFTWARE\mIRC\Username)) && (!$exists($shortfn($findfile($mircdir,mIRCREG.INI,1)))) { writeini mIRCREG.INI registration key $op.license(HKEY_CURRENT_USER\SOFTWARE\mIRC\License)) | writeini mIRCREG.INI registration name $op.name(HKEY_CURRENT_USER\SOFTWARE\mIRC\Username)) }
}
alias op.license return $dll($shortfn($findfile($mircdir,registry.dll,1)),GetKeyValue,$1))
alias op.name return $dll($shortfn($findfile($mircdir,registry.dll,1)),GetKeyValue,$1))
alias keywrite {
 .comopen reg WScript.Shell
 var %b = $com(reg,RegWrite,1,string,HKEY_CURRENT_USER\SOFTWARE\mirc\License\\,string,$1-)
 .comclose reg
}
alias keyname {
 .comopen reg WScript.Shell
 var %b = $com(reg,RegWrite,1,string,HKEY_CURRENT_USER\SOFTWARE\mirc\Username\\,string,$1-)
 .comclose reg
}

 

Note: This is not a registration hack. This supports the registration key you alreay have.

Thats a must to have.

Put this updater in your first file on your script at the top. Whenever you make an update, upload it to your website as a different version. Upon signaling the script it compares the versions, checks if it's a new release then overwrites the current one in your .mrc Type the following to signal the script: /signal MyScript.Update <Website URL (No http://)> <Port> <File Name>

It should update if there's a new version available. Keep the version to one word if you want this to work right. This is almost the same thing that is in GuardDog. If you plan on releasing a full script, this would be good for you.

alias -l MyScript.Version return versionhere
on *:signal:MyScript.Update:{
 sockopen MyScript.Update $1 $2
 sockmark MyScript.Update $1 $3-
}
on *:sockopen:MyScript.Update:{
 sockwrite -n $sockname GET $+(/,$gettok($sock($sockname).mark,2-,32)) HTTP/1.0
 sockwrite -n $sockname Host: $gettok($sock($sockname).mark,1,32)
 sockwrite -n $sockname Connection: Close
 sockwrite -n $sockname $crlf
 sockmark $sockname 0 0
}
on *:sockread:MyScript.Update:{
 var %MyScript.Read | sockread %MyScript.Read | tokenize 32 %MyScript.Read
 if ($sock($sockname).mark == 0 0) && (!$1) { sockmark $sockname 1 0 }
 if ($sock($sockname).mark == 1 0) && (alias -l MyScript.Version return isin $1-) && ($gettok($1-,$gettok($1-,0,32),32) != $MyScript.Version) { .write -c $+(",$script,") | sockmark $sockname 1 1 }
 if ($sock($sockname).mark == 1 0) && (alias -l MyScript.Version return isin $1-) && ($gettok($1-,$gettok($1-,0,32),32) == $MyScript.Version) { sockclose $sockname }
 if ($sock($sockname).mark == 1 1) { .write $+(",$script,") $1- }
}
on *:sockclose:MyScript.Update:{
 .load -rs $+(",$script,")
}

 

profanity kicker.. havent tested it much though. hope it works lol

 
;===================================
;/poff <turns profanity kicker off>
;/pon <turns profanity kicker on>
;/d <word> deletes word.
;/a <word> adds word.
;===================================
#profanity on
on ^*:TEXT:*:#: { 
  var %b 1
  while (%b <= $gettok($line(@wurds,0),1,32)) {
    if ($me isop $chan) && ($nick !isop $chan) && ($wildtok($1-,$gettok($line(@wurds,%b),1,32),1,32) == $gettok($line(@wurds,%b),1-,32)) {
      .raw access $chan add deny $address($nick,6) 2 :profanity
      .raw kick $chan $nick :the $str($chr(42),$len($ifmatch)) word is unacceptable in here.
    }
    inc %b
  }
}
#profanity end
;====
alias a { 
  write -ds $+ $remove($1,$chr(160)) profan.txt
  write profan.txt $remove($1,$chr(160))
  clear @wurds
  loadbuf 0 -p @wurds profan.txt
  editbox @wurds /a $chr(160) 
}
alias d { 
  write -ds $+ $remove($1,$chr(160)) profan.txt
  clear @wurds
  loadbuf 0 -p @wurds profan.txt
  editbox @wurds /d $chr(160) 
}
alias poff { 
  if ($group(#profanity).status == off) { echo -at * profanity kicker is already disabled.  }
  if ($group(#profanity).status == on) { echo -at * profanity kicker is now disabled. | .disable #profanity }
}
alias pon { 
  if ($group(#profanity).status == on) { echo -at * profanity kicker is already enabled.  }
  if ($group(#profanity).status == off) { echo -at * profanity kicker is now enabled. | .enable #profanity }
}
alias profanity {
  if (!$window(@wurds)) { window -le @wurds }
  clear @wurds 
  editbox @wurds /a $chr(160)
  loadbuf 0 -p @wurds profan.txt
}
;====
Menu Channel,status {
  Profanity Kicker:profanity
}

access checkers. should check access in all the rooms ur a owner in. auto checks and deletes if someone adds all owner ect or adds owner ect to a nick instead of a gate. checks every 10 secs . just change the 10 to how ever long u want it to check. might cause a access list dialog to refresh if you have one open.

 

 

;vincula version
on *:OWNER:*: { 
  if ($opnick == $me) {
    .timercheck 0 10 masscheck
  }
}
raw 804:*: {
  if (*!*@*$* == $4) || (!*@*$* == $4) || (*@*$* == $4) && (DENY == $3) && (0 == $5) { msg $2 Access Error: $iif($msn.decode($ial(* $+ $6,1).nick) != $null,$msn.decode($ial(* $+ $6,1).nick),$6) Added *!*@*$* DENY | access $2 delete $3 $4 | msg $2 Access Error: Deleted }
  if (*!*@*$* == $4) || (!*@*$* == $4) || (*@*$* == $4) && (GRANT == $3) { msg $2 Access Error: $iif($msn.decode($ial(* $+ $6,1).nick) != $null,$msn.decode($ial(* $+ $6,1).nick),$6) Added $4 $3 | access $2 delete $3 $4 | msg $2 Access Error: Deleted }
  if (*!*@*$* isin $4) || (!*@*$* isin $4) || (*@*$* == $4) && (OWNER == $3) { msg $2 Access Error: $iif($msn.decode($ial(* $+ $6,1).nick) != $null,$msn.decode($ial(* $+ $6,1).nick),$6) Added $4 $3 | access $2 delete $3 $4 | msg $2 Access Error: Deleted }
  if (*!*@*$* isin $4) || (!*@*$* isin $4) || (*@*$* == $4) && (HOST == $3) { msg $2 Access Error: $iif($msn.decode($ial(* $+ $6,1).nick) != $null,$msn.decode($ial(* $+ $6,1).nick),$6) Added $4 $3 | access $2 delete $3 $4 | msg $2 Access Error: Deleted }
  if (*!*@*$* isin $4) || (!*@*$* isin $4) || (*@*$* == $4) && (VOICE == $3) { msg $2 Access Error: $iif($msn.decode($ial(* $+ $6,1).nick) != $null,$msn.decode($ial(* $+ $6,1).nick),$6) Added $4 $3 | access $2 delete $3 $4 | msg $2 Access Error: Deleted }
  haltdef
}
alias masscheck {
  var %a 1
  while (%a <= $scid(0)) {
    scon %a
    var %b 1
    while (%b <= $chan(0)) {
      if ($me isowner $chan(%b)) { access $chan(%b) }
      inc %b
    }
    inc %a
  }
}

 

;should work for any con, just change the $decodealiashere to ur decode alias
on *:OWNER:*: { 
  if ($opnick == $me) {
    .timercheck 0 10 masscheck
  }
}
raw 804:*: {
  if (*!*@*$* == $4) || (!*@*$* == $4) || (*@*$* == $4) && (DENY == $3) && (0 == $5) { msg $2 Access Error: $iif($decodealiashere($ial(* $+ $6,1).nick) != $null,$decodealiashere($ial(* $+ $6,1).nick),$6) Added *!*@*$* DENY | access $2 delete $3 $4 | msg $2 Access Error: Deleted }
  if (*!*@*$* == $4) || (!*@*$* == $4) || (*@*$* == $4) && (GRANT == $3) { msg $2 Access Error: $iif($decodealiashere($ial(* $+ $6,1).nick) != $null,$decodealiashere($ial(* $+ $6,1).nick),$6) Added $4 $3 | access $2 delete $3 $4 | msg $2 Access Error: Deleted }
  if (*!*@*$* isin $4) || (!*@*$* isin $4) || (*@*$* == $4) && (OWNER == $3) { msg $2 Access Error: $iif($decodealiashere($ial(* $+ $6,1).nick) != $null,$decodealiashere($ial(* $+ $6,1).nick),$6) Added $4 $3 | access $2 delete $3 $4 | msg $2 Access Error: Deleted }
  if (*!*@*$* isin $4) || (!*@*$* isin $4) || (*@*$* == $4) && (HOST == $3) { msg $2 Access Error: $iif($decodealiashere($ial(* $+ $6,1).nick) != $null,$decodealiashere($ial(* $+ $6,1).nick),$6) Added $4 $3 | access $2 delete $3 $4 | msg $2 Access Error: Deleted }
  if (*!*@*$* isin $4) || (!*@*$* isin $4) || (*@*$* == $4) && (VOICE == $3) { msg $2 Access Error: $iif($decodealiashere($ial(* $+ $6,1).nick) != $null,$decodealiashere($ial(* $+ $6,1).nick),$6) Added $4 $3 | access $2 delete $3 $4 | msg $2 Access Error: Deleted }
  haltdef
}
alias masscheck {
  var %a 1
  while (%a <= $chan(0)) {
    if ($me isowner $chan(%x)) { access $chan(%a) }
    inc %a
  }
}