::: votetrak - vote script by suicide (suicide@vnet.net) ::: - with some help by IceBreak (ice_break@hotmail.com) ::: code rips = me ripping your balls off, capish? :: internal assigns @ clr = [] @ vstr = [\(v\)ote${clr}\(t${clr}\)rak${clr}] @ vstr2 = [ù\(vt\)ù] @ vver = [0.4á] @ voters = [] @ yvote = 0 @ nvote = 0 @ avote = 0 @ bvote = 0 @ cvote = 0 @ dvote = 0 @ votetype = 0 @ toptxt = [] @ topmult = [] :: version settings if ([$votetrak()]!=[1]) {^do set client_information $client_information & $vstr $vver\} :: aliases alias vecho echo $vstr2 $* alias votetrak @ function_return = 1 alias vote if ([$0]) { if ([$0]==[add]) {vote.addtop $1-} if ([$0]==[addm]) {vote.addmult $1-} if ([$0]==[show]) {vote.showvote $1-} if ([$0]==[showm]) {vote.showmult $1-} if ([$0]==[tally]) {vote.tally $1-} if ([$0]==[close]) {vote.close $1-} }{ vote.vhelp } alias vote.addtop if ([$0]) { if ([$toptxt]==[]) { @ toptxt = [$0-] @ voting = [on] @ votetype = 1 vecho adding vote topic for $C\ vecho type /showvote to show your channel the topic.. }{ vecho you already have a vote open, close this one first.. } }{vecho you must include the topic you want to add..;vecho i.e.: /addtop is $N the man?} alias vote.addmult { if ([$topmult]==[]) { @ votetype = 2 input "enter topic: " if ([$0]) {@ topmult = [$0-]} input "enter choice (A): " if ([$0]) {@ choicea = [$0-]} input "enter choice (B): " if ([$0]) {@ choiceb = [$0-]} input "enter choice (C): " if ([$0]) {@ choicec = [$0-]} input "enter choice (D): " if ([$0]) {@ choiced = [$0-]} @ voting = [on] vecho added multiple choice question for $C\.. vecho type /showmult to show your channel the topic... }{ vecho you already have a vote open, close this one first.. } } alias vote.showmult if ([$voting]==[on]&&[$votetype]==[2]) { send .--[vote added for $[10]C${clr}]--- ------ --- :: - send | %% topic${clr}: $topmult send : %% (A) $choicea send : %% (B) $choiceb send : %% (C) $choicec send | %% (D) $choiced if ([$0]) { @ tmr = [${[$0]*60}] timer $tmr vote.close send `--[/msg $N\ vote A or /msg $N\ vote B, etc]-[$0\ min(s)]-- vecho auto-closing vote after $0 mins }{ send `--[/msg $N\ vote A or /msg $N\ vote B, etc]--- - :: - vecho auto-closing is off, you must type /close to end the vote. } }{ vecho you don't have a topic created yet.. } alias vote.showvote if ([$voting]==[on]&&[$votetype]==[1]) { send .--[vote added for $[10]C${clr}]--- ------ --- :: - send | %% topic${clr}: $toptxt if ([$0]) { @ tmr = [${[$0]*60}] timer $tmr vote.close send `--[/msg $N\ vote yes or /msg $N\ vote no]-[$0\ min(s)]-- vecho auto-closing vote after $0 mins }{ send `--[/msg $N\ vote yes or /msg $N\ vote no]--- - :: - vecho auto-closing is off, you must type /close to end the vote. } }{ vecho you don't have a topic created yet.. } alias vote.close if ([$voting]==[on]) { @ voters = [] vecho voting is now closed.. vecho to show your channel the voting results, type /tally send .--[vote now closed.. thanks for voting]--- ------- --- :: - - send `--[please wait for a final tally on the voting]-- ----- -- - :: - - }{ vecho you don't have a topic created yet.. } alias vote.tally if ([$voting]==[on]) { switch ($votetype) { (1) { @ voting = [off] @ totvotes = nvote+yvote @ percy = ((yvote * 1000) / totvotes) / 10 @ percn = ((nvote * 1000) / totvotes) / 10 vecho showing $C\ tally of votes... send .--[vote tally for $[10]C\]--- ------- --- :: - - send | %% topic${clr}: $[50]toptxt send : %% total votes${clr}: $[30]totvotes send : %% yes${clr}: $[.30]yvote \(${percy}${clr}%\) send | %% no${clr}: $[.30]nvote \(${percn}\${clr}%\) send `--[these are the final results of voting]-- ----- -- - :: - - @ toptxt = [] @ yvote = 0 @ nvote = 0 } (2) { @ voting = [off] @ totvotes = avote+bvote+cvote+dvote @ perca = ((avote * 1000) / totvotes) / 10 @ percb = ((bvote * 1000) / totvotes) / 10 @ percc = ((cvote * 1000) / totvotes) / 10 @ percd = ((dvote * 1000) / totvotes) / 10 vecho showing $C\ tally of votes... send .--[vote tally for $[10]C\]--- ------- --- :: - - send | %% topic${clr}: $[50]topmult send : %% total votes${clr}: $[3]totvotes send : %% A${clr} \(${clr}$[13]choicea\\)${clr}: $[3]avote \($[-3]perca\${clr}%\) send : %% B${clr} \(${clr}$[13]choiceb\\)${clr}: $[3]bvote \($[-3]percb\${clr}%\) send : %% C${clr} \(${clr}$[13]choicec\\)${clr}: $[3]cvote \($[-3]percc\${clr}%\) send | %% D${clr} \(${clr}$[13]choiced\\)${clr}: $[3]dvote \($[-3]percd\${clr}%\) send `--[these are the final results of voting]-- ----- -- - :: - - @ avote = 0;@ bvote = 0;@ cvote = 0;@ dvote = 0 @ topmult = [] } } }{ vecho you don't have a topic created yet.. } alias voted if ([$0]) { @ vote = 0 fe ($voters) x { if ([$x]==[$0]) {@ vote = 1} } @ function_return = vote } alias vote.vhelp { echo .-[Voting Help]-------------------------------- echo | /vote add | Add a voting topic echo | /vote addm | Add a multiple choice topic echo | /vote showm | Show multiple choice topic echo | /vote show | Show the vote topic to the channel echo | /vote tally | Show the vote count echo | /vote close | Close the current vote echo `---------------------------------------------- } ^on ^msg "% vote *" if ([$voting]==[on]) { switch ($votetype) { (1) { if ([$voted($gethost($0))]==[0]) { if ([$voters]==[]) {@ voters = [$gethost($0)]}{@ voters = [$voters]##[ ]##[$gethost($0)]} if ([$[1]2]==[Y]) { @ yvote = yvote + 1 vecho $0\ added a yes vote \(total yes = ${yvote}\) //^msg $0 $vstr2 thank you for voting (yes) } if ([$[1]2]==[N]) { @ nvote = nvote + 1 vecho $0\ added a no vote \(total no = ${nvote}\) //^msg $0 $vstr2 thank you for voting (no) } }{ @ sendniq = [$0] eval quote NOTICE $sendniq :you may only vote once.. not registering your vote. vecho $0\ already voted.. not registering their vote.. } } (2) { if ([$voted($gethost($0))]==[0]) { if ([$voters]==[]) {@ voters = [$gethost($0)]}{@ voters = [$voters]##[ ]##[$gethost($0)]} if ([$2]==[A]) { @ avote = avote + 1 vecho $0\ added an A vote \(total A votes = ${avote}\) //^msg $0 $vstr2 thank you for voting (A) } if ([$2]==[B]) { @ bvote = bvote + 1 vecho $0\ added a B vote \(total B votes = ${bvote}\) //^msg $0 $vstr2 thank you for voting (B) } if ([$2]==[C]) { @ cvote = cvote + 1 vecho $0\ added a C vote \(total C votes = ${cvote}\) //^msg $0 $vstr2 thank you for voting (C) } if ([$2]==[D]) { @ dvote = dvote + 1 vecho $0\ added a D vote \(total D votes = ${dvote}\) //^msg $0 $vstr2 thank you for voting (D) } }{ eval quote NOTICE $0 :$vstr2 you may only vote once.. not registering your vote. vecho $0\ already voted.. not registering their vote.. } } } } do vecho loading complete for $vstr $vver\. /VOTE for help. :: eof (end of file for some of you retards out there)