mIRC Home    About    Download    Register    News    Help

Print Thread
#23415 09/05/03 11:07 PM
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
hi there, i am trying to create a very simple voting script.

what this is doing is: when a person gets opped, it notices them a message, like--- Please Vote If KEEKER is to get AUTOOPS in the channel. /msg STATS_R_US !vote <yes or no> , or something like that. but i need it to allow the person to vote only once on each vote. The voting takes a while so i will have to use /set instead of var, but how do i get it to only accept the vote ONCE and only ONCE, then if someone attemps to vote again, it will send them an error mesage. can yall help me? this is what i got so far:
Code:


on @*:TEXT:!vote *:?:{
  if ($nick ISOP #speaker's_corner) || ($nick ISOP #mp3wavlovers) || ( !* iswm $nick(#mp3wavlovers,$nick,a).pnick ) $&amp;
 || ( !* iswm $nick(#speaker's_corner,$nick,a).pnick ) {
    set %vote $+ $nick $+ $date $2
    inc %tally $+ $2
  }


keek: Scots - intr.v. keeked, keekĀ·ing, keeks
To peek; peep.
#23416 09/05/03 11:56 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
on @*:TEXT:!vote *:?:{
if ($nick ISOP #speaker's_corner) || ($nick ISOP #mp3wavlovers) || ( !* iswm $nick(#mp3wavlovers,$nick,a).pnick ) $& || ( !* iswm $nick(#speaker's_corner,$nick,a).pnick ) {
if (%vote. [ $+ [ $nick ] ] == $null) {
set %vote [ $+ [ $nick ] $+ [ $date ] ] $2
set %vote. [ $+ [ $nick ] ] 1
inc %tally $+ $2
}
else {
; error message here
}
}
}

When the voting completes, just do: unset %vote.*

>:D


-KingTomato

Link Copied to Clipboard