Account Manager 1.11
 

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

Account Manager 1.11

Started by 6Marilyn6Manson6, 21 August, 2006, 13:34:44

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

6Marilyn6Manson6

--Account manager v1.11
--By Dessamator
--Request By 6Marilyn6Manson6 (or something like it)
--Commands :	!regenable	-- to enable an account
--		!regdisable	-- to disable an account	
--		!regstatus	-- to see disabled account
--		!disableprofile	-- to disable an account
--		!enableprofile	-- to enable an account	
--		!dprofiles	-- to see disabled account
--Update To Lua 5.1.1 by 6Marilyn6Manson6   21/08/2006
--Added Set Action For AccountManager by 6Marilyn6Manson6   21/08/2006
--Added Set Action For ProfileManager by 6Marilyn6Manson6   21/08/2006
------------------------------------------------------
tReg = {}
tProfiles = {}
file ="accounts.dat"
file1="profiles.dat"
------------------------------------------------------
--Config BotName
BotName = "[ITA]AmanagerP"			-- frmHub:GetHubBotName(),
------------------------------------------------------
--Set Action For AccountManager
ActionA = 0							( 0=Warn / 1=Disconnect / 2=Kick / 3=Ban / 4=TempBan / 5=Redirect )
TimeBanA = 20						-- TimeBan Account Minute Period
RDA = "hub.no-ip.org"				-- Redirect Hub For Disable Account
------------------------------------------------------
------------------------------------------------------
--Set Action For ProfileManager
ActionP = 0							( 0=Warn / 1=Disconnect / 2=Kick / 3=Ban / 4=TempBan / 5=Redirect )
TimeBanP = 20						-- TimeBan Profile Minute Period
RDP = "hub.no-ip.org"				-- Redirect Hub For Disable Profile
------------------------------------------------------
function Main()
	LoadFromFile(file)
	LoadFromFile(file1)
	if BotName ~= frmHub:GetHubBotName() then
		frmHub:RegBot(BotName, 1, "AccountManager 1.11", "")
	end
end
------------------------------------------------------
function ChatArrival(user,data)
	local data=string.sub(data, 1,-2)
	local s,e,cmd,usr=string.find(data,"%b<>%s+(%S+)%s+(%S+)")
	if cmd and cmd=="!regdisable" and not(tReg[usr]) then
		tReg[usr] = 1
		user:SendData(BotName,usr.." has been disabled!")
		return 1	
	elseif cmd and cmd=="!regenable" and (tReg[usr]) then
		tReg[usr] =nil
		user:SendData(BotName,usr.." has been enabled!")
		return 1
	elseif cmd and cmd=="!disableprofile" and tonumber(usr) then
		tProfiles[usr] = 1
		user:SendData(BotName,GetProfileName(usr).." Profile has been disabled!")
		return 1
	elseif cmd and cmd=="!enableprofile" and tonumber(usr) then 
		tProfiles[usr] = nil 
		user:SendData(BotName,GetProfileName(usr).." Profile has been enabled!")
		return 1
	end
	local s,e,cmd,usr=string.find(data,"%b<>%s+(%S+)")
	if cmd and cmd=="!regstatus" then
		local temp="\r\n\These are the disabled Accounts :\r\n"
		for tUser,pos in pairs(tReg) do
			temp=temp.."\t\Nick :"..tUser.."\r\n"
		end
		user:SendData(BotName,temp)
	elseif cmd and cmd=="!dprofiles" then
		local temp="\r\n\These are the disabled Profiles :\r\n"
		for profile,pos in pairs(tProfiles) do
			temp=temp.."\t\Profile : "..GetProfileName(profile).."\r\n"
		end
		user:SendData(BotName,temp)
	end
end 
------------------------------------------------------
function OnExit()
	SaveToFile(file, tReg,"tReg")
	SaveToFile(file1, tProfiles,"tProfiles")
end
------------------------------------------------------
function ValidateNickArrival(User, Data)
	for usr,pos in pairs(tReg) do
		if User.sName == usr then
			local action = DoDiscA(User, Data)
		return 1
		end
	end
	for profile,pos in pairs(tProfiles) do 
		if User.iProfile == tonumber(profile) then
			local action = DoDiscP(User, Data)
		end
	end
end
------------------------------------------------------
function DoDiscA(User, Data)
		if ActionA==0 then
		User:SendPM(BotName,"You are Warned for Account disabled!") return "Warned"
	elseif ActionA==1 then
		User:SendPM(BotName,"You are Disconnected for Account disabled!")
		User:Disconnect() return "Disconnected"
	elseif ActionA==2 then
		User:SendPM(BotName,"You are Kicked for Account disabled!")
		User:TempBan() return "Kicked"
	elseif ActionA==3 then
		User:SendPM(BotName,"You are Banned for Account disabled!")
		User:Ban() return "Banned"
	elseif ActionA==4 then
		User:SendPM(BotName,"You are TimeBanned for Account disabled!")
		User:TimeBan(TimeBanA) return "TimeBanned"
	elseif ActionA==5 then
		User:SendPM(BotName,"You are Redirect for Account disabled!")
		User:Redirect(RDA) return "Redirect"		
	elseif ActionA~=0 or ActionA~=1 or ActionA~=2 or ActionA~=3 or ActionA~=4 or ActionA~=5 then
		User:SendPM(BotName,"Your Account has been disabled!")
		return 1
	end
end
------------------------------------------------------
function DoDiscP(User, Data)
		if ActionP==0 then
		User:SendPM(BotName,"You are Warned for Profile disabled!") return "Warned"
	elseif ActionP==1 then
		User:SendPM(BotName,"You are Disconnected for Profile disabled!")
		User:Disconnect() return "Disconnected"
	elseif ActionP==2 then
		User:SendPM(BotName,"You are Kicked for Profile disabled!")
		User:TempBan() return "Kicked"
	elseif ActionP==3 then
		User:SendPM(BotName,"You are Banned for Profile disabled!")
		User:Ban() return "Banned"
	elseif ActionP==4 then
		User:SendPM(BotName,"You are TimeBanned for Profile disabled!")
		User:TimeBan(TimeBanP) return "TimeBanned"
	elseif ActionP==5 then
		User:SendPM(BotName,"You are Redirect for Profile disabled!")
		User:Redirect(RDP) return "Redirect"		
	elseif ActionP~=0 or ActionP~=1 or ActionP~=2 or ActionP~=3 or ActionP~=4 or ActionP~=5 then
		User:SendPM(BotName,"Your Profile has been disabled!")
		return 1
	end
end
------------------------------------------------------
function Serialize(tTable, sTableName, sTab)
	assert(tTable, "tTable equals nil");
	assert(sTableName, "sTableName equals nil");
	assert(type(tTable) == "table", "tTable must be a table!");
	assert(type(sTableName) == "string", "sTableName must be a string!");
	sTab = sTab or "";
	sTmp = ""
	sTmp = sTmp..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
					sTmp = sTmp..Serialize(value, sKey, sTab.."\t");
			else
					local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value);
					sTmp = sTmp..sTab.."\t"..sKey.." = "..sValue
			end
			sTmp = sTmp..",\n"
	end
	sTmp = sTmp..sTab.."}"
	return sTmp
end
------------------------------------------------------
function SaveToFile(file , table , tablename)
	local handle = io.open(file,"w+")
	handle:write(Serialize(table, tablename))
	handle:flush()
	handle:close()
end
------------------------------------------------------
function LoadFromFile(file)
	local handle = io.open(file,"r")
	if (handle ~= nil) then
		dofile(file)
		handle:flush()
		handle:close()
	end
end
------------------------------------------------------
--// 6Marilyn6Manson6

speedX

wat is this script all about??
Thanking You,

speedX

6Marilyn6Manson6

VerliHub have 2 commands: !regenable and !regdisable, this script do this 2 commands, do other 2 commands for do this with profile and other 2 commands for see what reg and profile are disabled :)

piraya

Hmmm isent this topic abouth Ptokax script  :P

SMF spam blocked by CleanTalk