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 (http://board.univ-angers.fr/thread.php?threadid=902&boardid=11&sid=be5338485f80da3793183e58b1826caa)
by nerBos (http://board.univ-angers.fr/thread.php?threadid=1430&boardid=11&sid=be5338485f80da3793183e58b1826caa&page=2)
Thanks a lot and cheers :) I would love that
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;
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;)
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
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