Skip to content
MSN Addons Archive

Msn Addons January

A TG007 community discussion started by Ozzy10.

Closed discussion 4 posts
Page 1 of 1
Closed
Topic #2421 · 4 published posts · 1,428 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

 

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

to know how this works, type /help $timer first and read the $timer section. Then read the info provided here. This is basically a wildcard version of $timer.

 

;Code by The Gate Keeper
;$wtimer(<wildcard>[,N])
;<wildcard> only supports names, not numbers, so if you put a number, it will still think it's a name
;Properties: com, time, reps, delay, type, secs, mmt, anysc, wid, cid, hwnd
;properties are the same as timer properties
;N = optional, if not given, asumed to be 1

;begining of code
alias wtimer { 
 var %x = 1 , %y = 1 , %z = $iif(($2 isnum) && ($2 != 0),$2,1)
 while ($timer(%x)) { 
   if ($1 iswm $timer(%x)) { 
     if (%y == %z) {
       if ($prop == com) return $timer(%x).com
       elseif ($prop == time) return $timer(%x).time
       elseif ($prop == reps) return $timer(%x).reps
       elseif ($prop == delay) return $timer(%x).delay
       elseif ($prop == type) return $timer(%x).type
       elseif ($prop == secs) return $timer(%x).sexs
       elseif ($prop == mmt) return $timer(%x).mmt
       elseif ($prop == anysc) return $timer(%x).wid
       elseif ($prop == cid) return $timer(%x).cid
       elseif ($prop == hwnd) return $timer(%x).hwnd
       else return $timer(%x) 
       return
     }
     inc %y
   }
   inc %x 
 }
}
;end of code

This is a vote kicker for rooms that you own and are not always in. It can be useful for when people whisper all of the voiced people in the room, annoying them.

It's currently untested but it should work fine.

on *:text:!vote*:#:{
 if ($2 !isin kick,ban,yes,no) || (($3) && (!$ial(* $+ $3 $+ *).nick)) {
   msg $chan The voting commands are: !vote kick nick & !vote ban nick
 }
 if ($ial(* $+ $3 $+ *).nick isop $chan) { msg $chan No votes allowed regarding hosts }
 if ($2 isin kick,ban) {
   if (%votekick) { msg $chan A vote is currently in progress. Please wait for it to end. }
   set %votekick $2 $ial(* $+ $3 $+ *).nick
   set %voteyes 1 | set %voteno 0 | set %voted $nick
   .timervote 1 60 $votekick($chan)
 }
 if ($2 == yes) && (%votekick) { set %voted %voted $+ , $+ $nick | inc %voteyes }
 if ($2 == no) && (%votekick) { set %voted %voted $+ , $+ $nick | inc %voteno }
}
alias -l votekick {
 msg $1 The results for $gettok(%votekick,2,32) are - yes: %voteyes & no: %voteno
 if (%voteyes > %voteno) {
   kick $1 $gettok(%votekick,2,32) Voted kick
   $$iif($gettok(%votekick,1,32) == ban,access $1 add deny $ial($gettok(%votekick,2,32).addr))
 }
 if (%voteno > %voteyes) { msg $1 $gettok(%votekick,2,32) will not be kicked. }
 if (%voteyes == %voteno) { msg $1 It is a tie. Therefore $gettok(%votekick,2,32) will not be kicked. }
 unset %vote*
}

Known issues:

1. It doesn't have a minimum vote count so someone could win a vote with 1 vote.

2. The person being voted on can vote.

3. You can do the same vote again directly afterwards.

 

1. You can just add the following to the second line of the alias:

if ($calc(%voteyes + %voteno) <= 4) { msg $1 There are not enough votes. | halt }

 

2. Replace set %voted $nick with this:

set %votek $nick $+ , $+ $ial(* $+ $3 $+ *).nick

 

3. Add an extra variable that unsets after a certain amount of time or when you/the person leave(s) the room. Couldn't really be bothered with that one.

 

Ps: I reckon Ozzy should have something along those lines for the gorup chat as people often advertise using invite or other disruptive means. Either that or employ hosts.

 

i have got something like it , but idiots come in and abuse it all time

I tried it about 6 months ago in tg room

oh and mine uses a hash table instead of vars

Edited Jan 28, 2005 3:23 PM by OZZY_10â„¢

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