the script below works but only if $2 is 11 or higher other wise it gives the /set: line too long error for this line
if ($v1 >= %tempWinnerAmount) { %a = %a $hget(TwitchChannelUsers,%i).item }
looking for a possible solution so $2 can be any ammount specified set %tempWinnerAmount $2
Code:
[/code]

on *:TEXT:!roll*:#: {
  if ($hget(MasterList,$nick) == Master) {
    set %tempWinnerAmount $2
    msg %giveawayautotokenschannel Rolling
    var %i = 1, %a
    :next
    while ($hget(TwitchChannelUsers,%i).data) {
      if ($v1 >= %tempWinnerAmount) { %a = %a $hget(TwitchChannelUsers,%i).item }
      inc %i
    }
    if ($numtok(%a,32)) {
      set %currentgiveawaywinneris $gettok(%a,$rand(1,$v1),32)
      if (%currentgiveawaywinneris ison %giveawayautotokenschannel) {
        if ($hget(KeywordList,%currentgiveawaywinneris) == %CurrentKeywordIS) {
          .timerWinner 1 5 msg %giveawayautotokenschannel Winner!!!! = %currentgiveawaywinneris
          .hdec TwitchChannelUsers %currentgiveawaywinneris %tempWinnerAmount
          .timer 1 5 msg %giveawayautotokenschannel Deleted %tempWinnerAmount Tokens from %currentgiveawaywinneris
          .halt
        }
        else { goto next }
      }
      else { goto next }
    }
  }
  else { halt }
}
[code]

Last edited by DaRkCaSTLe1974; 06/06/13 02:31 AM.