PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: 6Marilyn6Manson6 on 05 December, 2004, 07:37:06

Title: Change Registered Nick
Post by: 6Marilyn6Manson6 on 05 December, 2004, 07:37:06
Hello, I have idea for script.

I search script for change registered nick, example

in xxx hub my Registered nick is   6Marilyn6Manson6   and I want change it with this nick   [ITA]6Marilyn6Manson6   and I with command:

!chgmynick 6Marilyn6Manson6 - [ITA]6Marilyn6Manson6

I.. change my personal nick in [ITA]6Marilyn6Manson6 .
It is possible? Thanks a lot

Title:
Post by: nErBoS on 08 December, 2004, 22:09:53
Hi,

Here you go...

--## CHANGE REGGED NICKS BOT
--## Requested by 6Marilyn6Manson6
--## Made by nErBoS
--## Commands:
--## +changemynick -- Changes your regged nick to a new one

sBot = "CRN-Bot"

fPtokaxPath = "C:\\WorkFolder\\Ptokax\\" -- Put here your Ptokax Folder path

function Main()
frmHub:RegBot(sBot)
end

function DataArrival(user, data)
if (user.iProfile ~= -1 and (strsub(data,1,1) == "<" or strsub(data,1,5+strlen(sBot)) == "$To: "..sBot)) then
data = strsub(data,1,strlen(data)-1)
local s,e,cmd = strfind(data, "%b<>%s+(%S+)")
if (cmd == "+changemynick") then
execute("copy "..fPtokaxPath.."RegisteredUsers.dat")
local s,e,sNick = strfind(data, "%b<>%s+%S+%s+(%S+)")
if (sNick == nil) then
user:SendPM(sBot, "Syntax Error, +changemynick , you must write a nick.")
elseif (strfind(sNick, "[%c|\n\r]")) then
user:SendPM(sBot, "Your nick is invalid. Please choose a new one.")
elseif (CheckNick(sNick) == nil) then
user:SendPM(sBot, "The nick "..sNick.." is already registered.")
else
local sPass = CheckPass(user.sName)
if (sPass == nil) then
user:SendPM(sBot, "Your old pass wasn't found.")
else
AddRegUser(sNick,sPass,user.iProfile)
DelRegUser(user.sName)
user:SendPM(sBot, "The nick "..user.sName.." has been unregged and the new nick "..sNick.." has been regged with your pass and profile.")
user:SendPM(sBot, "Please reconnect with you new nick.")
end
end
remove("RegisteredUsers.dat")
return 1
end
end
end

function CheckNick(sNick)
readfrom("RegisteredUsers.dat")
while 1 do
local sLine = read()
if (sLine == nil) then
readfrom()
return 1
else
local s,e,sOldNick = strfind(sLine, "(.+)|.+|%d+")
if (sOldNick ~= nil and strlower(sNick) == strlower(sOldNick)) then
readfrom()
return nil
end
end
end
end

function CheckPass(sNick)
readfrom("RegisteredUsers.dat")
while 1 do
local sLine = read()
if (sLine == nil) then
readfrom()
return nil
else
local s,e,sOldNick,sOldPass = strfind(sLine, "(.+)|(.+)|%d+")
if (sOldNick ~= nil and sOldPass ~= nil and strlower(sNick) == strlower(sOldNick)) then
readfrom()
return sOldPass
end
end
end
end

Best regards, nErBoS
Title:
Post by: 6Marilyn6Manson6 on 08 December, 2004, 22:39:27
I nErBoS.. thanks a lot for script, but I have problem. In my hub tester my registerd nick is:   ReVeReNDo and I'm master but... I want change my nick in   6Marilyn6Manson6, I write:

+changemynick 6Marilyn6Manson6

but .. my nick not change and receive:   [22:37] Your old pass wasn't found.

Why? thanks
Title:
Post by: bastya_elvtars on 08 December, 2004, 23:22:22
QuoteOriginally posted by 6Marilyn6Manson6
I nErBoS.. thanks a lot for script, but I have problem. In my hub tester my registerd nick is:   ReVeReNDo and I'm master but... I want change my nick in   6Marilyn6Manson6, I write:

+changemynick 6Marilyn6Manson6

but .. my nick not change and receive:   [22:37] Your old pass wasn't found.

Why? thanks

fPtokaxPath = "C:\\WorkFolder\\Ptokax\\" -- Put here your Ptokax Folder path
Didn't you forget that backlashes have to be double?

C:\\Program Files\\PtokaX
Title:
Post by: 6Marilyn6Manson6 on 09 December, 2004, 08:35:14
No No, I insert complete path:

fPtokaxPath = "C:\Documents and Settings\server\Documenti\DC++\-= MY HUB =-\planetarium.no-ip.org" -- Put here your Ptokax Folder path

but.. not found :(
Title:
Post by: Herodes on 09 December, 2004, 13:27:48
QuoteOriginally posted by 6Marilyn6Manson6
fPtokaxPath = "C:\Documents and Settings\server\Documenti\DC++\-= MY HUB =-\planetarium.no-ip.org" -- Put here your Ptokax Folder path

try it like this ..

fPtokaxPath = "C:\\Documents and Settings\\server\\Documenti\\DC++\\-= MY HUB =-\\planetarium.no-ip.org" -- Put here your Ptokax Folder path

or like this ...

fPtokaxPath = "C:/Documents and Settings/server/Documenti/DC++/-= MY HUB =-/planetarium.no-ip.org" -- Put here your Ptokax Folder path
Title:
Post by: 6Marilyn6Manson6 on 09 December, 2004, 14:25:07
Hi Herodes,

fPtokaxPath = "C:\\Documents and Settings\\server\\Documenti\\DC++\\-= MY HUB =-\\planetarium.no-ip.org" -- Put here your Ptokax Folder path

not found.. and

fPtokaxPath = "C:/Documents and Settings/server/Documenti/DC++/-= MY HUB =-/planetarium.no-ip.org" -- Put here your Ptokax Folder path

not found :C

ufffffffffff ^__^
Title:
Post by: nErBoS on 10 December, 2004, 00:39:22
Hi,

Try this out...

"C:\\Documents and Settings\\server\\Documenti\\DC++\\-= MY HUB =-\\planetarium.no-ip.org\\"

Best regards, nErBoS