YnHub Register to PtokaX
 

News:

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

YnHub Register to PtokaX

Started by Tw?sT?d-d?v, 21 July, 2007, 22:31:50

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tw?sT?d-d?v

If not to much trouble can some1 convert this to work in latest PtokaX ( or point me to a working version )
--//----------------------------------------------------------------------------------------------->>
--//-- Convert YnHub Register to PtokaX
--//-- Created by NightLitch 2005-04-23
--//-- To start the convert use specified command bellow in mainchat
--//-- Usage: #convert
--//----------------------------------------------------------------------------------------------->>

--//-- Specify the YnHub Profiles to work with your PtokaX Profiles
--//-- YnHub Profiles   =   PtokaX Profiles
ProfileRegistry = {
	["Supreme-Owner"] = "NetFounder",
	["Owner"] = "Master",
	["Admin"] = "Moderator",
	["TiB-Admin"] = "Moderator",
	["TiB"] = "Operator",
	["OP"] = "Operator",
	["VIP"] = "VIP",
	["Registered"] = "Reg",
}

--//-- Specify the Path to YnHubs Register File
FileName = "C:\Users\Twisted\Documents\My Received Files\accounts.xml"

--//----------------------------------------------------------------------------------------------->>
--//-- Don't Edit
--//----------------------------------------------------------------------------------------------->>
function ConvertYnHubRegisterFile(filename)
    local curTable = {}
    local curNick = ""
    local Count = 0
    local file = io.open(filename, "r")
    for line in file:lines() do
        local s,e,col,value = string.find(line, "<(%S+)>(%S+)<")
        if col and value then
            if col == "Nick" and Count == 0 then
                curNick = value
                curTable[value] = {["Pass"] = "", ["Profile"] = ""}
                Count = Count + 1
            elseif col == "Pass" and Count == 1 then
                curTable[curNick].Pass = value
                Count = Count + 1
            elseif col == "Profile" and Count == 2 then
                curTable[curNick].Profile = value
                Count = 0
            end
        end
    end
    file:close()
    return curTable
end

function ChatArrival(sUser,sData)
	local _,_,Cmd = string.find(sData, "%b<>%s*(%S+)%|")
	if Cmd == "#convert" then
		sUser:SendData("Converter","Start Converting YnHub register into PtokaX register")
		local T = ConvertYnHubRegisterFile(FileName)
		local t,g,b = 0,0,0
		for nick,_ in T do
			t = t + 1
			if ProfileRegistry[T[nick].Profile] and GetProfileIdx(ProfileRegistry[T[nick].Profile]) ~= -1 then
				g = g + 1
				AddRegUser(nick,T[nick].Pass, GetProfileIdx(ProfileRegistry[T[nick].Profile]))
			else
				b = b +1
			end
		end
		sUser:SendData("Converter", "*** Total ( "..t.." ) registered user(s) is found in YnHub")
		sUser:SendData("Converter","*** Total ( "..g.." ) user(s) are registered to PtokaX registry")
		sUser:SendData("Converter","*** Total ( "..b.." ) user(s) is not registered because profiles doesn't exist in PtokaX")
		return 1
	end
end

Tw?sT?d-d?v

t6hx m8  working here now  :)

ExtreeM

what seems to be tha problem here???

--//----------------------------------------------------------------------------------------------->>
--//-- Convert YnHub Register to PtokaX
--//-- Created by NightLitch 2005-04-23
--//-- To start the convert use specified command bellow in mainchat
--//-- Usage: #convert
--//----------------------------------------------------------------------------------------------->>

--//-- Specify the YnHub Profiles to work with your PtokaX Profiles
--//-- YnHub Profiles   =   PtokaX Profiles
ProfileRegistry = {
	["Owner"] = "Master",
	["SU"] = "Operator",
	["DUMP"] = "Operator",
	["OP"] = "Operator",
	["VIP"] = "VIP",
	["VIP1"] = "VIP",
	["VIP2"] = "VIP",
	["VIP3"] = "VIP",
	["Temp"] = "VIP",
	["Musik"] = "VIP",
	["FOR BOTS"] = "VIP",
	["Registered"] = "Reg",
}

--//-- Specify the Path to YnHubs Register File
FileName = "E:\Ynhub\settings\accounts.xml"

--//----------------------------------------------------------------------------------------------->>
--//-- Don't Edit
--//----------------------------------------------------------------------------------------------->>
function ConvertYnHubRegisterFile(filename)
    local curTable = {}
    local curNick = ""
    local Count = 0
    local file = io.open(filename, "r")
    for line in file:lines() do
        local s,e,col,value = string.find(line, "<(%S+)>(%S+)<")
        if col and value then
            if col == "Nick" and Count == 0 then
                curNick = value
                curTable[value] = {["Pass"] = "", ["Profile"] = ""}
                Count = Count + 1
            elseif col == "Pass" and Count == 1 then
                curTable[curNick].Pass = value
                Count = Count + 1
            elseif col == "Profile" and Count == 2 then
                curTable[curNick].Profile = value
                Count = 0
            end
        end
    end
    file:close()
    return curTable
end

function ChatArrival(sUser,sData)
	local _,_,Cmd = string.find(sData, "%b<>%s*(%S+)%|")
	if Cmd == "#convert" then
		sUser:SendData("Converter","Start Converting YnHub register into PtokaX register")
		local T = ConvertYnHubRegisterFile(FileName)
		local t,g,b = 0,0,0
		for nick,_ in pairs(T) do
			t = t + 1
			if ProfileRegistry[T[nick].Profile] and GetProfileIdx(ProfileRegistry[T[nick].Profile]) ~= -1 then
				g = g + 1
				AddRegUser(nick,T[nick].Pass, GetProfileIdx(ProfileRegistry[T[nick].Profile]))
			else
				b = b +1
			end
		end
		sUser:SendData("Converter", "*** Total ( "..t.." ) registered user(s) is found in YnHub")
		sUser:SendData("Converter","*** Total ( "..g.." ) user(s) are registered to PtokaX registry")
		sUser:SendData("Converter","*** Total ( "..b.." ) user(s) is not registered because profiles doesn't exist in PtokaX")
		return 1
	end
end
--// NightLitch

Gnuff?

I guess this:
FileName = "E:\Ynhub\settings\accounts.xml"

should be:
FileName = "E:\\Ynhub\\settings\\accounts.xml"
Gnuff

SMF spam blocked by CleanTalk