Description Tag LUA 5
 

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

Description Tag LUA 5

Started by ??????Hawk??????, 07 May, 2005, 02:01:29

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

??????Hawk??????

heya peeps  ...  


A re write of an old script  with added bonus ( see commands )




-- Another try ;-)
---Lua 5 Description Tag by ??????Hawk?????? 07-05-2005
--Commands
--
--	!dset [Nick] [Description]		Sets the Description ov a Given User
--	!ddel [Nick]					Sets description back to Normal. Requires user to log back in to clear.
--


HubOwner = "Your-Nick-Here"		--// Set Your Nick Here
Mins =  1						--// Time in mins to update the Tags

tTables = {
tProfiles = {
	["0"]  = {		
		["Enable"] = 1,				--//  1 to enable tag    0 to disable
		["Description"] = "{Master}",	--// Set the Master Tag Here Eg.   ["Description"] = "I AM A MASTER",
		},
	["1"] = {
		["Enable"] = 1,
		["Description"] = "{Op}",		--// Set the Operator Tag Here
		},
	["2"] = {
		["Enable"] = 1,
		["Description"] = "{Vip}",		--// Set the VIP Tag Here
		},
	["3"] = {
		["Enable"] = 1,
		["Description"] = "{Reg}",		--// Set the Reg Tag Here
		},
	["4"] = {
		["Enable"] = 0,
		["Description"] = "{Net Founder}",	--// Set the NetFounder Tag Here
		},
	["5"] = {
		["Enable"] = 0,
		["Description"] = "{Moderator}",		--// Set the Moderator Tag Here
		},
},
tUserCommands = {
	["!dset"] = function(user,data)
		local _,_,dUser,dDescrip = string.find( data, "%b<>%s+%S+%s+(%S+)%s+(.*)" )
		if dUser and dDescrip then
			tTables.tUsers[dUser] = dDescrip
			user:SendData(tBot,dUser.."'s Description is now set to '"..dDescrip..".")
		else
			user:SendData(tBot,"ERR..  Command is.... !dset [Nick] [Description]")
		end
		return 1
	end,


	["!ddel"] = function(user,data)
		local _,_,dUser = string.find( data, "%b<>%s+%S+%s+(%S+).*" )
		if dUser then
			tTables.tUsers[dUser] = nil
			user:SendData(tBot,dUser.."'s Description is now set to Normal.")
		else
			user:SendData(tBot,"ERR..  Command is....  !ddel [Nick]")
		end
		return 1
	end,
},
tUsers = {},

}

tBot = frmHub:GetHubBotName()
timer = 60000 * Mins
function Main() 
	SetTimer(timer)
	StartTimer() 
end 

function OnTimer()
	for tProfile,tInfo in tTables.tProfiles do
		if tTables.tProfiles[tProfile]["Enable"] == 1 then
			for x,usr in frmHub:GetOnlineUsers(tProfile) do
				local userToShow = GetItemByName(usr["sName"])
				local s,e,name,desc,speed,email,share = string.find(userToShow.sMyInfoString, "$MyINFO $ALL (%S+)%s+([^$]*)$ $([^$]*)$([^$]*)$([^$]+)")
					if tTables.tUsers[userToShow.sName] then
						SendToAll( "$MyINFO $ALL "..name.." "..tTables.tUsers[userToShow.sName].."$ $"..speed.."$"..email.."$"..share.."$")
					else
						SendToAll( "$MyINFO $ALL "..name.." "..tTables.tProfiles[tProfile]["Description"].." "..desc.."$ $"..speed.."$"..email.."$"..share.."$")
					end
			end
		end
	end
end

function ChatArrival(curUser, data)
	data = string.sub(data,1,string.len(data)-1)
	local _,_,tCmd = string.find( data, "%b<>%s+(%S+).*" )
		if tCmd  and curUser.sName == HubOwner then
			if tTables.tUserCommands[tCmd] then
				return tTables.tUserCommands[tCmd](curUser, data)
			end
		end

end



Have Fun Peeps


??????Hawk??????

vadertje

it works great but there is some thing not good i have by all users the same discription but i have take for every profile difrent 1 and now every 1 have the vip discription :(

??????Hawk??????

QuoteOriginally posted by vadertje
it works great but there is some thing not good i have by all users the same discription but i have take for every profile difrent 1 and now every 1 have the vip discription :(

Please explain more.. i dont understand the problem ...  

all seems to work fine this end  


??????Hawk??????

GeceBekcisi

#3
I tried to add unregged users as this but it didint work (I remember profile number of unregs is -1, am i wrong?)

["-1"] = {
		["Enable"] = 1,
		["Description"] = "{User}",		--// Set the User Tag Here
		},
Do you need an advanced user handling script? Download UserBekcisi today (Latest Edit)
Features: User + ISP + GeoIP database, user info + share checking and many more...

6Marilyn6Manson6

QuoteOriginally posted by GeceBekcisi
I tried to add unregged users as this but it didint work (I remember profile number of unregs is -1, am i wrong?)

["-1"] = {
		["Enable"] = 1,
		["Description"] = "{User}",		--// Set the User Tag Here
		},

You can add only profile of registered user.. User with profile -1 not is user registered and... not work ;)

SMF spam blocked by CleanTalk