Regme (request for reg)
 

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

Regme (request for reg)

Started by Jerry, 18 May, 2005, 22:31:35

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

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!!!

6Marilyn6Manson6

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

TTB

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
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

Jerry

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!  :))

TTB

#4
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
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

Jerry

Thank you very much for the script TTB!!!
It's great -> that is, what I need it!!! ;)

Jerry

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!

Madman

#7
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
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Jerry

Thank you very much Madman!!!
Script work great at this time -> THX  :]

TTB

Thanx madman for finishing it... ghehe, stupid to forgot that lines  :D
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

Madman

We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Jerry

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!

Madman

#12
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...
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Jerry

OK Madman -> Thank you very much!!!

Madman

We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

TTB

Post above updated...  :D
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

Dj_OcTaGoN

#16
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


TTB

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...
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

Dj_OcTaGoN

#18
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


TTB

#19
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..
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

dkt

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

TTB

Script above updated with your request... :D
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

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...

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 ?

TTB

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!
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

Dj_OcTaGoN

#24
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


SMF spam blocked by CleanTalk