*** Convert YnHub Register to PtokaX
 

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

*** Convert YnHub Register to PtokaX

Started by NightLitch, 23 April, 2005, 18:50:44

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NightLitch

Here is a script that converts YnHub registry to PtokaX:

--//----------------------------------------------------------------------------------------------->>
--//-- 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",
	["OP"] = "Operator",
	["VIP"] = "VIP",
	["Registered"] = "Reg",
}

--//-- Specify the Path to YnHubs Register File
FileName = "filename_here.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
--// NightLitch

Enjoy!
//NL

Snooze

Thanks NightLitch for a quick and great fix for all those poor people still running YnHub

Best regards,

Snooze

NightLitch

Thank you.

Fun that an old "veteran" can be of some use  :D  LooooL

Me Veteran no no no no no no no no no .....  :P

Take care man...
//NL

GeceBekcisi

Getting errors when I use script without any editing except file path,

[14:59:16]  Start Converting YnHub register into PtokaX register 
[14:59:16]  *** Total ( 0 ) registered user(s) is found in YnHub 
[14:59:16]  *** Total ( 0 ) user(s) are registered to PtokaX registry 
[14:59:16]  *** Total ( 0 ) user(s) is not registered because profiles doesn't exist in PtokaX


Couldnt make it work!
Do you need an advanced user handling script? Download UserBekcisi today (Latest Edit)
Features: User + ISP + GeoIP database, user info + share checking and many more...

NightLitch

QuoteOriginally posted by GeceBekcisi
Getting errors when I use script without any editing except file path,

[14:59:16]  Start Converting YnHub register into PtokaX register 
[14:59:16]  *** Total ( 0 ) registered user(s) is found in YnHub 
[14:59:16]  *** Total ( 0 ) user(s) are registered to PtokaX registry 
[14:59:16]  *** Total ( 0 ) user(s) is not registered because profiles doesn't exist in PtokaX


Couldnt make it work!

show me how you typed the part...

Easiest way is to copy the RegFile from YnHub into the Script folder in PtokaX and just enter the filename.
//NL

DarkElf

[13:47:00] Start Converting YnHub register into PtokaX register
[13:47:00] <[Wh???W???W]-?LiAl> #convert

And nothing else..

Ptokax(0.3.3.1)  say:

[13:47] Syntax ...rse dc++\hubserver\0.3.3.1.nt.dbg\scripts\yn2pto.lua:59: attempt to index local `file' (a nil value)
Please sorry my bad english, i'm learning it :-D

\\100Gb ][ MeGaShArE @ I?? - ?u?i?N Owner [/I]
100gb.ifs-fusion.net:666 Only EliTe ShArE min 100gb
-={ I?? - ?u?i?N }=- N??Owner

Snooze

Did you edit this part to fit your settings?

--//-- Specify the Path to YnHubs Register File
FileName = "filename_here.xml"


Snooze

SMF spam blocked by CleanTalk