PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: Mihalich666 on 15 November, 2005, 16:14:34

Title: HELP SCRIPT
Post by: Mihalich666 on 15 November, 2005, 16:14:34
All greetings!!! Who can help me with a script which would fix IP all users which come to me on the center. And if necessary on what to a command would deduce them ??? IP ` s??? For example: a command nick ===> it IP ` s.
And on the contrary: command IP ` s ===> it nick.
Sorry for my English. I hope my request to you it is clear:))
I wait for the answer...
Title:
Post by: Rincewind on 15 November, 2005, 19:39:47
Is this what you're wanting?

--[[
Get Nick from IP or IP from Nick
by Rincewind (15/11/05)
]]

sBot = "UserInfo"
sPrefix = "+"

function ChatArrival(curUser,data)

data = string.sub(data,1,-2)
local s,e,cmd = string.find(data, "%b<>%s+[%"..sPrefix.."](%S+)")
local s,e,getuser = string.find(data, "%b<>%s+%S+%s+(%S+)")

if cmd == "getip" then
if curUser.bOperator then
local user = GetItemByName(getuser)
if user then
curUser:SendData(sBot, getuser.." has the IP of "..user.sIP)
else
curUser:SendData(sBot, "The nick "..getuser.." is not in use")
end
return 1
else
curUser:SendData(sBot,"You are not permitted to use this command") return 1
end
return 1
elseif cmd == "getnick" then
founduser = nil
for i,user in frmHub:GetOnlineUsers() do
if user.sIP == getuser then
if founduser then
founduser = founduser..", "..user.sName
else
founduser = user.sName
end
end
end
if founduser then
curUser:SendData(sBot, getuser.." has the nick of "..founduser)
else
curUser:SendData(sBot, "The IP address "..getuser.." is not in use")
end
return 1
end

end
Title:
Post by: Mihalich666 on 16 November, 2005, 15:43:55
Now I shall test;)) but in any case of thanks for the answer)
Title:
Post by: Mihalich666 on 16 November, 2005, 16:50:42
Many thanks all perfectly works. Only I would like from this boat also that that it defined IP ` s and nick ` s users taking place in offline, but earlier coming on my center.
Whether it is possible to make an additional file which remembered them IP ` s and nick ` s?
Sorry for my bad English.