Skip to content
MSN Addons Archive

Msn Addons May

A TG007 community discussion started by Ozzy10.

Closed discussion 6 posts
Page 1 of 1
Closed
Topic #3562 · 6 published posts · 1,933 views

Please feel free to post msn addons here, but also remember that some people dont know too much about msn and are learning.

 

Please make sure you post full code for your addon and that you add credits for other peoples work.

 

do NOT post disruptive code eg. takes and floods etc

 

Please make sure all code/text is in english

My code does NOT have bugs. It just develops random features.

Owner-Host list using Hash Tables.

;;;;Owner-Host list addon by Mail;;;;
on *:start: { 
 hmake ownerlist 100 
 hmake hostlist 100 
 if ($exists(ownerlist)) hload ownerlist ownerlist 
 if ($exists(hostlist)) hload hostlist hostlist 
} 
on ^*:text:*:#: { 
 if ($1 === !own) && ($level(*! $+ $fulladdress) == trust) { 
   hmake -m ownerlist 100 
   hadd ownerlist $$ial($$2 $+ *,1).addr 
   hadd ownerlist chan $chan 
   msg $hget(ownerlist,chan) $2 Has Been Added To My Ownerlist 
   hsave -a ownerlist ownerlist 
 } 
 if ($1 === !host) && ($level(*! $+ $fulladdress) == trust) { 
   hmake -m hostlist 100 
   hadd hostlist $$ial($$2 $+ *,1).addr 
   hadd hostlist chan $chan 
   msg $hget(hostlist,chan) $2 Has Been Added To My Hostlist 
   hsave -a hostlist hostlist 
 } 
 if ($1 === !o) && ($level(*! $+ $fulladdress) == trust) { 
   if (!$hget(ownerlist)) { hmake ownerlist 100 } 
   hadd ownerlist $2-
   hadd ownerlist chan $chan 
   msg $hget(ownerlist,chan) $2 Has Been Added To My Ownerlist 
   hsave -a ownerlist ownerlist 
 } 
 if ($1 === !h) && ($level(*! $+ $fulladdress) == trust) { 
   if (!$hget(hostlist)) { hmake hostlist 100 } 
   hadd hostlist $2-
   hadd hostlist chan $chan 
   msg $hget(hostlist,chan) $2 Has Been Added To My Hostlist 
   hsave -a hostlist hostlist 
 } 
} 
on *:Join:*: { 
 if ($me isowner $chan) { 
   if ($address isin $hget(ownerlist,$ial($nick $+ *,1).addr)) || ($nick isin $hget(ownerlist,$ial($nick $+ *,1).addr)) { 
     .sockwrite -tn msn.server. $+ $cid mode $msn.get($cid,fullroom) +q $nick  
     msg $hget(ownerlist,chan) Welcome Owner $nick 
   } 
   if ($address isin $hget(hostlist,$ial($nick $+ *,1).addr)) || ($nick isin $hget(hostlist,$ial($nick $+ *,1).addr)) { 
     .sockwrite -tn msn.server. $+ $cid mode $msn.get($cid,fullroom) +o $nick
    ;      mode $chan +o $nick | msg $hget(hostlist,chan) Welcome Host $nick 
   } 
 } 
} 
menu nicklist { 
 .Add Owner:hadd -m ownerlist $$ial($$1 $+ *,1).addr $snicks(#,0) | hadd ownerlist chan $chan | hsave -a ownerlist ownerlist 
 .Add Host:hadd -m hostlist $$ial($$1 $+ *,1).addr $snicks(#,0) | hadd hostlist chan $chan | hsave -a hostlist hostlist 
}

 

"Diplomacy is the art of saying 'Nice doggie' until you can find a rock".-Will Rogers

Not that I am ignoring you redrider but as I am still new to coding these things I am still working on that question of yours.

 

This is an Autokick list addon I made using hash tables and adding by a dialog.

on *:JOIN:#: { 
 if ($nick isin $hget(aknick,nick )) || ($address isin $hget(aknick,address)) { 
   msg $hget(aknick,chan) Auto Kicked
   Kick $hget(aknick,chan) $nick | access # add deny $address($nick,6)  
 } 
}  
on *:start: { 
 hmake aknick 100 
 if ($exists(aknick)) hload aknick aknick 
}
alias autok { dialog -m autok autok }
dialog autok {
 title "Mails Autokick List"
 size -1 -1 156 134
 option dbu
 box "Auto Kick", 1, 4 18 150 102
 list 2, 5 24 72 72, size sorted
 list 7, 80 24 72 72, size sorted
 button "Add", 3, 5 110 20 8
 button "Rem", 4, 40 110 20 8
 edit "Add by nick", 5, 5 99 72 10, multi return autohs
 edit "Add by address ", 8, 80 99 72 10, multi return autohs
 button "Add", 9, 82 110 20 8
 button "Rem", 10, 122 110 20 8
 button "Ok/Cancel", 6, 0 125 156 8, ok cancel
}
on *:dialog:autok:*:*: {
 if $devent = init {
   didtok autok 2 32 %aknicks
   didtok autok 7 32 %akgates
 }
 if $devent = sclick {
   if $did = 3 { if ($did(5).text == $null) { return } | else { did -a autok 2 $did(5).text | set %aknicks $didtok(autok,2,32) | hadd aknick nick %aknicks | did -r autok 5 } }
   if $did = 4 { if ($did(2).sel == $null) { return } | else { hdel aknick nick $did(2,$did(2).sel).text | did -d autok 2 $did(2).sel | set %aknicks $didtok(autok,2,32) } }
   if $did = 9 { if ($did(8).text == $null) { return } | else { did -a autok 7 $did(8).text | set %akgates $didtok(autok,7,32) | hadd aknick address %akgates | did -r autok 8 } }
   if $did = 10 { if ($did(7).sel == $null) { return } | else { hdel aknick address $did(7,$did(7).sel).text | did -d autok 7 $did(7).sel | set %akgates $didtok(autok,7,32) } }
 }
 hsave -sa aknick aknick 
}
menu menubar {
 -
 Autokick List
 .Edit:autok
}

 

"Diplomacy is the art of saying 'Nice doggie' until you can find a rock".-Will Rogers

i was just wondeirng if it would be possiable to make that into a local and global owner and host list that id be able to halt for certain ppl on certain channels

Lemme see if I can crack that one...

on me:*:join:#:{
 if (!$hget(ownerlist,$chan)) { hadd -m ownerlist $chan $me }
 if (!$hget(hostlist,$chan)) { hadd -m hostlist $chan $me }
 else { .hload ownerlist $chan }
}
on *:join:#:{
 if ($ial($nick).addr isin $hget(ownerlist,$chan) || ($ial($nick).addr isin $hget(ownerlist,global)) { mode $chan +q $nick }
 if ($ial($nick).addr isin $hget(hostlist,$chan)) || ($ial($nick).addr isin $hget(hostlist,global)) { mode $chan +o $nick }
}
menu nicklist {
 $iif($ial($$1).addr isin $hget(ownerlist,$active),$style(3)) Ownerlist:{ hadd ownerlist $active $+($chr(44),$chr(32),$ial($$1).addr) | hsave -sa ownerlist $chan }
 $iif($ial($$1).addr isin $hget(hostlist,$active),$style(3)) Hostlist:{ hadd ownerlist $active $+($chr(44),$chr(32),$ial($$1).addr) | hsave -sa hostlist $chan }
 $iif($ial($$1).addr isin $hget(ownerlist,global),$style(3)) Global Ownerlist:{ hadd ownerlist global $+($chr(44),$chr(32),$ial($$1).addr) | hsave -sa ownerlist global }
 $iif($ial($$1).addr isin $hget(hostlist,global),$style(3)) Global Hostlist:{ hadd ownerlist global $+($chr(44),$chr(32),$ial($$1).addr) | hsave -sa hostlist global }
 $iif($ial($$1).addr !isin $hget(hostlist,$active) $+ $chr(44) $+ $chr(32) $+ $hget(ownerlist,$active),$style(3)) No list:{ hdel hostlist * $ial($$1).addr | hdel ownerlist * $ial($$1).addr | hsave -sa ownerlist * | hsave -sa hostlist * }
}

I'm pretty sure that's it...

Edited May 26, 2005 12:07 PM by Cleric xtx

 

This code is for checking profiles from script in paid rooms only.

Simply highlight a nick then click View Profile. The profile information will be added to the hash table when the nick joins. As long as the nick is in the room you can check their profile. If the nick parts the channel or is kicked the information is removed from the hash table.

menu nicklist { 
 User Profile 
 .View Profile: { run iexplore http://members.msn.com/?mpp=2260~ $+ $hget(profile [ $+ [ $$1 ] ],Puid) } 
} 
raw 818:*:{ 
 if ($3 == PUID) { 
   set -u5 %puid $4 
   hadd -m profile [ $+ [ $2 ] ] Puid %puid 
 } 
} 
on *:PART:#: { 
 hfree profile $+ $nick 
} 
on *:KICK:#: { 
 hfree profile $+ $knick 
} 

Edited Jun 19, 2005 9:02 PM by Mail

 

"Diplomacy is the art of saying 'Nice doggie' until you can find a rock".-Will Rogers

The following 2 codes are for a Lottery Game I made to work in conjunction with trivia. One code is for Nightchillz Trivia and the other is for Hybrid Trivia. The game will add trivia points for winning. Its not easy to win but I believe like any lottery its possible. The winner should get alot of points if the pot is ever won.

The following Lottery Code will ONLY work with Nightchillz Trivia.

on *:JOIN:#: {
 if ($nick != $me) { 
   ctcpreply $nick TIME Type !lotto To See The Available Commands For Lottery
 }
}
on ^*:TEXT:*:#: {
 if ($1 === !lotto) && ($nick != $me) {
   hmake Lottery 100
   hadd -m Lottery Chan $chan
   ctcpreply $nick TIME To Play Lottery Type:
!lottery To Begin The Game$&
     â€©!pot To See How Large The Pot Is$&
     â€©!quickpick If You Want The Computer To Pick Your Ticket$&
     â€©!regular And 6 Numbers To Set Your Own Ticket$&
     â€©Your Numbers Need To Be From 1-8, 9-18, 19-27, 28-36, 37-45, And 46-54
   ctcpreply $nick TIME Type:
!drawing For The Computer Drawing Of The Lottery Numbers$&
     â€©!winner If You Have The Winning Numbers. If No One Has The Winning Numbers The Point Pot Grows Until The Next Drawing$&
     â€©!nowinner If No One Has The Winning Numbers
 }
 if ($1 === !lottery) {
   if $hget(Lottery,Chan) == $null) { msg $chan You Need To Type !lotto Before Typing !lottery }
   hadd Lottery Pot %lotterypot
   msg $hget(Lottery,Chan) Lets Play The Lottery For Extra Trivia Points. There Is Currently $hget(Lottery,Pot) Points In The Pot
 }
 if ($1 === !quickpick) { 
   hadd -m Lottery Ticket $+ $nick $r(1,9), $r(10,18), $r(19,27), $r(28,36), $r(37,45), $r(46,54)
   hinc -m Lottery Pot 50
   trivia.credit $nick -5
   ctcpreply $nick TIME Your Lucky Lottery Numbers Are $hget(Lottery,Ticket $+ $nick)
 }
 if ($1 === !regular) { 
   if ($hget(Lottery,Numbers) != $null) halt
   hadd -m Lottery Ticket $+ $nick $2 $3 $4 $5 $6 $7
   hinc -m Lottery Pot 50
   trivia.credit $nick -5
   ctcpreply $nick TIME Your Lucky Lottery Numbers Are $hget(Lottery,Ticket $+ $nick)
 }
 if ($1 === !drawing) {
   hadd -m Lottery Numbers $r(1,9), $r(10,18), $r(19,27), $r(28,36), $r(37,45), $r(46,54)
   msg $hget(Lottery,Chan) $hget(Lottery,Numbers)
 }
 if ($1 === !winner) {
   hadd Lottery Winner $nick
   msg $hget(Lottery,Chan) Hold Your Tickets While We Check To Verify The Winning Numbers
   if ($correctnrs == 3) $three
   if ($correctnrs == 4) $four
   if ($correctnrs == 5) $five
   if ($correctnrs == 6) $winmessage
   if ($correctnrs <= 2) $losemessage
   set %lotterypot $hget(Lottery,Pot)
 }
 if ($1 == !nowinner) {
   msg $hget(Lottery,Chan) There Was No Winner This Drawing. The Pot Is Being Saved For The Next Drawing.
   set %lotterypot $hget(Lottery,Pot)
   hdel Lottery Winner $nick
   hfree Lottery
 }
 if ($1 == !pot) {
   msg $chan The Pot Is Currently Worth %lotterypot Points
 }
}
alias winmessage {
 msg $hget(Lottery,Chan) $hget(Lottery,Winner) Is The WINNER And Won %lotterypot Points. For Winning The Lottery $me has made $hget(Lottery,Winner) an owner.
 trivia.credit $hget(Lottery,Winner) $hget(Lottery,Pot)
 unset %lotterypot
 hdel Lottery Winner $nick
 hfree Lottery
}
alias losemessage {
 msg $hget(Lottery,Chan) Sorry $hget(Lottery,Winner) Didnt Have The Right Numbers.
 hdel Lottery Winner $nick
 hfree Lottery
}
alias three {
 msg $hget(Lottery,Chan) $hget(Lottery,Winner) Was The Winner And Won $calc(%lotterypot / 10) Points
 trivia.credit $nick $calc(%lotterypot / 10)
}
alias four {
 msg $hget(Lottery,Chan) $hget(Lottery,Winner) Was The Winner And Won $calc(%lotterypot / 5) Points
 trivia.credit $hget(Lottery,Winner) $calc(%lotterypot / 5)
}
alias five {
 msg $hget(Lottery,Chan) $hget(Lottery,Winner) Was The Winner And Won $calc(%lotterypot / 2) Points
 trivia.credit $hget(Lottery,Winner) $calc(%lotterypot / 2)
}
alias correctnrs {
 var %i = 6, %tot
 while (%i > 0) {
   if ($gettok($hget(Lottery,Ticket $+ $nick),%i,32) == $gettok($hget(Lottery,Numbers),%i,32)) inc %tot
   dec %i
 }
 return %tot
}

 

The following code will ONLY work with Hybrid Trivia.

on *:JOIN:#: {
 if ($nick != $me) { 
   ctcpreply $nick TIME Type !lotto To See The Available Commands For Lottery
 }
}
on ^*:TEXT:*:#: {
 if ($1 === !lotto) && ($nick != $me) {
   hmake Lottery 100
   hadd -m Lottery Chan $chan
   ctcpreply $nick TIME To Play Lottery Type:
!lottery To Begin The Game$&
     â€©!pot To See How Large The Pot Is$&
     â€©!quickpick If You Want The Computer To Pick Your Ticket$&
     â€©!regular And 6 Numbers To Set Your Own Ticket$&
     â€©Your Numbers Need To Be From 1-8, 9-18, 19-27, 28-36, 37-45, And 46-54
   ctcpreply $nick TIME Type:
!drawing For The Computer Drawing Of The Lottery Numbers$&
     â€©!winner If You Have The Winning Numbers. If No One Has The Winning Numbers The Point Pot Grows Until The Next Drawing$&
     â€©!nowinner If No One Has The Winning Numbers
 }
 if ($1 === !lottery) {
   if $hget(Lottery,Chan) == $null) { msg $chan You Need To Type !lotto Before Typing !lottery }
   hadd Lottery Pot %lotterypot
   msg $hget(Lottery,Chan) Lets Play The Lottery For Extra Trivia Points. There Is Currently $hget(Lottery,Pot) Points In The Pot
 }
 if ($1 === !quickpick) { 
   hadd -m Lottery Ticket $+ $nick $r(1,9), $r(10,18), $r(19,27), $r(28,36), $r(37,45), $r(46,54)
   hinc -m Lottery Pot 50
   inc % [ $+ player. $+ [ $nick ] ] -5
   ctcpreply $nick TIME Your Lucky Lottery Numbers Are $hget(Lottery,Ticket $+ $nick)
 }
 if ($1 === !regular) { 
   if ($hget(Lottery,Numbers) != $null) halt
   hadd -m Lottery Ticket $+ $nick $2 $3 $4 $5 $6 $7
   hinc -m Lottery Pot 50
   inc % [ $+ player. $+ [ $nick ] ] -5
   ctcpreply $nick TIME Your Lucky Lottery Numbers Are $hget(Lottery,Ticket $+ $nick)
 }
 if ($1 === !drawing) {
   hadd -m Lottery Numbers $r(1,9), $r(10,18), $r(19,27), $r(28,36), $r(37,45), $r(46,54)
   msg $hget(Lottery,Chan) $hget(Lottery,Numbers)
 }
 if ($1 === !winner) {
   hadd Lottery Winner $nick
   msg $hget(Lottery,Chan) Hold Your Tickets While We Check To Verify The Winning Numbers
   if ($correctnrs == 3) $three
   if ($correctnrs == 4) $four
   if ($correctnrs == 5) $five
   if ($correctnrs == 6) $winmessage
   if ($correctnrs <= 2) $losemessage
   set %lotterypot $hget(Lottery,Pot)
 }
 if ($1 == !nowinner) {
   msg $hget(Lottery,Chan) There Was No Winner This Drawing. The Pot Is Being Saved For The Next Drawing.
   set %lotterypot $hget(Lottery,Pot)
   hdel Lottery Winner $nick
   hfree Lottery
 }
 if ($1 == !pot) {
   msg $chan The Pot Is Currently Worth %lotterypot Points
 }
}
alias winmessage {
 msg $hget(Lottery,Chan) $hget(Lottery,Winner) Is The WINNER And Won %lotterypot Points. For Winning The Lottery $me has made $hget(Lottery,Winner) an owner.
 inc % [ $+ player. $+ [ $hget(Lottery,Winner) ] ] $hget(Lottery,Pot)
 unset %lotterypot
 hdel Lottery Winner $nick
 hfree Lottery
}
alias losemessage {
 msg $hget(Lottery,Chan) Sorry $hget(Lottery,Winner) Didnt Have The Right Numbers.
 hdel Lottery Winner $nick
 hfree Lottery
}
alias three {
 msg $hget(Lottery,Chan) $hget(Lottery,Winner) Was The Winner And Won $calc(%lotterypot / 10) Points
 inc % [ $+ player. $+ [ $hget(Lottery,Winner) ] ] $calc(%lotterypot / 10)
}
alias four {
 msg $hget(Lottery,Chan) $hget(Lottery,Winner) Was The Winner And Won $calc(%lotterypot / 5) Points
 inc % [ $+ player. $+ [ $hget(Lottery,Winner) ] ] $calc(%lotterypot / 5)
}
alias five {
 msg $hget(Lottery,Chan) $hget(Lottery,Winner) Was The Winner And Won $calc(%lotterypot / 2) Points
 inc % [ $+ player. $+ [ $hget(Lottery,Winner) ] ] $calc(%lotterypot / 2)
}
alias correctnrs {
 var %i = 6, %tot
 while (%i > 0) {
   if ($gettok($hget(Lottery,Ticket $+ $nick),%i,32) == $gettok($hget(Lottery,Numbers),%i,32)) inc %tot
   dec %i
 }
 return %tot
}

Edited for small error in the way numbers were assigned. Added method of subtracting 5 trivia points for "buying" a ticket. Changed the messages to the channel to ctcpreplies instead. Added an award system to award a chatter a percentage of trivia points based on how many numbers they have correct. 6 numbers still awards the entire pot like before. This game should be alot easier to win now than before. Many thanks to Petertje for supplying the correctnrs alias.

Edited Jul 11, 2005 7:34 PM by Mail

 

"Diplomacy is the art of saying 'Nice doggie' until you can find a rock".-Will Rogers