A self register script with custom profile ..
 

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

A self register script with custom profile ..

Started by DynamiteN, 03 July, 2007, 22:02:34

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DynamiteN

I need a self registration script
It should be like this ..
the user types..
!regme <upload> <nick> <pass>
so it wouild be like ..
!regme 1.0 DynamiteN password
1.0 is if the user has 1mbit ul ...
but whatever they type in the upload it will appear in theres nick ...

and then a pm get send to them automatic were it says something like this ..

   ------------------------------------------------------------------------------------------
   :::::::::::::::: You Have Been Registerd With the Following nick and password :::::::::::::::::
   ------------------------------------------------------------------------------------------
   || Nick:............. [1.0]DynamiteN                                                                               ||
   || pass:...........  password                                                                                       ||
   || Hub Adress:... xxx.xxx.xxx.xxx                                                                                ||
   || Hub name:......--=Godess=--                                                                                 ||
   ------------------------------------------------------------------------------------------
   :::::::::::::::::::::::::::Please change you're nick and reconnect:::::::::::::::::::::::::::::::::
   ------------------------------------------------------------------------------------------
Could any one maybe be kind and do this for me ???...
i would appriecheate (spell?) it

hellooo ..
could at least som1 answer if they want or can do this kind of script for me ?? ..
so i know if i have to come up with another solution ??

PLLLEeeeeeeaaasseeeeee ;)

Madman

I'll do it, but tomorrow, if i'm not to busy...
btw, why should they write there nick? wouldnt !regme <upload> <password> be enough?
the script can get the nick by itself
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

DynamiteN

#2
yeah i guess....

baba.runner

Quote from: Madman on 04 July, 2007, 22:01:05
...
btw, why should they write there nick? wouldnt !regme <upload> <password> be enough?
the script can get the nick by itself
I even recommend that the script should take the nick by itself.
Otherwhise a user could register other user then himself, what is absolutely not recommended.

DynamiteN

yeah i agree ... the nick won't be needed there then ..
aslong as that upload comes in the front of the nick inside the "[ ]" ...

Madman

I worked  7-19 today, so i'm to tierd... i did some scripting...

I'm gonna add a table whre you can add the uplaod prefix you want to allow.
Beacuse if you allow any kind, you will probarly end up with user regging [ImSoCool]usernick.
I'm also gonna add cmds so Ops can add/remove prefixes...
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

DynamiteN

yeah that would be greeaaatt.. ;)...
i'm guessing you're a guy ..
but if not i would kiss you for doing this   :-* 8)

bastya_elvtars

Quote from: DynamiteN on 05 July, 2007, 20:15:37
yeah that would be greeaaatt.. ;)...
i'm guessing you're a guy ..
but if not i would kiss you for doing this   :-* 8)

Leave sexuality for the dying Capitalism. :-P
Everything could have been anything else and it would have just as much meaning.

DynamiteN


Madman

#9
Code: lua
-- Upload prefix regme
-- Made by Madman
-- Request by DynamiteN

Bot = frmHub:GetHubBotName()

function Main()
	frmHub:RegBot(Bot)
	local file = io.open("Uploads.dat") -- Open file
	if file then -- if could open file
		file:close() -- close it
	else -- if could not open
		file = io.open("Uploads.dat","w+") -- open in write mode
		file:write("Uploads = {\n}") -- write
		file:close()
	end
	LoadFromFile("Uploads.dat")
end

function ChatArrival(user,data)
	local data = string.sub(data,1,-2)
	local s,e,cmd = string.find(data,"%b<>%s+%p(%S+)")
	if cmd then
		tCmds = {
			["regme"] = function(user,data)
				if user.bRegistered == nil then
					local s,e,ul,pwd = string.find(data,"%b<>%s+%S+%s+(%S+)%s+(%S+)")
					InTable = nil
					if ul and pwd then
						for _,tUl in ipairs(Uploads) do
							if tUl == ul then
								InTable = 1
							end
						end
						if InTable then
							Nick = "["..ul.."]"..user.sName
							AddRegUser(Nick,pwd,3)
							Msg = "\r\n\r\n"..
							"------------------------------------------------------------------------------------------\r\n"..
							":::::::::::::::: You Have Been Registerd With the Following nick and password :::::::::::::::::\r\n"..
							"------------------------------------------------------------------------------------------\r\n"..
							"II Nick:............. " ..Nick.. "                                                                               II\r\n"..
							"II pass:...........  " ..frmHub:GetUserPassword(Nick).. "                                                                                       II\r\n"..
							"II Hub Adress:... " ..frmHub:GetHubAddress().. ":" ..frmHub:GetHubPort().. "                                                                                II\r\n"..
							"II Hub name:......" ..frmHub:GetHubName().. "                                                                                 II\r\n"..
							"------------------------------------------------------------------------------------------\r\n"..
							":::::::::::::::::::::::::::Please change you're nick and reconnect:::::::::::::::::::::::::::::::::\r\n"..
							"------------------------------------------------------------------------------------------\r\n"
							user:SendPM(Bot,Msg)
						else
							user:SendData(Bot,"The upload prefix you choose is not in the table, please contact an op and inform them of your upload prefix")
						end
					else
						user:SendData(Bot,"Syntax is !" ..cmd.. " <upload> <passowrd>")
					end
				end
			end,
		["addul"] = function(user,data)
			if user.bOperator then
				local s,e,ul = string.find(data,"%b<>%s+%S+%s+(%S+)")
				for i,tUl in ipairs(Uploads) do
					if tUl == ul then
						InTable = 1
					end
				end
				if InTable then
					user:SendData(Bot, "Allready in table")
				else
					Uploads[table.maxn(Uploads) + 1] = ul
					SaveToFile("Uploads.dat",Uploads,"Uploads")
					LoadFromFile("Uploads.dat")
					user:SendData(Bot,ul.. " added to table")
				end
			end
		end,
		["delul"] = function(user,data)
			if user.bOperator then
				local s,e,ul = string.find(data,"%b<>%s+%S+%s+(%S+)")
				for i,tUl in ipairs(Uploads) do
					if tUl == ul then
						InTable = 1
						I = i
					end
				end
				if InTable then
					Uploads[I] = nil
					SaveToFile("Uploads.dat",Uploads,"Uploads")
					LoadFromFile("Uploads.dat")
					user:SendData(Bot,ul.. " removed from table")
				else
					user:SendData(Bot, "Not in table")
				end
			end
		end,
		}
		if tCmds[cmd] then
			return tCmds[cmd](user,data),1
		end
	end
end

-- Serialize by nErBoS
function Serialize(tTable, sTableName, sTab)
	assert(tTable, "tTable equals nil");
	assert(sTableName, "sTableName equals nil");
	assert(type(tTable) == "table", "tTable must be a table!");
	assert(type(sTableName) == "string", "sTableName must be a string!");
	sTab = sTab or "";
	sTmp = ""
	sTmp = sTmp..sTab..sTableName.." = {\n"
	for key, value in pairs(tTable) do
		local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key);
		if(type(value) == "table") then
			sTmp = sTmp..Serialize(value, sKey, sTab.."\t");
		else
			local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value);
			sTmp = sTmp..sTab.."\t"..sKey.." = "..sValue
		end
		sTmp = sTmp..",\n"
	end
	sTmp = sTmp..sTab.."}"
	return sTmp
end

function SaveToFile(file , table , tablename)
	local handle = io.open(file,"w+")
	handle:write(Serialize(table, tablename))
	handle:flush()
	handle:close()
end

function LoadFromFile(filename)
	local f = io.open(filename)
	if f then
		local r = f:read("*a")
		f:flush()
		f:close()
		local func,err = loadstring(r)
		if func then x,err = pcall(func) end
	end
end


All upload prefixes wil be saved in Uploads.dat
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

DynamiteN


SMF spam blocked by CleanTalk