Author Topic: YnHub Register to PtokaX  (Read 4536 times)

0 Members and 1 Guest are viewing this topic.

Offline Tw?sT?d-d?v

  • Lord
  • ***
  • Posts: 436
  • Karma: +79/-2
    • EURO-OP
YnHub Register to PtokaX
« on: 21 July, 2007, 22:31:50 »
If not to much trouble can some1 convert this to work in latest PtokaX ( or point me to a working version )
Code: [Select]
--//----------------------------------------------------------------------------------------------->>
--//-- 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

PtokaX forum

YnHub Register to PtokaX
« on: 21 July, 2007, 22:31:50 »

Offline Tw?sT?d-d?v

  • Lord
  • ***
  • Posts: 436
  • Karma: +79/-2
    • EURO-OP
Re: YnHub Register to PtokaX
« Reply #1 on: 21 July, 2007, 23:26:31 »
t6hx m8  working here now  :)

Offline ExtreeM

  • Forum Ace
  • *****
  • Posts: 83
  • Karma: +33/-6
Re: YnHub Register to PtokaX
« Reply #2 on: 08 December, 2007, 13:37:27 »
what seems to be tha problem here???

Code: [Select]
--//----------------------------------------------------------------------------------------------->>
--//-- 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

Offline Gnuff?

  • Double Ace
  • *
  • Posts: 121
  • Karma: +21/-1
    • ?????Gnuff?s Hideout??????
Re: YnHub Register to PtokaX
« Reply #3 on: 29 December, 2007, 22:13:41 »
I guess this:
Code: [Select]
FileName = "E:\Ynhub\settings\accounts.xml"should be:
Code: [Select]
FileName = "E:\\Ynhub\\settings\\accounts.xml"
Gnuff

PtokaX forum

Re: YnHub Register to PtokaX
« Reply #3 on: 29 December, 2007, 22:13:41 »