Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias StartVote {
- if ($4) && (%Gather.VoteMap !== ON) && (%Gather.Status == OFF) {
- Set %Gather.VoteMap ON
- Set %Gather.Votes 0
- Set %Gather.Maps $3-
- unset %Gather.Vote-Address
- Set %Gather.VoteBy $2
- var %x = 1
- while ($gettok($3-,%x,32)) { .writeini -n Votes.ini $gettok($3-,%x,32) Votes 0 | inc %x }
- if ($readini(Access.ini,$1,Votes)) { .writeini -n Access.ini $1 Votes $calc($readini(Access.ini,$1,Votes) +1) }
- elseif (!$readini(Access.ini,$1,Votes)) { .writeini -n Access.ini $1 Votes 1 }
- mode %Gather.Channel +m-N
- .timer 1 1 notice %Gather.Channel $stl(Votemap has been started by $+ %Gather.Color2 $2)
- .timer 1 1 msg %Gather.Channel $stl(Maps are: $+ %Gather.Color2 $3- %Gather.Color3 $+ %Gather.ColorChr $+ %Gather.Color1 Vote time: $+ %Gather.Color2 $iif(%Gather.Votetime,%Gather.Votetime,60) %Gather.Color1 $+ Seconds.)
- .timer 1 2 msg %Gather.Channel $stl(Commands: $cmd(Vote) < $+ %Gather.Color2 $+ Map $+ %Gather.Color1 $+ > $cmd(Votemap) $cmd(Votes) $cmd(Timeleft))
- .timerENDVOTE 1 $iif(%Gather.Votetime,%Gather.Votetime,60) EndVote
- .timer 1 11 mode %Gather.Channel -m+N
- }
- }
- alias EndVote { if (%Gather.Votemap == ON) {
- if (%Gather.Votes > 0) {
- .close -@ @Bot | .window -h @Bot | var %x 1, %o 1
- while ($ini(Votes.ini,%x)) { echo @Bot $ini(Votes.ini,%x) $calc($readini(Votes.ini,$ini(Votes.ini,%x),Votes) +0) | inc %x }
- filter -cwwteu 2 32 @Bot @Bot | set -u10 %Gather.Flood ON | var %MAP = $gettok($line(@Bot,1),1,32)
- msg %Gather.Channel $stl(The Map $+ %Gather.Color2 %MAP %Gather.Color1 $+ won with $+ %Gather.Color2 $gettok($line(@Bot,1),2,32) $+ %Gather.Color1 $+ / $+ %Gather.Color2 $+ $+ %Gather.Votes %Gather.Color1 $+ Votes) | Set %Gather.Votemap OFF | unset %Gather.Vote-Address | unset %Gather.Votes | unset %Gather.VoteBy | unset %Gather.Maps | .timer 1 1 .remove Votes.ini
- }
- else { msg %Gather.Channel $stl(No votes $+ %Gather.Color2 0 $+ %Gather.Color1 $+ / $+ %Gather.Color2 $+ $+ 0 %Gather.Color1 $+ Votes) | Set %Gather.Votemap OFF | unset %Gather.Vote-Address | unset %Gather.Votes | unset %Gather.VoteBy | unset %Gather.Maps | .timer 1 1 .remove Votes.ini }
- }
- }
- alias StopVote { if (%Gather.Votemap == ON) { msg %Gather.Channel $stl(Votemap was stopped by $+ %Gather.Color2 $iif($1,$1,No such user.)) | Set %Gather.Votemap OFF | .timerENDVOTE OFF | unset %Gather.Vote-Address | unset %Gather.Votes | unset %Gather.VoteBy | unset %Gather.Maps | .remove Votes.ini } }
- alias Votes { msg %Gather.Channel $stl(%Gather.Color2 $+ $+ %Gather.Votes %Gather.Color1 $+ Votes so far.) }
- alias VoteMap {
- if (%Gather.VoteMap == ON) { msg %Gather.Channel $stl(Votemap is $+ %Gather.Color2 ON $+ %Gather.Color3 %Gather.ColorChr %Gather.Color1 $+ By: $+ %Gather.Color2 %Gather.VoteBy %Gather.Color3 $+ %Gather.ColorChr %Gather.Color1 $+ Maps: $+ %Gather.Color2 %Gather.Maps) }
- else { msg %Gather.Channel $stl(Votemap is $+ %Gather.Color2 OFF.) }
- }
- alias AddVoter {
- if (!$Istok(%Gather.Vote-Address,$1,32)) && ($istok(%Gather.Maps,$2,32)) {
- Set %Gather.Vote-Address $addtok(%Gather.Vote-Address,$1,32)
- inc %Gather.Votes | .writeini -n Votes.ini $2 Votes $calc($readini(Votes.ini,$2,Votes) +1)
- if (!%Gather.Flood) { Set -u2 %Gather.Flood ON | notice $3 $stl($3 Thanx for your vote.) }
- }
- }
- ;;on text;;;
- if ($1 == %Gather.Sign $+ Vote) && ($2) {
- if (%Gather.Votemap !== on) && (!%Gather.Flood) { Set -u5 %Gather.Flood ON | VoteMap }
- elseif (%Gather.Votemap == on) && (!$istok(%Gather.Vote-Address,$address,32)) && ($istok(%Gather.Maps,$2,32)) { AddVoter $address $2 $nick }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement