VoteBot with user's comment
 

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

VoteBot with user's comment

Started by (!(Tys?kan)=), 21 April, 2004, 17:01:07

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

(!(Tys?kan)=)

Hi! I'd like the VotePoll, where user's can(if they want) add his description to the choosed variant. And numbers of voteoption may be some.
Such as:
----------------
!createvote Question#Description(not necessarily)
!addoption Answer1
!addoption Answer2
!addoption Answer3
etc.
!endoption
VotePoll successfully created!
----------------
or
----------------
!createvote Question#Description(not necessarily)
!endoption
VotePoll successfully created!
---
And Bot added this poll with answers:
1. Yes
2. No
----------------

----------------
!poll
There is 5 votepoll's:
1. How can I'm washing up my car.
2. How teaching to fly?
etc.

!poll 1
Poll n. 1:
1. Answer1(10 user's voted)
|||
2. Answer2(0 user's voted)

3. Answer3(17 user's voted)
||||||

(max: |||||||||| in percent of all users, | = ~10%)
etc.
!votefor 1#Description(not necessarily)
Ok! You has voted for: 1. Answer1. Thanks you!
---------------

Who can trying to write this script?



--Ty--
--Ty--

nErBoS

Hi,

I could try, but will take a bit, i am having a lot of work this days.

Best regards, nErBoS
--## nErBoS Spot ##--

(!(Tys?kan)=)

--Ty--

acethecase

Aiight..
Good there mr TY, Im looking for the same script
would be great if some1 can make it!

nErBoS

#4
Hi,

Hope it helps...

--Requested by (!(Tys?kan)=)
--Made by nErBoS

sBot = "Poll-Bot"

poll = {}
pollsv = "pollsv.dat"
ended = {}
endedsv = "ended.dat"

function Main()
	frmHub:RegBot(sBot)
end

function OnExit()
	if (readfrom(pollsv) ~= nil and poll[1] == nil) then
		LoadFromFile(pollsv)
	end
	if (readfrom(endedsv) ~= nil and ended[1] == nil) then
		LoadFromFile(endedsv)
	end
	SaveToFile(pollsv , poll , "poll")
	SaveToFile(endedsv , ended , "ended")
end

function DataArrival(user, data)
	if (strsub(data,1,1) == "<" or strsub(data,1,5+strlen(sBot)) == "$To: "..sBot) then
		data = strsub(data,1,strlen(data)-1)
		s,e,cmd = strfind(data, "%b<>%s+(%S+)")
		if (cmd == "!createvote" and user.bOperator) then
			local s,e,quest = strfind(data, "%b<>%s+%S+%s+(.*)")
			if (quest == "") then
				user:SendPM(sBot, "Syntax Error, !creatvote , you must write a question.")
			else
				AddPoll(quest)
				user:SendPM(sBot, "The Poll is open.")
			end
			return 1
		elseif (cmd == "!addoption" and user.bOperator) then
			local s,e,opt = strfind(data, "%b<>%s+%S+%s+(.*)")
			if (quest == "") then
				user:SendPM(sBot, "Syntax Error, !addoption 

Little change in request, !poll shows all polls and !seepoll shows the poll typed.
This will only work 100% in ptokax 0.3.3.0

Best regards, nErBoS
--## nErBoS Spot ##--

kbeh273300

i would like that a poll be sent to mainchat on a timer once every hour and if there are say 2 or 3 polls have them sent to main chat on a timer randomly.what do ya think?
-=United Kings network=-
Network Webpage?
Hub address: houseofkings.no-ip.org:420
hub webpage
hub forum

nErBoS

Hi,

Yes could be made. Gone create 2 commands one to activate the timer in a choose poll and other to stop.
Tomorrow i will see that.

Best regards, nErBoS
--## nErBoS Spot ##--

krayzie_t17

#7
That files that are create 1.poll, 1.vot, can created in a folder like 'polls' ....please edit bot for me thanx 8) and add and that option on main chat timer random if 2 polls
And the command to delete polls that you want Master !



Thanx very much
Live is just so wild
Def SquaD is life  !!!

krayzie_t17

QuoteOriginally posted by nErBoS
Hi,

Yes could be made. Gone create 2 commands one to activate the timer in a choose poll and other to stop.
Tomorrow i will see that.

Best regards, nErBoS


PLease nErBoS finish this script  :D
Live is just so wild
Def SquaD is life  !!!

nErBoS

Hi,

Check out the "Finished Script" section, you will find the last version of this script in the "(Yes and No) VotePoll" topic.

Best regards, nErBoS
--## nErBoS Spot ##--

SMF spam blocked by CleanTalk