TeamBot
 

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

TeamBot

Started by CyberChris, 16 August, 2006, 15:20:55

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CyberChris

Hi people !
I've problem with this script :

Code: lua
-- Show All Registered Users 
-- By NightLitch 2003 
-- Modded By [fow]CCCL-NL on 27.05.2004 
-- Adapted for RoboCop V10
-- Updated to LUA 5 by Pothead 
-- 
-- Command: !crew 
-- Command: !showlevel 
------------------------------------------------------------ 
BotName = frmHub:GetHubBotName() 
------------------------------------------------------------ 
NAMES = { 
	["reg"] = "\r\n\t * LES UTILISATEURS REG *", 
	["vip"] = "\r\n\t * LES UTILISATEURS VIP *", 
	["operator"] = "\r\n\t * LES OPERATEURS *", 
	["master"] = "\r\n\t * LES ADMINISTRATEURS *", 
	
} 

function ChatArrival(curUser, data) 
	if (string.sub(data,1,1) == "<" or string.sub(data,1,5+strlen(sBot)) == "$To: "..sBot) then
		data = string.sub(data,1,string.len(data)-1)
		local s, e, cmd, args = string.find(data, "^%b<>%s%+(%a+)%s*(.*)") 
		if not s then return end 
		cmd = string.lower(cmd) 
		if (cmd=="crew") then 
			Msg = "\r\n" 
			ShowRegistered() 
			curUser:SendPM(BotName, Msg) 
		return 1 
		elseif cmd == "showlevel" then 
			Msg = "\r\n" 
			ViewRegs(args) 
			curUser:SendPM(BotName, Msg) 
			return 1 
		end
	end 
end 

function ShowRegistered() 
	ViewRegs("Master") 
	ViewRegs("Operator") 
	ViewRegs("Vip") 
	ViewRegs("Reg") 
	Msg = Msg.."\r\n\t**** FIN DE LA LISTE ****" 
end 

function ViewRegs(Level) 
	tables = nil 
	if tonumber(Level) then 
		if GetProfileName(Level) then 
			Level = GetProfileName(Level) 
			tables = GetUsersByProfile(Level) 
		end 
	else 
		tables = GetUsersByProfile(Level) 
	end 
	if type(tables) == "table" then 
		local temp = {} 
		for index, names in tables do 
			table.insert(temp, names) 
		end 
		table.sort(temp) 
		if table.getn(temp) == 0 then 
			Msg = Msg.."\r\n ".."*** Aucun utilisateur avec ce niveau : "..Level.."\r\n" 
		else 
			Msg = Msg.."\r\n>>=====================================<<" 
			Msg = Msg..NAMES[string.lower(Level)] 
			Msg = Msg.."\r\n>>=====================================<<\r\n" 
			for i=1,table.getn(temp) do 
				local _,_,ProfileName = string.find(temp[i],"(%S+)") 
				if GetItemByName(ProfileName) then 
					Msg = Msg.." "..i.."\t Connect?\t"..ProfileName.."\r\n" 
				else 
					Msg = Msg.." "..i.."\tD?connect?\t\t"..ProfileName.."\r\n" 
				end 
			end 
			Msg = Msg..">>=====================================<<\r\n" 
		end 
	else 
		Msg = Msg.."\r\n ".."*** Aucun utilisateur avec ce niveau : "..Level.."\r\n" 
	end 
end

Can you translate for lua 5.1 please ??
Respect !

CyberChris

speedX

already one !showreg script for Lua 5.1 is available.....
Thanking You,

speedX

bastya_elvtars

#2
Try this:

Code: lua
-- Show All Registered Users 
-- By NightLitch 2003 
-- Modded By [fow]CCCL-NL on 27.05.2004 
-- Adapted for RoboCop V10
-- Updated to LUA 5 by Pothead
-- Lua 5.1 and futile string processing removal by bastya_elvtars 
-- 
-- Command: !crew 
-- Command: !showlevel 
------------------------------------------------------------ 
BotName = frmHub:GetHubBotName() 
------------------------------------------------------------ 
NAMES = { 
	["reg"] = "\r\n\t * LES UTILISATEURS REG *", 
	["vip"] = "\r\n\t * LES UTILISATEURS VIP *", 
	["operator"] = "\r\n\t * LES OPERATEURS *", 
	["master"] = "\r\n\t * LES ADMINISTRATEURS *", 
	
} 
 
function ChatArrival(curUser, data) 
	data = string.sub(data,1,string.len(data)-1)
	local cmd, args = string.match(data, "%b<>%s+(%S+)%s*(.*)") 
	if not s then return end 
	cmd = string.lower(cmd) 
	if (cmd=="!crew") then 
		Msg = "\r\n" 
		ShowRegistered() 
		curUser:SendPM(BotName, Msg) 
	  return 1 
	elseif cmd == "!showlevel" then 
		Msg = "\r\n" 
		ViewRegs(args) 
		curUser:SendPM(BotName, Msg) 
		return 1 
  end
end 
 
function ShowRegistered() 
	ViewRegs("Master") 
	ViewRegs("Operator") 
	ViewRegs("Vip") 
	ViewRegs("Reg") 
	Msg = Msg.."\r\n\t**** FIN DE LA LISTE ****" 
end 
 
function ViewRegs(Level) 
	tables = nil 
	if tonumber(Level) then 
		if GetProfileName(Level) then 
			Level = GetProfileName(Level) 
			tables = GetUsersByProfile(Level) 
		end 
	else 
		tables = GetUsersByProfile(Level) 
	end 
	if type(tables) == "table" then 
		local temp = {} 
		for index, names in pairs(tables) do 
			table.insert(temp, names) 
		end 
		table.sort(temp) 
		if #temp == 0 then 
			Msg = Msg.."\r\n ".."*** Aucun utilisateur avec ce niveau : "..Level.."\r\n" 
		else 
			Msg = Msg.."\r\n>>=====================================<<" 
			Msg = Msg..NAMES[string.lower(Level)] 
			Msg = Msg.."\r\n>>=====================================<<\r\n" 
			for _,v in ipairs(temp) do 
				local ProfileName = string.match(v,"(%S+)") 
				if GetItemByName(ProfileName) then 
					Msg = Msg.." "..i.."\t Connect?\t"..ProfileName.."\r\n" 
				else 
					Msg = Msg.." "..i.."\tD?connect?\t\t"..ProfileName.."\r\n" 
				end 
			end 
			Msg = Msg..">>=====================================<<\r\n" 
		end 
	else 
		Msg = Msg.."\r\n ".."*** Aucun utilisateur avec ce niveau : "..Level.."\r\n" 
	end 
end
Everything could have been anything else and it would have just as much meaning.

CyberChris

Hi bastya_elvtars  ,
I've try ...But nothing (no results and no bugs founds)
for info :
I use Ptokax 0.3.5.1 with leviathan script.

CyberChris

6Marilyn6Manson6

#4
---Original author: Mutor, original source: LUA4
---comands: !listreg / !listvip / !listop / !listmod / !listmaster / !listfounder / !listall
--// Update To Lua 5.1.1 by 6Marilyn6Manson6    27/07/2006
--// Change commands: !listreg / !listvip / !listope / !listmod / !listmas / !listntf / !listall
--// Thanks bastya_elvtars for small help with return commands :)    16/08/2006
----------------------------------------------------
----------------------------------------------------
Prefix = "!"									-- ! + # ? -
BotName = "[ITA]RegList"						-- frmHub:GetHubBotName(),
----------------------------------------------------
UseCMD = {			-- What profile you want blocked 1/yes 0/no	
[0] = 1,			-- Master
[1] = 0,			-- Operator
[2] = 0,			-- VIP
[3] = 0,			-- Registered
[4] = 1,			-- Moderator
[5] = 1,			-- Netfounder
[-1] = 0,			-- Unregistered
}
----------------------------------------------------
function Main()
	if BotName ~= frmHub:GetHubBotName() then
		frmHub:RegBot(BotName)
	end
end
----------------------------------------------------
function ChatArrival(user,data)
	if user.bOperator then
		if UseCMD[user.iProfile]==1 then
		local s,e,cmd = string.find(data, "%b<>%s+(%S+)(%S+)")
			if cmd == Prefix.."listreg" then
				Show(user,"ReG")
				return 1
			elseif cmd == Prefix.."listvip" then
				Show(user,"ViP")
				return 1
			elseif cmd == Prefix.."listope" then	
				Show(user,"OPeRaToR")
				return 1
			elseif cmd == Prefix.."listmod" then
				Show(user,"MoDeRaToR")
				return 1
			elseif cmd == Prefix.."listmas" then
				Show(user,"MaSTeR")
				return 1
			elseif cmd == Prefix.."listntf" then
				Show(user,"NeTFoundeR")
				return 1
			elseif cmd == Prefix.."listall" then
				Show(user,"ReG")
				Show(user,"ViP")
				Show(user,"OPeRaToR")
				Show(user,"MoDeRaToR")
				Show(user,"MaSTeR")
				Show(user,"NeTFoundeR")
				return 1
			end
		end
		else
	end
end
----------------------------------------------------
function Show(user,which)
	user:SendPM(BotName,"")
	user:SendPM(BotName,"")
	user:SendPM(BotName,"\t\tList for Profile - "..which)
	user:SendPM(BotName,"\t---<>--------------------------------------------------<>--")
	local aux,usr
		for aux, usr in pairs(GetUsersByProfile(which)) do
			user:SendPM(BotName,"\t\t"..usr)
		end
	user:SendPM(BotName,"")
	user:SendPM(BotName,"")
end
----------------------------------------------------
--// 6Marilyn6Manson6


Try this

bastya_elvtars

Quote from: CyberChris on 16 August, 2006, 15:55:40
Hi bastya_elvtars  ,
I've try ...But nothing (no results and no bugs founds)
for info :
I use Ptokax 0.3.5.1 with leviathan script.

Umm, the pattern capture was b0rked, edited the above post.
Everything could have been anything else and it would have just as much meaning.

CyberChris

It working fine 6Marilyn6Manson6 !
But , when i tape !reg  (exemple) , in chat we see this command : [19:30:49]<UserX> !listreg


But i'm happy , Thank's  ;)

CyberChris

6Marilyn6Manson6

Quote from: CyberChris on 16 August, 2006, 18:37:40
It working fine 6Marilyn6Manson6 !
But , when i tape !reg  (exemple) , in chat we see this command : [19:30:49]<UserX> !listreg


But i'm happy , Thank's  ;)

CyberChris

Post update with your request. Thanks bastya_elvtars for help :)

SMF spam blocked by CleanTalk