All pastes #70925 Raw Edit

Anonymous

public text v1 · immutable
#70925 ·published 2006-06-25 00:25 UTC
rendered paste body
alias Poll {
  dialog -md Poll Poll
}
dialog Poll {
  title "mIRC Poll [By: Thegr81]"
  size -1 -1 126 103
  option dbu
  text "Question:", 1, 1 3 24 8
  edit "", 2, 27 1 90 10
  text "?", 3, 118 2 7 8
  text "Answer 1:", 4, 1 15 25 8
  text "Answer 2:", 5, 1 26 25 8
  text "Answer 3:", 6, 1 36 25 8
  text "Answer 4:", 7, 1 46 25 8
  box "&Options...", 8, 1 55 123 39
  text "Channel:", 9, 5 62 25 8
  edit "", 10, 32 61 89 10
  edit "", 11, 29 15 89 10
  edit "", 12, 29 25 89 10
  edit "", 13, 29 35 89 10
  edit "", 14, 29 45 89 10
  text "Secs. between question:", 15, 5 72 60 8
  edit "", 16, 66 71 50 10
  text "Type to vote:", 17, 5 82 33 8
  edit "", 18, 39 81 50 10
  button "Save Settings", 19, 2 95 37 7, flat
  button "Cl&ose", 20, 87 95 37 7, flat ok
}
On *:Dialog:Poll:init:*: {
  .did -a Poll 2 %Poll.Quest
  .did -a Poll 11 %Poll.Ans1
  .did -a Poll 12 %Poll.Ans2
  .did -a Poll 13 %Poll.Ans3
  .did -a Poll 14 %Poll.Ans4
  .did -a Poll 16 %Poll.countQ
  .did -a Poll 10 %Poll.Chan
  .did -a Poll 18 %Poll.Type
}
On *:Dialog:Poll:sclick:19: {
  .set %Poll.Quest $did(Poll,2)
  .set %Poll.Ans1 $did(Poll,11)
  .set %Poll.Ans2 $did(Poll,12)
  .set %Poll.Ans3 $did(Poll,13)
  .set %Poll.Ans4 $did(Poll,14)
  .set %Poll.countQ $did(Poll,16)
  .set %Poll.Chan $did(Poll,10)
  .set %Poll.Type $did(Poll,18)
  .set %Poll.vote1 0
  .set %Poll.vote2 0
  .set %Poll.vote3 0
  .set %Poll.vote4 0  
  .timerPoll 0 %Poll.countQ .msg %Poll.chan 12Poll: %Poll.Quest $+ ?
  .timerPoll1 0 %Poll.countQ .msg %Poll.chan 12Answer 1: %Poll.Ans1
  .timerPoll2 0 %Poll.countQ .msg %Poll.chan 12Answer 2: %Poll.Ans2
  .timerPoll3 0 %Poll.countQ .msg %Poll.chan 12Answer 3: %Poll.Ans3
  .timerPoll4 0 %Poll.countQ .msg %Poll.chan 12Answer 4: %Poll.Ans4
  .timerPoll5 0 %Poll.countQ .msg %Poll.chan 12To vote type:14 %Poll.Type $+ number (E.G: %Poll.type 1)
  .msg %Poll.chan 12Poll: %Poll.Quest $+ ?
  .msg %Poll.chan 12Answer 1: %Poll.Ans1
  .msg %Poll.chan 12Answer 2: %Poll.Ans2
  .msg %Poll.chan 12Answer 3: %Poll.Ans3
  .msg %Poll.chan 12Answer 4: %Poll.Ans4
  .msg %Poll.chan 12To vote type:14 %Poll.Type number (E.G: %Poll.type 1)
  .enable #PAnswer
}
alias Pollhlt {
  .timerPoll* off
  .msg %Poll.chan 12Poll closed!
  .disable #PAnswer
}
alias Pollstr {
  .timerPoll 0 %Poll.countQ .msg %Poll.chan 12Poll: %Poll.Quest $+ ?
  .timerPoll1 0 %Poll.countQ .msg %Poll.chan 12Answer 1: %Poll.Ans1
  .timerPoll2 0 %Poll.countQ .msg %Poll.chan 12Answer 2: %Poll.Ans2
  .timerPoll3 0 %Poll.countQ .msg %Poll.chan 12Answer 3: %Poll.Ans3
  .timerPoll4 0 %Poll.countQ .msg %Poll.chan 12Answer 4: %Poll.Ans4
  .timerPoll5 0 %Poll.countQ .msg %Poll.chan 12To vote type:14 %Poll.Type $+ number (E.G: %Poll.type 1)
  .msg %Poll.chan 12Poll: %Poll.Quest $+ ?
  .msg %Poll.chan 12Answer 1: %Poll.Ans1
  .msg %Poll.chan 12Answer 2: %Poll.Ans2
  .msg %Poll.chan 12Answer 3: %Poll.Ans3
  .msg %Poll.chan 12Answer 4: %Poll.Ans4
  .msg %Poll.chan 12To vote type:14 %Poll.Type number (E.G: %Poll.type 1)
  .enable #PAnswer
}

#PAnswer off
On ^*:TEXT:*:#: {
  If ($chan == %Poll.chan) {
    If ($1 == %Poll.Type) {
      .msg %Poll.chan $nick has voted on answer number12 $2
      If ($2 == 1) {
        .msg %Poll.chan 12Your vote is 1 12You can't vote anymore till tomorow the same time...  
        .set %Poll.vote1 $calc(%Poll.vote1 + 1)
        .ignore -u# 43200 $nick   
      }
      If ($2 == 2) {
        .msg %Poll.chan 12Your vote is 2 12You can't vote anymore till tomorow the same time...  
        .set %Poll.vote2 $calc(%Poll.vote2 + 1)
        .ignore -u# 43200 $nick       
      }
      If ($2 == 3) {
        .msg %Poll.chan 12Your vote is 3 12You can't vote anymore till tomorow the same time...  
        .set %Poll.vote3 $calc(%Poll.vote3 + 1)
        .ignore -u# 43200 $nick       
      }
      If ($2 == 4) {
        .msg %Poll.chan 12Your vote is 4 12You can't vote anymore till tomorow the same time...  
        .set %Poll.vote4 $calc(%Poll.vote4 + 1)
        .ignore -u# 43200 $nick       
      }
    }
  }
}
#PAnswer end

On 1:TEXT:!pollrate*:#: {
  If ($Chan == %Poll.Chan) {
    .msg %Poll.chan 12There were14 %Poll.vote1 12vote(s) on answer 1:14 %Poll.Ans1
    .msg %Poll.chan 12There were14 %Poll.vote2 12vote(s) on answer 2:14 %Poll.Ans2
    .msg %Poll.chan 12There were14 %Poll.vote3 12vote(s) on answer 3:14 %Poll.Ans3
    .msg %Poll.chan 12There were14 %Poll.vote4 12vote(s) on asnwer 4:14 %Poll.Ans4
  }
}
menu channel {
  Poll
  .Version:/say 14[12Poll addon14][12By: Thegr8114][12Irc.Swiftirc.Net // #Gors14]
  .Setup..:/poll
  .-
  .On://pollstr
  .Off://pollhlt
}