HELP SCRIPT
 

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

HELP SCRIPT

Started by Mihalich666, 15 November, 2005, 16:14:34

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mihalich666

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...

Rincewind

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

Mihalich666

Now I shall test;)) but in any case of thanks for the answer)

Mihalich666

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.

SMF spam blocked by CleanTalk