mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 1
B
Mostly harmless
OP Offline
Mostly harmless
B
Joined: Dec 2002
Posts: 1
I am making a voting script. I need this alias to work with this timer...

.timer[2vote4timer] 1 %vote.duration vote.timesup
set %vote.timer $ltimer


Here's the alias that it is supposed to reference...

alias vote.timesup
{
if ($chan(%vote.chan) == $null) { echo 6 -a Voting Booth Closed | echo 4 -a ERROR: Unable to display results! You're not on %vote.chan | goto end }
msg %vote.chan 4Voting Booth Closed
msg %vote.chan 12Topic was: %vote.topic
msg %vote.chan 4,1People who said %vote.choice.A : %vote.choice.A.cntr 2(12 $+ $vote.percent(%vote.choice.A.cntr,%vote.total) $+ 2)
msg %vote.chan 4,1People who said %vote.choice.B : %vote.choice.B.cntr 2(12 $+ $vote.percent(%vote.choice.B.cntr,%vote.total) $+ 2)
if (%vote.choice.C == $null) { goto VBCEND }
msg %vote.chan 4,1People who said %vote.choice.C : %vote.choice.C.cntr 2(12 $+ $vote.percent(%vote.choice.C.cntr,%vote.total) $+ 2)
if (%vote.choice.D == $null) { goto VBCEND }
msg %vote.chan 4,1People who said %vote.choice.D : %vote.choice.D.cntr 2(12 $+ $vote.percent(%vote.choice.D.cntr,%vote.total) $+ 2)
if (%vote.choice.E == $null) { goto VBCEND }
msg %vote.chan 4,1People who said %vote.choice.E : %vote.choice.E.cntr 2(12 $+ $vote.percent(%vote.choice.E.cntr,%vote.total) $+ 2)
if (%vote.choice.F == $null) { goto VBCEND }
msg %vote.chan 4,1People who said %vote.choice.F : %vote.choice.F.cntr 2(12 $+ $vote.percent(%vote.choice.F.cntr,%vote.total) $+ 2)
if (%vote.choice.G == $null) { goto VBCEND }
msg %vote.chan 4,1People who said %vote.choice.G : %vote.choice.G.cntr 2(12 $+ $vote.percent(%vote.choice.G.cntr,%vote.total) $+ 2)
:VBCEND
if (%vote.choice.A.cntr == 0 && %vote.choice.B.cntr == 0 && %vote.choice.C.cntr == 0 && %vote.choice.D.cntr == 0 && %vote.choice.E.cntr == 0 && %vote.choice.F.cntr == 0 && %vote.choice.G.cntr == 0) { msg %vote.chan 5No one voted!}
elseif (%vote.choice.A.cntr == %vote.choice.B.cntr == %vote.choice.C.cntr == %vote.choice.D.cntr == %vote.choice.E.cntr == %vote.choice.F.cntr == %vote.choice.G.cntr) { msg %vote.chan 5It's a Tie! }
elseif (%vote.choice.A.cntr > %vote.choice.B.cntr && %vote.choice.A.cntr > %vote.choice.C.cntr && %vote.choice.A.cntr > %vote.choice.D.cntr && %vote.choice.A.cntr > %vote.choice.E.cntr && %vote.choice.A.cntr > %vote.choice.F.cntr && %vote.choice.A.cntr > %vote.choice.G.cntr) { msg %vote.chan 5The Majority Voted for %vote.choice.A }
elseif (%vote.choice.B.cntr > %vote.choice.A.cntr && %vote.choice.B.cntr > %vote.choice.C.cntr && %vote.choice.B.cntr > %vote.choice.D.cntr && %vote.choice.B.cntr > %vote.choice.E.cntr && %vote.choice.B.cntr > %vote.choice.F.cntr && %vote.choice.B.cntr > %vote.choice.G.cntr) { msg %vote.chan 5The Majority Voted for %vote.choice.B }
elseif (%vote.choice.C.cntr > %vote.choice.A.cntr && %vote.choice.C.cntr > %vote.choice.B.cntr && %vote.choice.C.cntr > %vote.choice.D.cntr && %vote.choice.C.cntr > %vote.choice.E.cntr && %vote.choice.C.cntr > %vote.choice.F.cntr && %vote.choice.C.cntr > %vote.choice.G.cntr) { msg %vote.chan 5The Majority Voted for %vote.choice.C }
elseif (%vote.choice.D.cntr > %vote.choice.A.cntr && %vote.choice.D.cntr > %vote.choice.B.cntr && %vote.choice.D.cntr > %vote.choice.C.cntr && %vote.choice.D.cntr > %vote.choice.E.cntr && %vote.choice.D.cntr > %vote.choice.F.cntr && %vote.choice.D.cntr > %vote.choice.G.cntr) { msg %vote.chan 5The Majority Voted for %vote.choice.D }
elseif (%vote.choice.E.cntr > %vote.choice.A.cntr && %vote.choice.E.cntr > %vote.choice.B.cntr && %vote.choice.E.cntr > %vote.choice.C.cntr && %vote.choice.E.cntr > %vote.choice.D.cntr && %vote.choice.E.cntr > %vote.choice.F.cntr && %vote.choice.E.cntr > %vote.choice.G.cntr) { msg %vote.chan 5The Majority Voted for %vote.choice.E }
elseif (%vote.choice.F.cntr > %vote.choice.A.cntr && %vote.choice.F.cntr > %vote.choice.B.cntr && %vote.choice.F.cntr > %vote.choice.C.cntr && %vote.choice.F.cntr > %vote.choice.D.cntr && %vote.choice.F.cntr > %vote.choice.E.cntr && %vote.choice.F.cntr > %vote.choice.G.cntr) { msg %vote.chan 5The Majority Voted for %vote.choice.F }
elseif (%vote.choice.G.cntr > %vote.choice.A.cntr && %vote.choice.G.cntr > %vote.choice.B.cntr && %vote.choice.G.cntr > %vote.choice.C.cntr && %vote.choice.G.cntr > %vote.choice.D.cntr && %vote.choice.G.cntr > %vote.choice.E.cntr && %vote.choice.G.cntr > %vote.choice.F.cntr) { msg %vote.chan 5The Majority Voted for %vote.choice.G }
:end
}


Any suggestions?? I can't figure out what the problem is. I am open to other suggestions on making that output werk with a timer also.

confused

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
After a quick review, this one looks wrong:

alias vote.timesup
{

should be -

alias vote.timesup {

Joined: Dec 2002
Posts: 397
A
Fjord artisan
Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
here is a simple voteing script that u can use to vote on 2 diffrent things:

Here it is:

on :text:!vote*:#: {
var %voteiplist = voteips.txt
var %votersip = $nick $+ $address($nick,2)

var %totips = $lines(%voteiplist)
var %linenum = 1

var %hasvoted = 0
:votersloop
var %readtext = $read(%voteiplist, nt, %linenum)
/inc %linenum 1
if (%readtext == %votersip) { var %hasvoted = 1 }
if (%linenum <= %totusers) { goto votersloop }
if (%hasvoted == 1) {
/notice $nick You have all ready voted you may only vote once.
}
else {
if (%hasvoted == 0) {
if ($2 == gamesnet) {
write %voteiplist %votersip
inc %gamesnet 1
/notice $nick Thank you for you voteing for GamesNet services. We are proccessing it right now.
/msg # 12Services 4War-
/msg # 15Gamesnet Services; 12Votes:4 %gamesnet
/msg # 15Epona Services; 12Votes:4 %stay
}
elseif ($2 == stay) {
write %voteiplist %votersip
/inc %stay 1
/notice $nick Thank you for you voteing for Staying with current services. We are proccessing it right now.
/msg # 12Services 4War-
/msg # 15Gamesnet Services; 12Votes:4 %gamesnet
/msg # 15Epona Services; 12Votes:4 %stay
}
else {
/notice $nick Invalid choice!
}
}
}
}


Need amazing web design for low price: http://www.matrixn3t.net

Link Copied to Clipboard