PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: henry_ok on 09 February, 2004, 17:06:11

Title: autoregister script
Post by: henry_ok on 09 February, 2004, 17:06:11
Hi!

Is there an script for autoregister user?

I have ptokax TD4
 

Thanks! :]
Title:
Post by: Smulf on 09 February, 2004, 18:21:36
Next time try to search after it I know there's plenty...<-- I'm not good at it my self, but I'm trying:D And I also know that the moderators appreciates it...:) Hob this is what you are searching for...

Bot = "UserREG"

function Main()
end

function DataArrival(user, data)
if (strsub(data, 1, 1) == "<") then
data=strsub(data,1,strlen(data)-1)
local _,_,cmd=strfind(data, "%b<>%s+(%S+)")

if not cmd then return 0; end

cmd = strlower(cmd)

if (cmd =="!regme") and not user.bOperator then
local _,_,cmd,AddPass = strfind( data, "%b<>%s+(%S+)%s+(.+)" )

if (AddPass ~= nil and strfind(AddPass, "%W") == nil) then
AddRegUser(user.sName, AddPass,3)
user:SendData(Bot," "..user.sName.."  *** You have been succesfull added as new Registred user!! ***")
user:SendData(Bot, "Your password is:  "..AddPass.."  Reconnect and use that!!")
else
user:SendData(Bot,"*** Syntax: !regme ***");
end

return 1;
elseif (cmd =="!showregs") then
local ru = GetUsersByProfile(GetProfileName(3))
for i, n in ru do
SendPmToNick(user.sName, Bot, n)
end
end
end
end


If this wasn't what you where searching for, my mistake...
Title:
Post by: henry_ok on 09 February, 2004, 18:33:37
Isn't  there an script for fix an password for hub and automatically register user?
Title:
Post by: nErBoS on 09 February, 2004, 20:45:53
I didn't understood your request, you want a script to to change the password, or a script to auto-register a user by giving a password when he connects in the hub ??

Best regards, nErBoS
Title:
Post by: henry_ok on 09 February, 2004, 21:45:06
yes, a script to auto-register a user by giving a password when he connects in the hub.......


thanks! :-)
Title:
Post by: nErBoS on 10 February, 2004, 03:29:24
It can be done but I think thats not good for your Hub,

For example if someone is using the nick fery and changes to feryy now you have the same user with to nicks and you will get your hubsoftware full by nothing if think that evryone is free to register themselves if they want to.

Do you realy want a script to do that ??

Best regards, nErBoS
Title:
Post by: NotRabidWombat on 10 February, 2004, 06:28:44
DO NOT USE THE ABOVE SCRIPT.

(I only use all caps when I mean it).

Ptaczek, the communitty NEEDS that fix.

-NotRabidWombat
Title:
Post by: henry_ok on 10 February, 2004, 12:49:09
QuoteOriginally posted by nErBoS
It can be done but I think thats not good for your Hub,

For example if someone is using the nick fery and changes to feryy now you have the same user with to nicks and you will get your hubsoftware full by nothing if think that evryone is free to register themselves if they want to.

Do you realy want a script to do that ??

Best regards, nErBoS


yes, I have a hub private...... I would have to register the users by hand...... is possible to execute the script?

help me! :(
Title:
Post by: nErBoS on 10 February, 2004, 12:59:47
Ok I will try to do one,

But today I have a exame, I will do it today at night or tomorrow in the morning.

Best regards, nErBoS
Title:
Post by: henry_ok on 10 February, 2004, 13:19:17
thanks  :)
Title:
Post by: nErBoS on 11 February, 2004, 03:11:51
Hi,

I hope this one helps you..

before putting the script to work create the file generate.txt and put on the script folder.
then put this in that file...
a=1
b=2

then you can use the script..

--Requested by henry_ok
--Made by nErBoS

Bot = "Auto-Register"

timer = 5 --time to wait to user get connected (in seconds)
assert(dofile("generate.txt"),"File not found.")

function Main()
frmHub:RegBot(Bot)
end

function NewUserConnected(user, data)
SetTimer(timer*1000)
StartTimer()
AutoReg(user, data)
StopTimer()
end

function OnTimer()
end

function AutoReg(user, data)
if not(GetProfileName(user.iProfile) == "VIP" or GetProfileName(user.iProfile) == "Reg") then
local msg = ""
local temp = {}
local save = "generate.txt"
a = a*2
b = b*3
pass = 1000+b-a --If you want change the number 1000 to another to number to do another generator
msg = msg.."a="..a.."\r\n"
msg = msg.."b="..b.."\r\n"
tinsert(temp, msg)
Writetextfile(save, temp)
AddRegUser(user.sName, pass, "3")
user:SendPM(Bot, "You have been register in this hub with this password: "..pass)
StopTimer()
end
end

function Writetextfile(file, array)
writeto(file)
for x=1,getn(array) do write(array[x].."\r\n") end
writeto()
end

Best regards, nErBoS
Title:
Post by: henry_ok on 11 February, 2004, 10:37:22
thank you very much!

....but my intention was to put a password to the access to hub, fixed from me, and therefore autoregister the user........


there was a script for ptokax icecube, but I have lost it  :-(........
Title:
Post by: nErBoS on 11 February, 2004, 12:43:16
Don't remenber that script !!

Now making a password to the hub is more dificult, you have in the software hub the option to acept only reg users, but in my view you are only making a Hub with Reg Users not Private Hub, because private hubs register their users by hand using a emails acounts.

Best regrads, nErBoS
Title:
Post by: henry_ok on 11 February, 2004, 13:35:07
thanks you

 the script that you have created is perfect........:-)