!showreg for levithan
 

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

!showreg for levithan

Started by JueLz, 09 August, 2006, 09:12:28

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JueLz

Heys i am needing a !showreg script
i am using levithan and levithan does not have a !showreg Command
can anyone help me?
I am owner of the MzDistortion? Empire
the addy to my hub is mzdistortion.no-ip.org
____________________________________________
--=                        [HT 500]                          =--

TopCat

Quote from: JueLz on 09 August, 2006, 09:12:28
Heys i am needing a !showreg script
i am using levithan and levithan does not have a !showreg Command
can anyone help me?

levithan has it in a nother way. if you clic on the user in the hub and go too your mousemenu. there youll find userinfo. go too there and clic on Show info of selected user  and youll get all the info on that user including his password  ;D
???? TOPCAT'S HOUSE ????

topcat.no-ip.biz:411

jiten

Give this a try then:


--[[

	Registered Users per Profile - LUA 5.0/5.1 by jiten (8/9/2006)

]]--

tSettings = {
	-- Bot Name
	sName = frmHub:GetHubBotName(),

	-- Command Name
	sCommand = "showreg",

	-- RightClick Menu
	sMenu = "Menu"
}

ChatArrival = function(user, data)
	local _,_, to = string.find(data,"^$To:%s(%S+)%sFrom:")
	local _,_, msg = string.find(data,"%b<>%s(.*)|$") 
	-- Message sent to Bot or in Main
	if (to and to == tSettings.sName) or not to then
		-- Parse command
		local _,_, cmd = string.find(msg, "^%p(%S+)")
		-- Exists
		if cmd and tCommands[string.lower(cmd)] then
			cmd = string.lower(cmd)
			-- If user has permission
			if tCommands[cmd].tLevels[user.iProfile] then
				return tCommands[cmd].fFunction(user, msg), 1
			else
				return user:SendData(tSettings.sName, "*** Error: You are not allowed to use this command!"), 1
			end
		end
	end
end

ToArrival = ChatArrival

NewUserConnected = function(user)
	-- Supports UserCommands
	if user.bUserCommand then
		-- For each entry in table
		for i, v in pairs(tCommands) do
			-- If has permission
			if v.tLevels[user.iProfile] then
				-- Send
				user:SendData("$UserCommand 1 3 "..tSettings.sMenu.."\\"..v.tRC[1]..
				"$<%[mynick]> !"..i..v.tRC[2].."&#124;")
			end
		end
	end
end

OpConnected = NewUserConnected

tCommands = {
	[tSettings.sCommand] = {
		fFunction = function(user, data)
			-- Search for profile
			local _,_, profile = string.find(data, "^%S+%s(%S+)$")
			-- Exists
			if profile then
				-- Temporary table
				local tProfiles = {}
				-- Loop through profiles
				for i, v in ipairs(GetProfiles()) do
					-- Add to custom table
					tProfiles[string.lower(v)] = GetProfileIdx(v)
				end
				-- Profile Exists
				if tProfiles[string.lower(profile)] then
					-- Header
					local sMsg, n = "\r\n\r\n\t"..string.rep("=", 35).."\r\n\t\tUsers by Profile - "..
					GetProfileName(tProfiles[string.lower(profile)])..":\r\n\t"..string.rep("-", 70).."\r\n\t", 0
					-- Loop through registered users
					for i, v in ipairs(frmHub:GetRegisteredUsers()) do
						local sStatus = "off"
						-- Look for users with same profile
						if v.iProfile == GetProfileIdx(profile) then
							-- Sum + If online
							n = n + 1; if GetItemByName(v.sNick) then sStatus = "on" end
							-- Add content
							sMsg = sMsg.."\t"..n..". ["..sStatus.."line] "..v.sNick.."\r\n\t"
						end
					end
					-- Send
					user:SendData(tSettings.sName, sMsg)
				else
					user:SendData(tSettings.sName, "*** Error: There isn't such profile!")
				end
			else
				user:SendData(tSettings.sName, "*** Syntax Error: !"..tSettings.sCommand.." <profile name>")
			end
		end,
		tLevels = { [0] = 1, [1] = 1, [2] = 1, [3] = 1, [4] = 1, [5] = 1, },
		tRC = { "Show registered Users", " %[line:Profile Name]" },
	},
}

JueLz

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

speedX

#4
hey jiten...me again....actually i wanted this script command to be used only by some profiles not all.....can u plzz edit this script such tht i can select the profile wich can use this command (like only operator's & master)
Thanking You,

speedX

jiten

Quote from: speedX on 16 August, 2006, 15:01:18
actually i wanted this script command to be used by only by some profiles not all.....can u plzz edit this script such tht i can select the profile wich can use this command....

You just need to edit the tLevels table according to your desired profile permissions:

-- Example:
-- { [Profile number with permission] = 1, }

tLevels = { [0] = 1, [1] = 1, [2] = 1, [3] = 1, [4] = 1, [5] = 1, },

speedX

tLevels = { [0] = 1, [1] = 1, [2] = 0, [3] = 0, [4] = 0, [5] = 0, },
		tRC = { "Show registered Users", " %[line:Profile Name]" },



Now this means tht only Master & operator's can use this command.....rite.....but still wen i login as a reg user in the hub.....i am able use this command....y so??
Thanking You,

speedX

speedX

Thanking You,

speedX

jiten

Quote from: speedX on 16 August, 2006, 15:11:41
tLevels = { [0] = 1, [1] = 1, [2] = 0, [3] = 0, [4] = 0, [5] = 0, },
		tRC = { "Show registered Users", " %[line:Profile Name]" },


Now this means tht only Master & operator's can use this command

Not really.

If you don't want those extra profiles, you must remove them from the table:

tLevels = { [0] = 1, [1] = 1, }

speedX

yup now itz workin....thx dude..
Thanking You,

speedX

SMF spam blocked by CleanTalk