PtokaX forum

Archive => Archived 5.0 boards => Finished Scripts => Topic started by: Paco on 17 September, 2005, 18:28:15

Title: GetProfileList Script for LUA5
Post by: Paco on 17 September, 2005, 18:28:15
My OPs where making me crazy because they didn't had a straight, simple manner of obtaining updated list of the profiles. I searched a littkle bit and I come other the friend Mutor's script. With my few knowledges I translated the functions to LUA 5 and here it is for all those who need it.
--- Original author: Mutor, original source: LUA4
---comands: +listreg / +listvip / +listop / +listmod / +listmaster / +listfounder / +listall
bot = frmHub:GetHubBotName()  --- system bot name
---use with command
Prefix = "+"
---filter command in main chat
function ChatArrival (user, data)
if user.bOperator then
local s,e,cmd = string.find(data, "%b<>%s+(%S+)(%S+)")
if cmd == Prefix.."listreg" then
Show(user,"Reg")
elseif cmd == Prefix.."listvip" then
Show(user,"VIP")
elseif cmd == Prefix.."listop" then
Show(user,"Operator")
elseif cmd == Prefix.."listmod" then
Show(user,"Moderator")
elseif cmd == Prefix.."listmaster" then
Show(user,"Master")
elseif cmd == Prefix.."listfounder" then
Show(user,"NetFounder")
elseif cmd == Prefix.."listall" then
Show(user,"Reg")
Show(user,"VIP")
Show(user,"Operator")
Show(user,"Moderator")
Show(user,"Master")
Show(user,"NetFounder")
end
else
end
end
---Generate List for a given profile
function Show(user,which)
user:SendPM (bot,"")
user:SendPM (bot,"\t\tList for Profile - "..which)
user:SendPM (bot,"\t---<>--------------------------------------------------<>--")
local aux,usr
for aux, usr in GetUsersByProfile(which) do
user:SendPM(bot,"\t\t"..usr)
end
user:SendPM (bot,"")
end
Title:
Post by: chettedeboeuf on 03 October, 2005, 19:34:19
Thank you Mutor

I will test it
Title:
Post by: (-=TrIp-iN-SuN=-) on 10 October, 2005, 20:25:59
how it's work i don't understnad i get all time i talk aboat Mutor script
Title:
Post by: (-=TrIp-iN-SuN=-) on 10 October, 2005, 20:26:53
These are the current profiles, index # and name.

   0 )  -Master
   1 )  -Operator
   2 )  -VIP
   3 )  -Reg
   4 )  -SuperOp
   5 )  -HubOwner

   Type an index number for a profile to get a list of users
Title:
Post by: (-=TrIp-iN-SuN=-) on 10 October, 2005, 21:49:54
yeah it's work tnx