tag hider
 

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

tag hider

Started by VAZ, 26 October, 2004, 06:36:07

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

VAZ

a bot that can hide the tag for ops like in verlihub you can hide the dc++ tag for ops .. is that possible?


Herodes

#1
Try this 1 ...
--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- 
--- OpTagHider v1 
--- by Herodes
--- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
--- it hides the tag of the operators in the Hub .. ;o)

--- initialise a new table ...
ToSent = {}

--- when a new user or an op connects sent to him the changed myinfo's
function NewUserConnected(user)
	-- for every stored entry in the table 
	for op, info in ToSent do 
		--- send the info to the user ...
		user:SendData(info)
	end
end
OpConnected = NewUserConnected

--- when an op disconnects delete his info from the storage table 
function OpDisconnected(user)
	--- if there is info on this op in the table ...
	if ToSent[user.sName] then
		--- nil it ...
		ToSent[user.sName] = nil
	end
end

--- when the hub receives a MyINFO then it has to get it disassembled and then store a newly assembled one .. 
function DataArrival(user, data)
	if strsub(data, 1,12) == "$MyINFO $ALL" and user.bOperator then
		--- trim off the pipe "|"
		data= strsub(data, 1, strlen(data)-1)
		--- identify the MyINFO parts ... 
		s,e,descTag, con, email, share = strfind(data, "$MyINFO $ALL%s+"..user.sName.."%s+([^$]*)%$%s%$([^$]*)$([^$]*)%$([^$]*)%$")
		--- split description and tag ...
		local desc, tag = SplitTagDescr(descTag)
		--store the new info in the table ..
		ToSent[user.sName] = "$MyINFO $ALL "..user.sName.." "..desc.."--$ $"..con.."$"..email.."$"..share.."$|"
	end
end

--- split the tag from the description the proper way ( watching for a "<" from the end to the start of the string .. 
function SplitTagDescr(str)
	local tag, descr, tTab = "", "", {}
	--- get those letters in the tTab
	for i= 1, strlen(str) do tTab[i] = strsub(str, i,i) end
	--- move backwards until we find a "<"
	local i = getn(tTab)
	repeat 
		tag = tTab[i]..tag
		i = i - 1
	until tTab[i] == "<"
	--- add the missing "<"
	tag = "<"..tag
	--- construct the description
	for l = 1, i-1 do descr = descr..tTab[l] end
	return descr, tag
end

VAZ

ahh thank you it works fine  :))

VAZ

got this now

Syntax error: bad argument #1 to `strlen' (string expected, got nil)
stack traceback:
   1:  function `strlen' [C]
   2:  function `SplitTagDescr' at line 48 [file `...\PtokaX_0.330_15.25 zaturn\scripts\taghider.lua']
   3:  function `DataArrival' at line 38 [file `...\PtokaX_0.330_15.25 zaturn\scripts\taghider.lua']

Syntax error: bad argument #1 to `strlen' (string expected, got nil)
stack traceback:
   1:  function `strlen' [C]
   2:  function `SplitTagDescr' at line 48 [file `...\PtokaX_0.330_15.25 zaturn\scripts\taghider.lua']
   3:  function `DataArrival' at line 38 [file `...\PtokaX_0.330_15.25 zaturn\scripts\taghider.lua']

VAZ

and another if an op connects again after i restart the scripts
the users can see his tag.. and its not untill the user reconnects the tag goes away.

Herodes

QuoteOriginally posted by VAZ
and another if an op connects again after i restart the scripts
the users can see his tag.. and its not untill the user reconnects the tag goes away.
this is fixed .. there has been an edit to the script above ...

as far as the error is concerned .. pls findout the $MyINFO that did it ...  I'll fix it as soon as it is found ... I suppose it is a user with no description ..but I need to be sure .. I'll do more tests as my time allows ..

VAZ

ok will do thanks :)

VAZ

Still does not work

kepp

First the orgiginal will be sent then the fake one, With many users in hub this is no good
Guarding    

SMF spam blocked by CleanTalk