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

Re : VoteBot with user's comment

Started by krayzie_t17, 30 December, 2004, 04:12:04

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

krayzie_t17

Please somebody finish the script that has been started at tha treahd before  ..please i need it  :D thanx
Live is just so wild
Def SquaD is life  !!!

bastya_elvtars

please post that script here :)
Everything could have been anything else and it would have just as much meaning.

krayzie_t17

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 




1  And  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?

2 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 !delpoll
Live is just so wild
Def SquaD is life  !!!

SMF spam blocked by CleanTalk