Typo commented on a Page, Poll or Vote Snippet  -  Aug 22, 2008

Hey trikola, you should put all those On Text events into one large on text event like:

On *:text:*:#:{
  if (!%poll) {
    if ($1 == !Trigger1) { action 1 }
    if ($1 == !Trigger2) { action 2 }
    if ($1 == !Trigger3) { action 3 }
  }
  else { msg # There isn't a poll right now, make one with !makepoll }
}

Also, you should consider using while loops over goto loops and also you can unset more than one item on a line and lastly you should try to leave out the halts when the 'if then else' already handles the halting by not doing anything and ending the routine:

alias end.poll {
  var %number = 0 
  while (%number <= %options) {
    inc %number 
    msg %chal  $+ %number $+ . %option [ $+ [ [ [ %number ] ] ] ] -- %vote [ $+ [ %number ] ]
    if (%number == %options) { msg %chal there was $iif(%votess, [ [ %votess ] ], 0) vote(s) }
  }
  unset %poll* %vote* %option* %pmaker %polltime %ptopic %num* %chal %wrote*
}

Instead of:

alias end.poll {
  :again
  inc %number
  msg %chal  $+ %number $+ . %option [ $+ [ [ [ %number ] ] ] ] -- %vote [ $+ [ %number ] ]
  if (%number == %options) {
    msg %chal there was $iif(%votess, [ [ %votess ] ], 0) vote(s)
    unset %poll*
    unset %vote*
    unset %option*
    unset %pmaker
    unset %polltime
    unset %ptopic
    unset %num*
    unset %chal
    unset %wrote*
    halt
  }
  else { goto again }
}

I havent tested this yes but it looks decent.
Maybe ill give it a shot when you try those changes, especially combining all those on texts.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.