.Poll.Bot - TTB - Page 2
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

.Poll.Bot - TTB

Started by Madman, 12 June, 2008, 15:27:30

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Grey777

like works, else add that creator poll saw not only amount voted, but also name.
and, if possible, oldpolls in column :)

Madman

Quote from: dimetrius on 12 July, 2008, 15:33:39
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

Madman

Quote from: Grey777 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 :)
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

Grey777

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.


dimetrius

#29
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!

Madman

Quote from: dimetrius on 20 July, 2008, 16:30:01
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

Madman

Quote from: Grey777 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.



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

Grey777

#32
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  :)

dimetrius

Quote from: Grey777 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  :)
+1

Madman

Quote from: Grey777 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  :)

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

Madman

Quote from: dimetrius on 21 July, 2008, 23:21:31
Quote from: Grey777 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  :)
+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

dimetrius

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!

Madman

[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

Madman

-- 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

Grey777

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

dimetrius

#40
Quote from: Madman 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
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

for a,b in pairs(PollSettings["active"]) do
PollText = PollText..a..". "..b.."\r\n"
end

to it
for a=1,table.getn(PollSettings["active"]) do
PollText = PollText..a..". "..PollSettings["active"][a].."\r\n"
end

Madman

Quote from: Grey777 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

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...

Quote from: dimetrius on 24 July, 2008, 09:42:03
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

Madman

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

fodin

#43
Some changes in code:
It made for align questions numbers if its number more than 9
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:
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 Гб

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.
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

Madman

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

Madman

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

fodin

please translate this...

QuotedVotes = 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.
QuotedVotes = 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

fodin

Quote from: Madman 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?
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.

Madman

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

Madman

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

SMF spam blocked by CleanTalk