vote for me to be regged!
 

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

vote for me to be regged!

Started by yepyepyep4711, 15 April, 2004, 10:54:31

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

yepyepyep4711

hi,

the idea is to let the regusers elect the new regusers. So when someone completely new is in the hub, after a while he can ask the others to vote for him, and if he gets enough votes he is elected reguser. It could look like that:

Man, this hub is a nice place, I'd like to be reguser
!voteforme
newGuy has requested your votes! Do you want him to be reguser? Answer with newGuy:yes or newGuy:no
newGuy:yes
newGuy:yes
newGuy:yes
in pm to newGuy Congratulations! You've been elected reguser! What shall be your password?
in pm to votingScript gudekwuh
in pm to newGuy Done, reconnect with password 'gudekwuh' and then don't forget to add us to your favorites
(in Main) newGuy is now reguser!

I hope you great scripters out there get the idea and will be interested. If not please ask.
I've found some voting/polling scipts that may be of some use:
by aMutex
by nerBos

Thanks a lot and cheers :) I would love that

pHaTTy

ok am a bit tired but here goes, once i finish it i will post in finsihed scripts, but tired atm


--//RegVardy Voter bot by Phatty *yawn* version 0.01;
--//REquest by someone, update soon when i awake properly no sleep yet lol
--//Untested;

Reg = {}
maxvotes = 11;
_mark = 5;

function Main() BOT = "RegVardy"; hubSD = SendToAll; end;

function DataArrival(reg,vardy)
	if( strsub(vardy, 1, 4) == "$To:" ) then
		local s,e,whoto,from,vardy = strfind(vardy, "$To:%s+(%S+)%s+From:%s+(%S+)%s+(.*)") 
		local s,e,old,vardy = strfind(vardy, "(%S+)>(.*)")
		if whoto == BOT then
			local vardy=strsub(vardy,1,strlen(vardy)-1)
			if Reg[reg.sName] == "pass" then
				local s,e,pass = strfind(vardy,"(%S+)")
				AddRegUser(reg.sName,pass,3)
				reg:SendPM(BOT,"You are now registered with the pass: "..pass.." please reconnect and add this hub to favs")
				hubSD(BOT,reg.sName.." is now a registered member with us!")
			return nil; end;
		end;
	elseif( strsub(vardy, 1, 1) == "<" ) then
		local vardy=strsub(vardy,1,strlen(vardy)-1) 
		local s,e,cmd = strfind(vardy, "%b<>(%S+)")

		if cmd == "!voteme" then
			if reg.iProfile == -1 then
				hubSD(BOT,reg.sName.." has requested votes to become a registered user, if u want to vote and let this user be registered here type !vote username yes/no")
				Reg[reg.sName] = {["yes"] = {}, ["no"] = {}, ["total"] = 0}
				return nil; else
				reg:SendData(BOT,"You are already registered")
				return nil;
			end;
		elseif cmd == "!vote" then
			local s,e,name,answer = strfind(vardy, "%b<>(%S+)(%S+)")
			if name == nil or answer == nil then
				reg:SendData(BOT,"Syntax: !vote  ")
				return nil; end; if Reg[name] then
				if Reg[name][answer] then
					Reg[name][answer] = reg.sName;
					if Reg[name]["total"] == maxvotes then
						CountVotes(name) return nil;
					end; Reg[name]["total"] = Reg[name]["total"] + 1;
				else reg:SendData(BOT,"Syntax: !vote  ")
				return nil; end;
			end;
		end;
	end;
end;

function CountVotes(name)
	local count = 0; for i,v in Reg[name]["yes"] do
	local count = count + 1;
	end; if count < _mark then
		SendPmToNick(name,BOT,"You have failed to recieve enough votes to be registered")
		Reg[name] = nil; return nil; else
		Reg[name] = "pass"; SendPmToNick(name,BOT,"You have been voted to be registered, please type your pass now, and u will be auto registered")
	return nil; end;
end;
Resistance is futile!

yepyepyep4711

yupp, better get some sleep first, phatty, because atm and as far as I can tell, the script does nothing :D

doesn't react to !voteme or !vote yes, doesn't give an error either :D

so sweet dreams, don't let the bugbed bite;)

pHaTTy

ehmm yup was 1 little thing wrong that furked it up

--//RegVardy Voter bot by Phatty *yawn* version 0.01;
--//REquest by someone, update soon when i awake properly no sleep yet lol
--//Untested;

Reg = {}
maxvotes = 11;
_mark = 5;

function Main() BOT = "RegVardy"; hubSD = SendToAll; frmHub:RegBot(BOT); end;

function DataArrival(reg,vardy)
	if strsub(vardy, 1, 4) == "$To:" then
		local s,e,whoto,from,vardy = strfind(vardy, "$To:%s+(%S+)%s+From:%s+(%S+)%s+(.*)") 
		local s,e,old,vardy = strfind(vardy, "(%S+)>(.*)")
		if whoto == BOT then
			local vardy=strsub(vardy,1,strlen(vardy)-1)
			if Reg[reg.sName] == "pass" then
				local s,e,pass = strfind(vardy,"(%S+)")
				AddRegUser(reg.sName,pass,3)
				reg:SendPM(BOT,"You are now registered with the pass: "..pass.." please reconnect and add this hub to favs")
				hubSD(BOT,reg.sName.." is now a registered member with us!")
			return nil; end;
		end;
	elseif strsub(vardy, 1, 1) == "<" then
		local vardy=strsub(vardy,1,strlen(vardy)-1) 
		local s,e,cmd = strfind(vardy, "%b<>%s+(%S+)")

		if cmd == "!voteme" then
			if reg.iProfile == -1 then
				hubSD(BOT,reg.sName.." has requested votes to become a registered user, if u want to vote and let this user be registered here type !vote username yes/no")
				Reg[reg.sName] = {["yes"] = {}, ["no"] = {}, ["total"] = 0}
				return nil; else
				reg:SendData(BOT,"You are already registered")
				return nil;
			end;
		elseif cmd == "!vote" then
			local s,e,name,answer = strfind(vardy, "%b<>(%S+)(%S+)")
			if name == nil or answer == nil then
				reg:SendData(BOT,"Syntax: !vote  ")
				return nil; end; if Reg[name] then
				if Reg[name][answer] then
					Reg[name][answer] = reg.sName;
					if Reg[name]["total"] == maxvotes then
						CountVotes(name) return nil;
					end; Reg[name]["total"] = Reg[name]["total"] + 1;
				else reg:SendData(BOT,"Syntax: !vote  ")
				return nil; end;
			end;
		end;
	end;
end;

function CountVotes(name)
	local count = 0; for i,v in Reg[name]["yes"] do
	local count = count + 1;
	end; if count < _mark then
		SendPmToNick(name,BOT,"You have failed to recieve enough votes to be registered")
		Reg[name] = nil; return nil; else
		Reg[name] = "pass"; SendPmToNick(name,BOT,"You have been voted to be registered, please type your pass now, and u will be auto registered")
	return nil; end;
end;

took me like an hour to find it lmfaooooo
Resistance is futile!

yepyepyep4711

great, now it does something :)

it reacts correctly on !voteme, but then...

yepyepyep has requested votes to become a registered user, if u want to vote and let this user be registered here type !vote username yes/no
!vote yepyepyep yes
Syntax: !vote

SMF spam blocked by CleanTalk