Hi guys,
can you somebody help me with this script?
I need a script which, if the user type: +regme, send PM to all OPerators, that the user ... want to be registered -> likewise as in VerliHub.
THX guys in advance!!!
QuoteOriginally posted by Jerry
Hi guys,
can you somebody help me with this script?
I need a script which, if the user type: +regme, send PM to all OPerators, that the user ... want to be registered -> likewise as in VerliHub.
THX guys in advance!!!
VerliHub don't have support LUA script
Hm... I think he wants it in LUA, like in Verlihub. If he does, this is the script:
-- Reg note to OPs by TTB
-- Request by Jerry
-- 18-05-05
-----------------------------------
regcmd = "+regme"
bot = "--REG-Note--"
function Main()
frmHub:RegBot(bot)
end
function ChatArrival(user,data)
data=string.sub(data,1,string.len(data)-1)
s,e,regger = string.find(data, "%b<>%s+(%S+)")
if regger and regger == regcmd and user.iProfile == -1 then
SendPmToOps(bot, "The user: "..user.sName.." wants to be regged. Please help him")
return 1
end
end
QuoteOriginally posted by TTB
I think he wants it in LUA, like in Verlihub.
Yes of course, this I think! :)
THX for the script TTB!!! ;)
btw.
I have one more question.
It is possible: that this script, if the user want to be registered, he type: +regme, send PM to OPs (this is creat by TTB)
and the OPerator, will be register only user's nickname and the script send PM to user: that he was registered and he must type his password, with command: +pass .... -> like in VerliHub
It is possible that?
I think -> this is good thing!
THX in advance guys!
P.S.
Sorry for my English! :))
Here we go:
-- Reg note to OPs by TTB v.2
-- Request by Jerry
-- 18-05-05
-- Added: User can reg himself after he is put in table by Operator, timer also added.
-- Thanx Madman for the finishing the notification function
-- Added: PM to user with hub info and username + pasw. (31-05-05)
-----------------------------------
regcmd = "+regme"
regopcmd = "+regreg"
cpaswcmd = "+pass"
bot = "--REG-Note--"
loginmin = 5 -- time the user has to confirm with his pasw. Else the user will be deleted!
-- ## Please don't change below ## --
RegTable = {}
function Main()
frmHub:RegBot(bot)
SetTimer(1000*60)
StartTimer()
end
function ChatArrival(user,data)
data=string.sub(data,1,string.len(data)-1)
s,e,regger = string.find(data, "%b<>%s+(%S+)")
if regger and regger == regcmd and user.iProfile == -1 then
SendPmToOps(bot, "The user: "..user.sName.." wants to be regged. Please help him.")
user:SendData(bot, "Your request to REG you has been send! Please be patient, an OP will help you a.s.a.p.!")
return 1
elseif regger == regopcmd and user.bOperator then
local s,e,name = string.find(data, "%b<>%s+%S+%s+(%S+)")
if name == nil then
user:SendData(bot, "*** Syntax error! Please use: "..regopcmd.." ")
return 1
else
RegTable[name] = loginmin
SendPmToOps(bot, "User: "..name.." has been registrated by: "..user.sName..". He has "..loginmin.." min. to log in!")
SendPmToNick(name,bot, "You have been registered! Please type "..cpaswcmd.." to complete your registration! You have "..loginmin.." minutes to register!")
return 1
end
elseif regger == cpaswcmd and user.iProfile == -1 then
local s,e,pasw = string.find(data, "%b<>%s+%S+%s+(%S+)")
if pasw == nil then
user:SendPM(bot, "*** Syntax error! Please use: "..cpaswcmd.." ")
return 1
else
if RegTable[user.sName] ~= nil then
AddRegUser(user.sName.."",pasw, 3)
RegTable[user.sName] = nil
SendPmToNick(user.sName,bot, "You have been registered!\r\n\r\n\t"..string.rep("-",60).."\r\n\tUsername:\t"..user.sName.."\r\n\t"..
"Password:\t"..pasw.."\r\n\tHubname:\t"..frmHub:GetHubName().."\r\n\tHub Adress:\t"..frmHub:GetRegServer().."\r\n\t"..
string.rep("-",60).."\r\n\tPlease add this to your Favarites!")
SendToAll(bot, "*** Username = "..user.sName.." registered himself succesfully, userlevel = REG.")
return 1
else
user:SendPM(bot,"You are not in memory to be registrated! An OP has to REG you first temporary!")
return 1
end
end
end
end
function OnTimer()
for user,timer in pairs(RegTable) do
if timer > 0 then
RegTable[user] = RegTable[user] - 1
else
notification(user)
RegTable[user] = nil
end
end
end
function notification(user)
SendPmToOps(bot, "User: "..user.." didn't REG him/herself after "..loginmin.." min.")
DelRegUser(user)
user = GetItemByName(user)
if user then
user:SendPM(bot, "Your time to log in has been expired. Please type again: '"..regcmd.."' to let an OP reg you...")
end
return 1
end
ToArrival = ChatArrival
Note that only the users will be USERLEVEL 3! That means, the ONLY users who can be registrated this way will be a REG USER!
*Edited! Script is now up to date
Thank you very much for the script TTB!!!
It's great -> that is, what I need it!!! ;)
Hi guys,
I have a problem with the script!
In the script doesn't work the loginmin -> script only send pm to OPs: SendPmToOps(bot, "User: "..user.." didn't REG him/herself after "..loginmin.." min.")
but doesn't send PM to user:user:SendPM(bot, "Your time to log in has been expired. Please type again: '"..regcmd.."' to let an OP reg you...")
-> Syntax scripts\reg.lua:149: attempt to index local `user' (a string value)
Any ideas?
Thank you in advance!
Yep.. replace notification with this
function notification(user)
SendPmToOps(bot, "User: "..user.." didn't REG him/herself after "..loginmin.." min.")
user = GetItemByName(user) -- User online?
DelRegUser(user.sName) -- Del user
user:SendPM(bot, "Your time to log in has been expired. Please type again: '"..regcmd.."' to let an OP reg you...")
return 1
end
Thank you very much Madman!!!
Script work great at this time -> THX :]
Thanx madman for finishing it... ghehe, stupid to forgot that lines :D
Np... =)
Hi guys,
i have a liitle problem with this script.
If I reg some user and he don't write his password, with command: +pass, even after 5 min -> script should be deleted his registered nick, but script doesn't make this!!!
-> script report this error
Syntax scripts\Reg.lua:154: attempt to index local `user' (a nil value)
function notification(user)
SendPmToOps(bot, "User: "..user.." didn't REG him/herself after "..loginmin.." min.")
user = GetItemByName(user) -- User online?
DelRegUser(user.sName) -- Del user -> THE ERROR IS AT THIS LINE!!!
user:SendPM(bot, "Your time to log in has been expired. Please type again: '"..regcmd.."' to let an OP reg you...")
return 1
end
Thank you in advance for help!
function notification(user)
SendPmToOps(bot, "User: "..user.." didn't REG him/herself after "..loginmin.." min.")
DelRegUser(user)
user = GetItemByName(user)
if user then
user:SendPM(bot, "Your time to log in has been expired. Please type again: '"..regcmd.."' to let an OP reg you...")
end
return 1
end
My bad...Now it works...
The error happend beacuse i checked first if user was online... then delete...
Now it deletes even if user is offline... =)
*Edit*
ops.. fixed an error...
OK Madman -> Thank you very much!!!
Np =)
Post above updated... :D
Very nice script, just one question, would the "+pass" command interfere with Robocop because "+regme" and "+regreg" works but when using "+pass" nothing happens (I have registertags on but no difference after disable it) :))
cheers//Octa
That's weird, because +regreg is also a Robocop command. In the script tab in PtokaX can you move up this script, so it is above the Robocop script. Try that first...
Yup I did but no difference unfortunately =/
I've also tried to disable the reg tag in Robocop, as well I have changed from "+" to "-" prefix in commands in script but "pass" doesnt work anywayz, the other does.
cheers
going to check!
*edited*
I haven't found any bugs! Try to change the "+pass" to something like "#pass" or "$password"...
I don't get it... Btw, I updated the post above, added a notification to the user after using the "+regme" command..
can someone modify this script to like.....if an operator regs some user......thn the operator himself gets a pm from bot which is as below ( as in xsthetic net server)
tell the user Xmen to put the following details in his favourite hubs...
nick - xmen
password - 123456
hub Addy - 178.23.56.86
hub name - Matrix Hub
Script above updated with your request... :D
script working fine..thanks mate...but it is not wat i wanted..
wen i type +regreg Zender ( no password reqd)
i get a pm from bot saying tat..user Zender has been registered by op dkt..he has 5 mins to login..
his name does not appear in ptokax ops/bans..and wen i tried to connected by nick Zender..i couldnt connect...
as my hub is only for registered users..i want a script tat would register users with command like
!addreguser nick password reg
thn after i do this i shld get a pm from bot displaying this message...
nick has been registered successfully..please tell him to add these details in his favourite hubs -
nick - nick
password - password
hub Addy - 178.23.56.86
hub name - Matrix Hub
thn i would copy paste these details to the user who is in some other hub...
can any1 modify the script like this ?
QuoteOriginally posted by dkt
script working fine..thanks mate...but it is not wat i wanted..
wen i type +regreg Zender ( no password reqd)
i get a pm from bot saying tat..user Zender has been registered by op dkt..he has 5 mins to login..
his name does not appear in ptokax ops/bans..and wen i tried to connected by nick Zender..i couldnt connect...
His name is indeed not banned / registrated. The name is saved in memory! The name will be erased after 5 min (or what you want)... This is also the time the user can reg himself with a password. So an OP doesn't REG the user, it only put the current name in memory so the user can REG himself! That will indeed give probs for you REG only hub, he can't login ghehe.
QuoteOriginally posted by dkt
as my hub is only for registered users..i want a script tat would register users with command like
!addreguser nick password reg
thn after i do this i shld get a pm from bot displaying this message...
nick has been registered successfully..please tell him to add these details in his favourite hubs -
nick - nick
password - password
hub Addy - 178.23.56.86
hub name - Matrix Hub
thn i would copy paste these details to the user who is in some other hub...
can any1 modify the script like this ?
If you want to have this, I can try to make that... But I recommend to use a script like Robocop. If you don't have any security bot, I wouldn't only use this script. Btw, adding users can also be done with the inbuild commands of PtokaX. The only different is that users can't reg themself... But if you have a REG only hub, the OP should be do that of course!
QuoteOriginally posted by TTB
going to check!
*edited*
I haven't found any bugs! Try to change the "+pass" to something like "#pass" or "$password"...
I don't get it... Btw, I updated the post above, added a notification to the user after using the "+regme" command..
Yup I've changed it to various prefixes but still
#regme and #regreg
works, but not #pass (neither helping change it to #password and similar)
And there are no syntaxx errors.
*EDIT*
I found out why this was not working ^^ I had changed the Bot name to my mainbots name (Robocop Botname) and it seems the +pass didnt work then!
*EDIT*
Some requests along with this ;)
The user getting a notice after +regme, that he/she have to wait for a Operator to accept his/her reg request.
Also a notice when the user typed a password, it's easier to know if the user understood what to do that way :)
cheers
In the main chat will appear the message when a user has regged himself. Would you like to have that notice also to the OPs? Easy to do :D
Please define you request
Ah yeah sry :D
A PM to OPs only (not in mainchat) when the user uses the +pass cmd.
The other one is that when the user use +regme cmd he will receive a message that a Operator must accept his register request :)
cheers
Try thisone (message to user can be changed in settings part):
-- Reg note to OPs by TTB v.2
-- Request by Jerry
-- 18-05-05
-- Added: User can reg himself after he is put in table by Operator, timer also added.
-- Thanx Madman for the finishing the notification function
-- Added: PM to user with hub info and username + pasw. (31-05-05)
-- Little changes for Dj_OcTaGoN (01-06-05)
-----------------------------------
-- ## Settings ## --
--> Here the text to the user who has asked to be regged with command "regcmd"
msguser = "Your request to REG you has been send! Please be patient, an OP will considder your request!"
regcmd = "+regme"
regopcmd = "+regreg"
cpaswcmd = "+pass"
bot = "--REG-Note--"
loginmin = 5 -- time the user has to confirm with his pasw. Else the user will be deleted!
-- ## Please don't change below ## --
RegTable = {}
function Main()
frmHub:RegBot(bot)
SetTimer(1000*60)
StartTimer()
end
function ChatArrival(user,data)
data=string.sub(data,1,string.len(data)-1)
s,e,regger = string.find(data, "%b<>%s+(%S+)")
if regger and regger == regcmd and user.iProfile == -1 then
SendPmToOps(bot, "The user: "..user.sName.." wants to be regged. Please help him.")
user:SendData(bot, msguser)
return 1
elseif regger == regopcmd and user.bOperator then
local s,e,name = string.find(data, "%b<>%s+%S+%s+(%S+)")
if name == nil then
user:SendData(bot, "*** Syntax error! Please use: "..regopcmd.." ")
return 1
else
RegTable[name] = loginmin
SendPmToOps(bot, "User: "..name.." has been registrated by: "..user.sName..". He has "..loginmin.." min. to log in!")
SendPmToNick(name,bot, "You have been registered! Please type "..cpaswcmd.." to complete your registration! You have "..loginmin.." minutes to register!")
return 1
end
elseif regger == cpaswcmd and user.iProfile == -1 then
local s,e,pasw = string.find(data, "%b<>%s+%S+%s+(%S+)")
if pasw == nil then
user:SendPM(bot, "*** Syntax error! Please use: "..cpaswcmd.." ")
return 1
else
if RegTable[user.sName] ~= nil then
AddRegUser(user.sName.."",pasw, 3)
RegTable[user.sName] = nil
SendPmToNick(user.sName,bot, "You have been registered!\r\n\r\n\t"..string.rep("-",60).."\r\n\tUsername:\t"..user.sName.."\r\n\t"..
"Password:\t"..pasw.."\r\n\tHubname:\t"..frmHub:GetHubName().."\r\n\tHub Adress:\t"..frmHub:GetRegServer().."\r\n\t"..
string.rep("-",60).."\r\n\tPlease add this to your Favarites!")
SendPmToOps(bot, "*** Username = "..user.sName.." registered himself succesfully, userlevel = REG.")
return 1
else
user:SendPM(bot,"You are not in memory to be registrated! An OP has to REG you first temporary!")
return 1
end
end
end
end
function OnTimer()
for user,timer in pairs(RegTable) do
if timer > 0 then
RegTable[user] = RegTable[user] - 1
else
notification(user)
RegTable[user] = nil
end
end
end
function notification(user)
SendPmToOps(bot, "User: "..user.." didn't REG him/herself after "..loginmin.." min.")
DelRegUser(user)
user = GetItemByName(user)
if user then
user:SendPM(bot, "Your time to log in has been expired. Please type again: '"..regcmd.."' to let an OP reg you...")
end
return 1
end
ToArrival = ChatArrival
Thx m8 will try it our right away :D
cheers//Octa
Hi
I try the comand +regme and receive this:
<--REG-Note--> The user: Genius wants to be regged. Please help him.
Can?t modify script for this:
<--REG-Note--> Please Op, regist user Genius, the password is xxxx
Sory About my inglish
The user gives the password with the +pass command!
This: <--REG-Note--> The user: Genius wants to be regged. Please help him.
is when a user types "+regme".
The meaning of this script is that users can reg themselves.