mIRC Homepage
Posted By: keeker allow trigger only once - 09/05/03 11:07 PM
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
  }
Posted By: KingTomato Re: allow trigger only once - 09/05/03 11:56 PM
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
© mIRC Discussion Forums