Author Topic: .Poll.Bot - TTB  (Read 35622 times)

0 Members and 1 Guest are viewing this topic.

Offline Grey777

  • Junior Member
  • **
  • Posts: 11
  • Karma: +0/-0
Re: .Poll.Bot - TTB
« Reply #25 on: 17 July, 2008, 01:40:46 »
like works, else add that creator poll saw not only amount voted, but also name.
and, if possible, oldpolls in column :)

PtokaX forum

Re: .Poll.Bot - TTB
« Reply #25 on: 17 July, 2008, 01:40:46 »

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
Re: .Poll.Bot - TTB
« Reply #26 on: 19 July, 2008, 08:41:26 »
Discovered another mistake! Users can choose to answer several times! If you can answer several options!

[08:40:44] <[BOT]Poll> Thank you for voting 1. You can check always the poll by entering #poll in PM to [BOT]Poll. Please vote again by our next poll.
[08:40:46] <TheTwo> #poll 1
[08:40:47] <[BOT]Poll> You have already voted 1 time(s)! You can't vote again. Type #poll (without a number) to check the statistics!
[08:40:50] <TheTwo> #poll 2
[08:40:50] <[BOT]Poll> You have already voted 1 time(s)! You can't vote again. Type #poll (without a number) to check the statistics!
[08:40:53] <TheTwo> #poll 3
[08:40:53] <[BOT]Poll> You have already voted 1 time(s)! You can't vote again. Type #poll (without a number) to check the statistics!
[08:40:55] <TheTwo> #poll 4
[08:40:55] <[BOT]Poll> You have already voted 1 time(s)! You can't vote again. Type #poll (without a number) to check the statistics!

Works fine for me...
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
Re: .Poll.Bot - TTB
« Reply #27 on: 19 July, 2008, 08:45:50 »
like works, else add that creator poll saw not only amount voted, but also name.
and, if possible, oldpolls in column :)
the names on users that have voted can be seen in #pollusers

Don't understand what you mean with oldpolls in column
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline Grey777

  • Junior Member
  • **
  • Posts: 11
  • Karma: +0/-0
Re: .Poll.Bot - TTB
« Reply #28 on: 20 July, 2008, 14:02:24 »
dimetrius, probably, bore other in mind... think that option to vote several times is not claimed (on default user must vote once). In column.... I meant approximately following: ->[poll1, poll2, poll2]<-  so 
->[poll1]<-
->[poll2]<-
->[poll3]<-
Or even, with the instruction of date of creation (ex. ->[poll1 (07/20/08), poll2...]<-)
Thanks for attention.


Offline dimetrius

  • Junior Member
  • **
  • Posts: 18
  • Karma: +0/-0
Re: .Poll.Bot - TTB
« Reply #29 on: 20 July, 2008, 16:30:01 »
I mean that the user can vote twice for the same answer!
Of course, I may be do not understand you! English is not my mother tongue!

Incidentally I am translated your script into Russian!
« Last Edit: 20 July, 2008, 16:34:14 by dimetrius »

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
Re: .Poll.Bot - TTB
« Reply #30 on: 21 July, 2008, 13:27:42 »
I mean that the user can vote twice for the same answer!

Unless you set maxvotes1user to another value then 1, users can't vote more the once.
I tried sevrel times.. i can't get the user to vote more then once.
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
Re: .Poll.Bot - TTB
« Reply #31 on: 21 July, 2008, 13:44:27 »
dimetrius, probably, bore other in mind... think that option to vote several times is not claimed (on default user must vote once). In column.... I meant approximately following: ->[poll1, poll2, poll2]<-  so 
->[poll1]<-
->[poll2]<-
->[poll3]<-
Or even, with the instruction of date of creation (ex. ->[poll1 (07/20/08), poll2...]<-)
Thanks for attention.



Like that`?

[13:43:58] <[BOT]Poll> Type: #oldpoll <pollname>. Here are the oldpolls:
->[Myfirstpoll (08:38:03 / 19-07-2008) ]<-
->[second (08:40:24 / 19-07-2008) ]<-
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline Grey777

  • Junior Member
  • **
  • Posts: 11
  • Karma: +0/-0
Re: .Poll.Bot - TTB
« Reply #32 on: 21 July, 2008, 20:16:00 »
Precisely, it would be comfortable.
But I all the same do not understand, what for to the person to vote some times? In fact everywhere, even at forums it is possible to vote only once. Can will give an example? I certainly understand, that it is yours idea, excuse for importunity  :)
« Last Edit: 21 July, 2008, 20:19:11 by Grey777 »

Offline dimetrius

  • Junior Member
  • **
  • Posts: 18
  • Karma: +0/-0
Re: .Poll.Bot - TTB
« Reply #33 on: 21 July, 2008, 23:21:31 »
Precisely, it would be comfortable.
But I all the same do not understand, what for to the person to vote some times? In fact everywhere, even at forums it is possible to vote only once. Can will give an example? I certainly understand, that it is yours idea, excuse for importunity  :)
+1

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
Re: .Poll.Bot - TTB
« Reply #34 on: 22 July, 2008, 12:20:18 »
Precisely, it would be comfortable.
But I all the same do not understand, what for to the person to vote some times? In fact everywhere, even at forums it is possible to vote only once. Can will give an example? I certainly understand, that it is yours idea, excuse for importunity  :)

Done, version h uploaded...
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
Re: .Poll.Bot - TTB
« Reply #35 on: 22 July, 2008, 12:23:44 »
Precisely, it would be comfortable.
But I all the same do not understand, what for to the person to vote some times? In fact everywhere, even at forums it is possible to vote only once. Can will give an example? I certainly understand, that it is yours idea, excuse for importunity  :)
+1

huh? what +1? he wants the column in oldpolls, and he got it.
and we still don't understand what you want, you say users can vote more then once, i can't fix that, beacuse i can't reproduce the problem
Have you tried the latest version, and still have that error?
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline dimetrius

  • Junior Member
  • **
  • Posts: 18
  • Karma: +0/-0
Re: .Poll.Bot - TTB
« Reply #36 on: 22 July, 2008, 13:28:32 »
Good afternoon! Excuse for my bad English, but a mistake and it is not corrected! I have in view of what in your script when you choose that the user could leave some voices it can vote for one variant some times! In all normal forums, interrogations, there where there are some variants on a choice, it is impossible to vote for one variant some times! It is possible to choose some variants of the answer only! But not some times to vote for one variant!

When I specify that one user could vote three times it can vote for one variant of the answer!
Like it:
Quote
1. 3 vote(s)   [------------------------------?] (100.00%)  1
2. 0 vote(s)   [?                              ] (0.00%)  2
3. 0 vote(s)   [?                              ] (0.00%)  3
4. 0 vote(s)   [?                              ] (0.00%)  4
5. 0 vote(s)   [?                              ] (0.00%)  5

Total votes: 3 (100.00%)
**************************************************
Poll created by: dimetrius
Poll created on: [14:08:07] / [22-07-2008]

It is necessary for me that one user could not vote for the same variant some times!

I consider that it will be good correction! I Hope me this time all have understood!

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
Re: .Poll.Bot - TTB
« Reply #37 on: 23 July, 2008, 14:23:38 »
[2008-07-23 13:37] <[BOT]Poll> Thank you for voting 1. You have 2 vote(s) left on this poll. Vote again if you like! You can check always the poll by entering #poll in PM to [BOT]Poll.
[2008-07-23 13:37] <TheOne> #poll 1
[2008-07-23 13:37] <[BOT]Poll> You have already voted for this answer, please choose another one
[2008-07-23 13:37] <TheOne> #poll 1


If i understood you correctly, this is what you wanted.
set NoMultiVotes to true in script to activate it
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
Re: .Poll.Bot - TTB
« Reply #38 on: 23 July, 2008, 14:25:27 »
-- v1.4: 23.07.08
-- [Added] Option to disallow users from voteing on same answer more then once, request by dimetrius
-- [Changed] Layout of pollvotes table
--[[-- !IMPORTANT!
The new layout makes the pollvotes table invalid.
So BEFORE upgrade to 1.4, finsih your current running poll,
or all users will be able to vote again!
--]]--
-- [Removed] UserDisconnected function, it did not do anything
-- [Fixed] Bug in pollusers, due to new pollvotes
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline Grey777

  • Junior Member
  • **
  • Posts: 11
  • Karma: +0/-0
Re: .Poll.Bot - TTB
« Reply #39 on: 23 July, 2008, 23:56:24 »
Already to break have begun  :)
Probably you do not understand, that I mean, I shall show then in attached picture.
It the menu should not be, and value by default =1
I hope for understanding

Offline dimetrius

  • Junior Member
  • **
  • Posts: 18
  • Karma: +0/-0
Re: .Poll.Bot - TTB
« Reply #40 on: 24 July, 2008, 09:42:03 »
-- v1.4: 23.07.08
-- [Added] Option to disallow users from voteing on same answer more then once, request by dimetrius
BIG, BIG, Thanks ;)

And...
There is one more small mistake! The order of a conclusion of results!
Quote
**************************************************
CLOSED POLL: Как настроение?
**************************************************

2. 0 (0.00%) vote(s)  хорошо
3. 0 (0.00%) vote(s)  так себе
1. 3 (100.00%) vote(s)  супер
4. 0 (0.00%) vote(s)  не фонтан
5. 0 (0.00%) vote(s)  хреново

Total votes: 3 (100.00%)
**************************************************
Poll created by: dimetrius
Poll created on: [10:18:28] / [24-07-2008]
**************************************************

Change it

Code: [Select]
for a,b in pairs(PollSettings["active"]) do
PollText = PollText..a..". "..b.."\r\n"
end
to it
Code: [Select]
for a=1,table.getn(PollSettings["active"]) do
PollText = PollText..a..". "..PollSettings["active"][a].."\r\n"
end
« Last Edit: 24 July, 2008, 11:31:02 by dimetrius »

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
Re: .Poll.Bot - TTB
« Reply #41 on: 25 July, 2008, 08:32:11 »
Already to break have begun  :)
Probably you do not understand, that I mean, I shall show then in attached picture.
It the menu should not be, and value by default =1
I hope for understanding

The reason for you haveing a 1 there, is due to that your client rembers the last values entred in to the boxes
Script do not insert a 1 there...

There is one more small mistake! The order of a conclusion of results!
Thanks, done, will upload new version later, gtg to a meeting now
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
Re: .Poll.Bot - TTB
« Reply #42 on: 25 July, 2008, 17:29:02 »
Version 1.4a is uploaded

Fixing dimetrius problem, useing his code
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline fodin

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: .Poll.Bot - TTB
« Reply #43 on: 02 August, 2008, 22:44:29 »
Some changes in code:
It made for align questions numbers if its number more than 9
Code: [Select]
function Poll(curUser,data)
local PollText = "\r\n"..string.rep("*",50).."\r\nОПРОС: "..PollSettings["subject"].."\r\n"..string.rep("*",50).."\r\n\r\n"
for a=1,table.maxn(PollSettings["active"]) do
PollText = PollText..a.."."..string.rep(" ",(2-string.len(a))*2+1)..PollSettings["active"][a].."\r\n"
end
Users can answer by entering number of answer without any command:
Code: [Select]
function PollPM(curUser,data)
local s,e,cmd = string.find(data,"%b<>%s+(%S+)")
if tonumber(cmd)~=nil then
cmd=prefix..cPoll
end

if cmd and (string.lower(cmd) == (prefix..cPoll)) then
local s,e,cmd,answer = string.find(data,"%b<>%s+(%S+)%s+(%d+)")
if cmd==nil then s,e,answer = string.find(data,"%b<>%s+(%d+)") end
if PollSettings["current"] == 2 then
Entire graph have the same width regrdless of the bar value:
1.   2 vote(s)    [••----------------------------] (5.26%) vote(s)   10 Гб
2.   2 vote(s)    [••----------------------------] (5.26%) vote(s)   20 Гб
3.   5 vote(s)    [••••--------------------------] (13.16%) vote(s)   30 Гб
4.   1 vote(s)    [•-----------------------------] (2.63%) vote(s)   40 Гб
5.   15 vote(s)   [••••••••••••------------------] (39.47%) vote(s)   50 Гб
6.   3 vote(s)    [••----------------------------] (7.89%) vote(s)   60 Гб
7.   0 vote(s)    [------------------------------] (0.00%) vote(s)   70 Гб
8.   0 vote(s)    [------------------------------] (0.00%) vote(s)   80 Гб
9.   0 vote(s)    [------------------------------] (0.00%) vote(s)   90 Гб
10. 9 vote(s)    [•••••••-----------------------] (23.68%) vote(s)   100 Гб
11. 1 vote(s)    [•-----------------------------] (2.63%) vote(s)   110 Гб
12. 0 vote(s)    [------------------------------] (0.00%) vote(s)   120 Гб
13. 0 vote(s)    [------------------------------] (0.00%) vote(s)   130 Гб
14. 0 vote(s)    [------------------------------] (0.00%) vote(s)   140 Гб
15. 0 vote(s)    [------------------------------] (0.00%) vote(s)   150 Гб

Code: [Select]
function DoBars( val, max, length )
local lenght = length or 10
local ratio = (val / ( max/length) )
return "["..string.rep("•", ratio)..string.rep("-", length-ratio).."]"
end
For OPs PollVoters gives advanced stats. It include: what answers user selected, sharesize of user for weighting his vote.
Code: [Select]
for a,_ in pairs(PollVotes) do
count = count + 1
dVotes = dVotes..count.."."..string.rep(" ",(2-string.len(count))*2+1)..a
if dVoteMax>1 then
dVotes = dVotes.." с "..PollVotes[a]["n"].."/"..dVoteMax.." голосов"
end
if Profiles[curUser.iProfile] then
local u=Core.GetUser(a)
if u~=nil then
Core.GetUserData(u,16)
dVotes = dVotes.."\t"..math.floor(u.iShareSize/1024/1024/1024*100)/100
else
dVotes = dVotes.."\t".."Офф"
end
for i,ans in pairs(PollVotes[a]) do
if i~="n" then
dVotes = dVotes.."\t"..i
end
--Core.SendPmToNick("[b]Fodin","111",""..i.."  "..tostring(ans))
end
end

dVotes = dVotes.."\r\n"
end
« Last Edit: 02 August, 2008, 22:47:18 by fodin »

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
Re: .Poll.Bot - TTB
« Reply #44 on: 03 August, 2008, 10:24:31 »
please translate this...

dVotes = dVotes.." с "..PollVotes[a]["n"].."/"..dVoteMax.." голосов"
dVotes = dVotes.."\t".."Офф"

I have no idea what it should say.

But i'm adding the functions, with option to enable/disable them
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
Re: .Poll.Bot - TTB
« Reply #45 on: 03 August, 2008, 17:19:13 »
By the way...

While we are on the subject translateing...
I seen that some ppl translate PollBot, is there any intrest in MultiLanguage support?
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline fodin

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: .Poll.Bot - TTB
« Reply #46 on: 03 August, 2008, 17:57:54 »
please translate this...

Quote
dVotes = dVotes.." с "..PollVotes[a]["n"].."/"..dVoteMax.." голосов"
dVotes = dVotes.." with "..PollVotes[a]["n"].."/"..dVoteMax.." vote(s)"
Much be better:
dVotes = dVotes.." with "..PollVotes[a]["n"].."/"..dVoteMax.." vote"..(dVoteMax==1) and "s" or ""
1 vote. 2 votes.
Quote
dVotes = dVotes.."\t".."Офф"
dVotes = dVotes.."\t".."Offline"
or
dVotes = dVotes.."\t".."Off"
To exclude this case, script can record sharesize when user voted. I'm too lazy to implement this. ;-) Also good idea is to do some kind of sort voters list by sharesize or by selected answer and alphabet.

But i'm adding the functions, with option to enable/disable them

Offline fodin

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: .Poll.Bot - TTB
« Reply #47 on: 03 August, 2008, 18:05:20 »
By the way...

While we are on the subject translateing...
I seen that some ppl translate PollBot, is there any intrest in MultiLanguage support?
In russian we have problem in numbering:
"vote" = "голос"
n>=5 and n<=20 "голосов"
n%10>=2 and n%10<=4  "голоса"
n%10==1 "голос"
else "голосов"
Ex: 1 голос, 11 голосов, 21 голос, 22 голоса.
I don't know how to solve this in thr multilanguage script.

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
Re: .Poll.Bot - TTB
« Reply #48 on: 03 August, 2008, 21:26:58 »
Thanks for the translates...

atm i'm also to implent, to add ShareSize att vote, maybe later.
Focusing on the Multilang now...

Don't know exactly about the numbering problem in russian.. but i have an idea.
But it will have to wait untill entire support is done.
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
Re: .Poll.Bot - TTB
« Reply #49 on: 15 August, 2008, 19:06:59 »
V 2.0 is here. With multi lang support.

However, i did not do some function for Russian vote...
I probarly could, but then i would end up doing for all other langs it's beein translated in to...
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

PtokaX forum

Re: .Poll.Bot - TTB
« Reply #49 on: 15 August, 2008, 19:06:59 »