Vote system

By SeiferAlmasy on Mar 26, 2004

Vote system

alias vote.system { dialog -m vote.system vote.system }

dialog vote.system {
  title "Vote System"
  size -1 -1 140 61
  option dbu
  text "Question:", 1, 8 7 25 8
  edit "", 2, 32 6 104 10
  text "Channel:", 3, -31 15 25 8
  edit "", 4, 32 26 104 10
  edit "", 5, 32 36 104 10
  text "Time (Secs):", 6, 2 37 30 8
  text "Channel:", 7, 10 27 22 8
  button "Start", 8, 12 48 37 12, ok
  button "Stop", 9, 90 48 37 12, cancel
  edit "!yes", 10, 32 16 48 10
  text "Triggers:", 11, 8 17 22 8
  edit "!no", 12, 89 16 47 10
}

on *:dialog:vote.system:init:0:{
  setmdx
  mdx SetDialog $dname style 0 title
  mdx SetFont $dname 5 ANSI 13 700 Tahoma
}

on *:dialog:vote.system:sclick:8: {
  if ($did(2).text != $null) && ($did(4).text != $null) && ($did(5).text isnum) { /set %vote.system.question $did(2).text | /set %vote.system.trigger1 $did(10).text | /set %vote.system.trigger2 $did(12).text | /set %vote.system.channel $did(4).text | /set %vote.system.time $did(5).text | /msg %vote.system.channel Vote System | /msg %vote.system.channel Question: %vote.system.question | /msg %vote.system.channel Type:  %vote.system.trigger1  Or  %vote.system.trigger2  | .timervote.system 1 %vote.system.time vote.system.results } | else { return }
}

on *:dialog:vote.system:sclick:9: { 
if ($did(2).text != $null) && ($did(4).text != $null) && ($did(5).text isnum) { //msg %vote.system.channel Vote System Stoped | /unset %vote.system.question | /unset %vote.system.channel | /unset %vote.system.time | unset %vote.system.triggerresult1 | unset %vote.system.triggerresult2 | unset %vote.system.* | .timervote.system off } }

alias -l vote.system.results {
  msg %vote.system.channel Vote System 
  msg %vote.system.channel Results: 
  msg %vote.system.channel Question: %vote.system.question 
  msg %vote.system.channel Yes: %vote.system.triggerresult1 
  msg %vote.system.channel No: %vote.system.triggerresult2 
  unset %vote.system.question
  unset %vote.system.channel
  unset %vote.system.time
  unset %vote.system.triggerresult1
  unset %vote.system.triggerresult2
  unset %vote.system.*  
}

alias -l percent return $round($calc(($1 / $2) * 100),$iif($3,$3,2))

on *:text:%vote.system.trigger1:%vote.system.channel: { 
  if (%vote.system. [ $+ [ $nick ] ] == $null) { set %vote.system. $+ $nick %vote.system.triggerresult1 | inc %vote.system.triggerresult1 | .notice $nick Vote System <<!>> Your Vote has been Added <<!>> | halt } | else { .notice $nick Vote System <<!>> You already Voted <<!>> | halt } 
}

on *:text:%vote.system.trigger2:%vote.system.channel: {
  if (%vote.system. [ $+ [ $nick ] ] == $null) { set %vote.system. $+ $nick %vote.system.triggerresult2 | inc %vote.system.triggerresult2 | .notice $nick Vote System <<!>> Your Vote has been Added <<!>> | halt } | else { .notice $nick Vote System <<!>> You already Voted <<!>> | halt } 
}

menu channel {
  Vote System: vote.system
}

Comments

Sign in to comment.
mikeszewil   -  Dec 19, 2004

How to activate it?

 Respond  
SeiferAlmasy   -  May 25, 2004

TeQh, you need MDX.dll ;)

 Respond  
Marius_Craciunoiu   -  May 09, 2004

It`s good, but, only 1 prob, i voted 2 times (with only one user ), check that out

 Respond  
Sk8erh4x0r   -  May 08, 2004

It works for me. I\'m on a windows XP. Nice script. :)

 Respond  
TeQh   -  Apr 07, 2004

is it just me, or does this script cause mirc to give you read errors on winxp?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.