Need this urgent !!!
 

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

Need this urgent !!!

Started by BoyKind, 12 August, 2006, 20:23:51

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

BoyKind

Hi all ! Is there a script here that ca show me a offline user IP ? Justi like in a older edition of Ptoka ... Or cand someone make the script so when I type !getinfo <offline user> it gives me his IP ? I said " !getinfo <offline user> " for an example ... it can be a other command ... PLEASE HELP ME !
With all the respect

UwV

#1
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

BoyKind

thx 4 the reply, but the script has a but ... I think ... when I type !ipinfo <ip> it doesn't react at all ... what could be wrong ?
With all the respect

JueLz

Have you made the Table files?
I am owner of the MzDistortion? Empire
the addy to my hub is mzdistortion.no-ip.org
____________________________________________
--=                        [HT 500]                          =--

BoyKind

yes, I made those .tbl's, I have open them, they save the IP's, but the commands don't work... When I type the command in the mainchat for the bot to give me the IP's info(nick entry, etc.) it doesn't work ...
With all the respect

BoyKind

I found out what the bug was, but now all I need is a script that gives me the offline's nick ... like !getinfo <offline nick> ... This script makes a log history with all the logs and I can't search a certain nick in that log ... like !showlogon <offline nick> . Could someone help ?
With all the respect

UwV

#6
 
Quote from: BoyKind on 15 August, 2006, 07:26:13
I found out what the bug was, but now all I need is a script that gives me the offline's nick ... like !getinfo <offline nick> ... This script makes a log history with all the logs and I can't search a certain nick in that log ... like !showlogon <offline nick> . Could someone help ?
hmm nope the bug was a bad piece of code ...
there is a command to showip  info on on/offline nicknames

i have updated the script above with a "bloated" version (includes usecommands in rightclick and correctedt the bad lines ....

** edit cleaned up messy thingy's in code ..
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

BoyKind

Quote from: UwV on 15 August, 2006, 22:17:31
hmm nope the bug was a bad piece of code ...
there is a command to showip  info on on/offline nicknames

i have updated the script above with a "bloated" version (includes usecommands in rightclick and correctedt the bad lines ....

** edit cleaned up messy thingy's in code ..
and cand you post that updated script here ? or give me the link ? if there is one ...
With all the respect

UwV

Quote from: BoyKind on 17 August, 2006, 22:02:43
and cand you post that updated script here ? or give me the link ? if there is one ...


well it say's  have updated the script above with a "bloated" version

meaning the post above is updated with that versoin
meaning it is right in fornt of you if you  just scroll up this page .. :0)
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

BoyKind

man, thx 4 the script, but this isn't what I asked 4 ... I asked 4 a simple script that gives me the IP of an offline user ... like !userinfo <offline nick> ...
With all the respect

UwV

#10
Quote from: BoyKind on 17 August, 2006, 23:27:13
man, thx 4 the script, but this isn't what I asked 4 ... I asked 4 a simple script that gives me the IP of an offline user ... like !userinfo <offline nick> ...

well it does what you asked for,
in order to show offline nick connected to i't ip
one needs record ip and nicks ..
that is basicly what it does and what it did ..
it it is actually pretty simple.
you got your script.
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

UwV

#11
cleaned and commented...
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

UwV

** last edit: removed the timer to ..
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

UwV

#13
Quote from: UwV on 18 August, 2006, 09:00:08
cleaned and commented...
lool to cleaned indeed (skipped posting the code even )

o.k.,
so now ..

needs only one file,
has no extra's
has only one command and shares it with the inbuild px !getinfo command,
(you get two reply's one from script's botname  and one from  hub 's botname[/color]...


-- PtokaX Lua 5 version by PPK
-- vim:ts=4:sw=4:noet
-- PtokaX OpComExtra.lua 1.1 (Sedulus/20030314) tested on PtokaX 0.3.2.4 IceCube-III-fix3
-- based on OpComExtra.lua for DCH++ by Sedulus
-- created for Cop][Killer of the [TropiCo.se] network
-- no rights reserved (although it would be nice if you kept my name in here)
-- now saves to files, does some otherstuff and is DSN ready ...uwv 
-- to 5.1 uwv
-- usercommands glued in & 5.0/5.1 compatible by uw
 
 -- stripped all "extra" things
 -- still NOT really 5.0-5.1 compatible

-- you need to create 1 file in your scripts folder  named  " ntable.tbl "

bot_name = frmHub:GetHubSecAliasName() -- botname to react to commands in PM 
max_table_siz = 7	-- the maximum number of nick/times per IP and ip/times per nick stored
 
---- script start ----
 
function Main()
	-- if the line below gives you a erro you are using lua 5.0.x (please comment it and this script will work fine for you.)
	table.getn = table.getn or function(tbl) return #tbl end
	if _VERSION == "Lua 5.1" then
		gc = "collect" 
	end

	NickTable = {}		-- store info about Nicks here
	dofile("ntable.tbl")
end
 
 -- Event: arrival of data
function ChatArrival(curUser, sData)
	local msg,loc = isMessageForMe(sData)
	if msg then
		return clientMessage(curUser, msg, loc)
	end
end

-- Checks if this msg is a cmd
function isMessageForMe(data)
	local ret,c,msg = string.find( data, "^%b<> %p(.*)|$" )
	if ret then
		return msg,0
	end
end
 
-- Gets called upon arrival of a chat or pm message
function clientMessage(client, msg, loc)
	if string.sub(msg, 1, 8) == "getinfo " then
		if client.bOperator then
			local nick = string.sub(msg, 9 )
			if NickTable[nick] then
				local str = "userinfo on: "..nick.."\r\n"
				for key, elem in pairs(NickTable[nick]) do
					if key ~= "n" then str = str..elem.."\r\n" end
				end
				messageClient(client, loc, bot_name, str)
			else
				messageClient(client, loc, bot_name, "Sorry my dear, but i have no extra userinfo on: "..nick)
			end
		end
	end
end

-- Send client a message
function messageClient(client, where, from, msg)
	if where == 0 then
		client:SendData("<"..from.."> "..msg.."|")
	end
end

-- Gets called when a new user connects
function userConnected(client)
	local nick = client.sName
	local ip = client.sIP
	-- create tables
	if not NickTable[nick] then NickTable[nick] = {} end
	-- remove first so we scroll (max_table_siz/max_history_siz)
	if table.getn(NickTable[ nick ] ) == max_table_siz then table.remove(NickTable[nick], 1) end
	-- add newest entry
	table.insert(NickTable[nick], os.date()..": "..ip )
end
 
-- Event: new user
function NewUserConnected(curUser)
	return userConnected(curUser)
end
 
-- Event: new op
function OpConnected(curUser)
	return userConnected(curUser)
end
---------------------------------------------- the garbage collector
function Clear() 
	collectgarbage(gc) 
	io.flush() 
end

function OnExit()
	Save_File("ntable.tbl", NickTable, "NickTable")
end
 
----------------------------------------------
-- ripped (with full respect) the next 2 functions from :
 
--Any Table 1.0 LUA 5.1 by Mutor 10/01/05
-- Fetches table structure & data. 
-- Saves tables to file
 
Serialize = function(tTable, sTableName, hFile, sTab)
	sTab = sTab or "";
	hFile:write(sTab..sTableName.." = {\n" );
	for key, value in pairs(tTable) do
		local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key);
		if(type(value) == "table") then
			Serialize(value, sKey, hFile, sTab.."\t");
		else
		local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value);
		hFile:write( sTab.."\t"..sKey.." = "..sValue);
	end
	hFile:write( ",\n");
	end
	hFile:write( sTab.."}");
end
 
Save_File = function(file,table , tablename )
	local hFile = io.open (file , "w")
	Serialize(table, tablename, hFile);
	hFile:close()
end


" if you dont like the deco, just dance to the music "
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

BoyKind

thx mate ;) it works ... almost ... here it is: [00:04] Syntax C:\Volvo Hub\scripts\ipfinder.lua:114: attempt to index local 'hFile' (a nil value) ... when I stop the script and then restart it, it doesn't remember the logs ... please help me ... the script is perfect! I like it! but I want that error fixed. Thank you
With all the respect

UwV

Quote from: BoyKind on 18 August, 2006, 22:13:40
thx mate ;) it works ... almost ... here it is: [00:04] Syntax C:\Volvo Hub\scripts\ipfinder.lua:114: attempt to index local 'hFile' (a nil value) ... when I stop the script and then restart it, it doesn't remember the logs ... please help me ... the script is perfect! I like it! but I want that error fixed. Thank you

oops you are right my mistake ..
function OnExit()
	Save_File("dsn/logs/ntable.tbl", NickTable, "NickTable")
end

should have been
Code: lua
function OnExit()
	Save_File("ntable.tbl", NickTable, "NickTable")
end

fixed in post above
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

BoyKind

With all the respect

Alexinno

#17
UwV, where can i find the lua5 version of this script  ???
I because i can't find it on the forum

modular

5.0.x version http://forum.ptokax.org/index.php?topic=3719#msg38623
but it wont save to file ..
if you do want to save to file .. i think these versions above are 5.0.x  5.1 compatible did you try ?


BoyKind

UwV, I know I said I need a script with only the command "userinfo" , but now I'm asking you if you can modify the script
-- PtokaX Lua 5 version by PPK
-- vim:ts=4:sw=4:noet
-- PtokaX OpComExtra.lua 1.1 (Sedulus/20030314) tested on PtokaX 0.3.2.4 IceCube-III-fix3
-- based on OpComExtra.lua for DCH++ by Sedulus
-- created for Cop][Killer of the [TropiCo.se] network
-- no rights reserved (although it would be nice if you kept my name in here)
-- now saves to files, does some otherstuff and is DSN ready ...uwv 
-- to 5.1 uwv
-- usercommands glued in & 5.0/5.1 compatible by uw
 
 -- stripped all "extra" things
 -- still 5.0-5.1 compatible

-- you need to create 1 file in your scripts folder  named  " ntable.tbl "

bot_name = frmHub:GetHubSecAliasName() -- botname to react to commands in PM 
max_table_siz = 7	-- the maximum number of nick/times per IP and ip/times per nick stored
 
---- script start ----
 
function Main()
	table.getn = table.getn or function(tbl) return #tbl end
	if _VERSION == "Lua 5.1" then
		gc = "collect" 
	else
		gc = ""
	end

	NickTable = {}		-- store info about Nicks here
	dofile("ntable.tbl")
end
 
 -- Event: arrival of data
function ChatArrival(curUser, sData)
	local msg,loc = isMessageForMe(sData)
	if msg then
		return clientMessage(curUser, msg, loc)
	end
end

-- Checks if this msg is a cmd
function isMessageForMe(data)
	local ret,c,msg = string.find( data, "^%b<> %p(.*)|$" )
	if ret then
		return msg,0
	end
end
 
-- Gets called upon arrival of a chat or pm message
function clientMessage(client, msg, loc)
	if string.sub(msg, 1, 8) == "getinfo " then
		if client.bOperator then
			local nick = string.sub(msg, 9 )
			if NickTable[nick] then
				local str = "userinfo on: "..nick.."\r\n"
				for key, elem in pairs(NickTable[nick]) do
					if key ~= "n" then str = str..elem.."\r\n" end
				end
				messageClient(client, loc, bot_name, str)
			else
				messageClient(client, loc, bot_name, "Sorry my dear, but i have no extra userinfo on: "..nick)
			end
		end
	end
end

-- Send client a message
function messageClient(client, where, from, msg)
	if where == 0 then
		client:SendData("<"..from.."> "..msg.."		|")
	end
end

-- Gets called when a new user connects
function userConnected(client)
	local nick = client.sName
	local ip = client.sIP
	-- create tables
	if not NickTable[nick] then NickTable[nick] = {} end
	-- remove first so we scroll (max_table_siz/max_history_siz)
	if table.getn(NickTable[ nick ] ) == max_table_siz then table.remove(NickTable[nick], 1) end
	-- add newest entry
	table.insert(NickTable[nick], os.date()..": "..ip )
end
 
-- Event: new user
function NewUserConnected(curUser)
	return userConnected(curUser)
end
 
-- Event: new op
function OpConnected(curUser)
	return userConnected(curUser)
end
---------------------------------------------- the garbage collector
function Clear() 
	collectgarbage(gc) 
	io.flush() 
end

function OnExit()
	Save_File("ntable.tbl", NickTable, "NickTable")
end
 
----------------------------------------------
-- ripped (with full respect) the next 2 functions from :
 
--Any Table 1.0 LUA 5.1 by Mutor 10/01/05
-- Fetches table structure & data. 
-- Saves tables to file
 
Serialize = function(tTable, sTableName, hFile, sTab)
	sTab = sTab or "";
	hFile:write(sTab..sTableName.." = {\n" );
	for key, value in pairs(tTable) do
		local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key);
		if(type(value) == "table") then
			Serialize(value, sKey, hFile, sTab.."\t");
		else
		local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value);
		hFile:write( sTab.."\t"..sKey.." = "..sValue);
	end
	hFile:write( ",\n");
	end
	hFile:write( sTab.."}");
end
 
Save_File = function(file,table , tablename )
	local hFile = io.open (file , "w")
	Serialize(table, tablename, hFile);
	hFile:close()
end
and upgrade it with that !ipinfo command. Could you do it ?
With all the respect

Alexinno

thx modular , plop's version of the script works but if UvW could convert it to lua 5 , i would like to use this version
i don't think that the above script it's compatible with Px lua 5, gives me this error

PtokaX\scripts\userinfo.lua:22: unexpected symbol near `#'

UwV

i have chaned that line in the post above ..
Code: lua
--from:
table.getn = table.getn or function(tbl) return #tbl end
--to:
table.getn = table.getn or function(tbl) return #(tbl) end

i think that was the problem. .
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

UwV

#22
Quote from: BoyKind on 19 August, 2006, 19:52:46
UwV, I know I said I need a script with only the command "userinfo" , but now I'm asking you if you can modify the script and upgrade it with that !ipinfo command. Could you do it ?

yes i can.

* last edit removed ToArrival
-- PtokaX Lua 5 version by PPK
-- vim:ts=4:sw=4:noet
-- PtokaX OpComExtra.lua 1.1 (Sedulus/20030314) tested on PtokaX 0.3.2.4 IceCube-III-fix3
-- based on OpComExtra.lua for DCH++ by Sedulus
-- created for Cop][Killer of the [TropiCo.se] network
-- no rights reserved (although it would be nice if you kept my name in here)
-- now saves to files, does some otherstuff and is DSN ready ...uwv 
-- to 5.1 uwv
-- usercommands glued in & actually NOT 5.0/5.1 compatible by uw
 
-- this one only does !userinfo & !ipinfo
-- stripped allmost all  "extra" things
 -- still Nt really 5.0-5.1 compatible
 
-- you need to create 2  files in your scripts folder  named   " ntable.tbl "  and  " itable.tbl "
 
bot_name = frmHub:GetHubSecAliasName() -- botname to react to commands in PM 
max_table_siz = 7	-- the maximum number of nick/times per IP and ip/times per nick stored
 
---- script start ----
 
function Main()
	
	-- if the line below gives you a erro you are using lua 5.0.x (please comment it and this script will work fine for you.)
	table.getn = table.getn or function(tbl) return #tbl end
	
	if _VERSION == "Lua 5.1" or _VERSION == "Lua 5.2" then -- ;0)
		gc = "collect" 
	end

	IPTable = {}		-- store info about IP's here
	NickTable = {}		-- store info about Nicks here
	dofile("itable.tbl") 
	dofile("ntable.tbl") 
end
 
-- Gets called upon arrival of a chat or pm message
function clientMessage(client, msg, loc)
	if string.sub(msg, 1, 7) == "ipinfo " then
		if client.bOperator then
			local ip = string.sub(msg, 8)
			if IPTable[ip] then
				local str = "ipinfo on: "..ip.."\r\n"
				for key, elem in pairs(IPTable[ip]) do
					if key ~= "n" then str = str..elem.."\r\n" end
				end
				messageClient(client, loc, bot_name, str)
			else
				messageClient(client, loc, bot_name, "Sorry my love.., no ipinfo on: "..ip)
			end
		end
		return 1
	elseif string.sub(msg, 1, 8) == "getinfo " then
		if client.bOperator then
			local nick = string.sub(msg, 9 )
			if NickTable[nick] then
				local str = "userinfo on: "..nick.."\r\n"
				for key, elem in pairs(NickTable[nick]) do
					if key ~= "n" then str = str..elem.."\r\n" end
				end
				messageClient(client, loc, bot_name, str)
			else
				messageClient(client, loc, bot_name, "Sorry my dear, but i have no extra userinfo on: "..nick)
			end
		end
	end
end
 
-- Gets called when a new user connects
function userConnected(client)
	local nick = client.sName
	local ip = client.sIP
	local level = client.bOperator
	if not level then level = 0 else level = 1 end
	-- create tables
	if not IPTable[ip] then IPTable[ip] = {} end
	if not NickTable[nick] then NickTable[nick] = {} end
	-- remove first so we scroll (max_table_siz/max_history_siz)
	if table.getn(IPTable[ip]) == max_table_siz then table.remove(IPTable[ip], 1) end
	if table.getn(NickTable[ nick ] ) == max_table_siz then table.remove(NickTable[nick], 1) end
	-- add newest entry
	table.insert(IPTable[ip], os.date()..": ["..level.."] "..nick )
	table.insert(NickTable[nick], os.date()..": "..ip )
end
 
-- Checks if this is a message for us
function isMessageForMe(data)
	local ret,c,msg = string.find( data, "^%b<> %p(.*)|$" )
	if ret then
		return msg,0
	end
end
 
-- Send client a message
function messageClient(client, where, from, msg)
	if where == 0 then
		client:SendData("<"..from.."> "..msg.."|")
	end
end
 
 
-- Events: arrival of data
function ChatArrival(curUser, sData)
	local msg,loc = isMessageForMe(sData)
	if msg then
		return clientMessage(curUser, msg, loc)
	end
end
  
-- Event: new user
function NewUserConnected(curUser)
	return userConnected(curUser)
end
 
-- Event: new op
function OpConnected(curUser)
	-- For all operators
	return userConnected(curUser)
end
---------------------------------------------- the garbage collector
function Clear() 
	collectgarbage(gc) 
	io.flush() 
end
 
function OnExit()
	Save_File("itable.tbl", IPTable, "IPTable")
	Save_File("ntable.tbl", NickTable, "NickTable")
end
 
----------------------------------------------
-- ripped (with full respect) the next 2 functions from :
 
--Any Table 1.0 LUA 5.1 by Mutor 10/01/05
-- Fetches table structure & data. 
-- Saves tables to file
 
Serialize = function(tTable, sTableName, hFile, sTab)
	sTab = sTab or "";
	hFile:write(sTab..sTableName.." = {\n" );
	for key, value in pairs(tTable) do
		local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key);
		if(type(value) == "table") then
			Serialize(value, sKey, hFile, sTab.."\t");
		else
		local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value);
		hFile:write( sTab.."\t"..sKey.." = "..sValue);
	end
	hFile:write( ",\n");
	end
	hFile:write( sTab.."}");
end
 
Save_File = function(file,table , tablename )
	local hFile = io.open (file , "w")
	Serialize(table, tablename, hFile);
	hFile:close()
end
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

BoyKind

With all the respect

Alexinno

#24
UwV i don't think this works with Px Lua 5.0.2
still gives me the error above , and with Px Lua 5.1 works fine

SMF spam blocked by CleanTalk