some little question how to use this command
GetOnlineRegUsers() and what return
? a number and vor 0 value return nil ?
and this command for specify profile return the specify user profile online , GetOnlineUsers(ProfileNumber)
how to specify the profile number ?
this return a table and not a number ?
and i huve to number the user from the table ?
10x a lot for help
I make some excavations and ai meke next code 8)
--//Reg User Count
function OnlineRegUsers()
local table, count = frmHub:GetOnlineUsers(), 0
for i, User in table do
if User.iProfile >=0 then
count = count + 1
end
end
return count
end
i hope some one to uset :D
here u go:
QuoteGetOnlineUsers(ProfileNumber) - Without number return table with all logged user objects, with number only users with given profile.
QuoteOriginally posted by dragos_sto
some little question how to use this command
GetOnlineRegUsers() and what return
? a number and vor 0 value return nil ?
and this command for specify profile return the specify user profile online , GetOnlineUsers(ProfileNumber)
how to specify the profile number ?
this return a table and not a number ?
and i huve to number the user from the table ?
10x a lot for help
When in doubt, check the "PtokaX\Scripting-Interface.txt" ;)
Cheers
i'm not always understand what they want from me :D
or how to work whit the command,
par example il try to use the command
GetOnlineUsers(ProfileNumber) and put a number between () ..and dont success whit tis command
Try using this:
GetOnlineUsers(GetProfileIdx(ProfileName)) -- where ProfileName is its name (reg,vip,op,master,etc)
Cheers
or this
for i,user in GetOnlineUsers(GetProfileIdx(ProfileName)) do -- where ProfileName is its name reg,vip,op,master,etc)
SendToAll(user)
end
hi , i dont whant to make vizible to all , just whant to make my own statisitc :)
If you want to know the online reg users why don't u use:
frmHub:GetOnlineRegUsers()
Cheers
well use let me explain it better then, the
frmHub:GetOnlineRegUsers()
is just a table of online users, for example if u have a hub with 3 users, namely , John , JJ and Joe.
What that api(frmHub:GetOnlineRegUsers()) does is simply, take those 3 users and put it in a table like so::
onlineusers ={[1]="John",
[2]="JJ",
[3]="Joe",}
and all u need to do is read from it(the table), and use it for ur purposes!
true it a lite bate faster ,
one question less for each user
but to obtain a number the for remain :(
QuoteOriginally posted by dragos_sto
true it a lite bate faster ,
one question less for each user
but to obtain a number the for remain :(
Can you explain us what exactly u want to do? Maybe we can post a script that can help u understand.
Best regards.
QuoteOriginally posted by jiten
QuoteOriginally posted by dragos_sto
true it a lite bate faster ,
one question less for each user
but to obtain a number the for remain :(
Can you explain us what exactly u want to do? Maybe we can post a script that can help u understand.
Best regards.
indeed !!
10x a lot for help whit the script,
i realy want to know the sintax
exactly (whit one example ) for each command
to create my own script , in lua 4 brainmaster make a verry good script ho dont was compile ,
so i may change'it for my need ,
and understend some command from him ,
now i try to understeand how to use the new command ,
and whit some help i understend few command
shame for me :( , i dont have enough time to make
test and this it the reason i try to find more whit your help in little time i have
my own script will be public when i will finish him ..
i'm crazy whit statistics
Have a look at this then:
-- frmHub:GetOnlineUsers example : Send PM to all user of a certain profile (VIP in this one)
Bot = frmHub:GetHubBotName()
ChatArrival = function (user,data)
data = string.sub(data, 1, -2)
local s,e,cmd,args = string.find( data, "%b<>%s+(%S+)%s*(.*)")
if cmd == "!msgvip" then
if user.bOperator then
if args then
for i, nick in frmHub:GetOnlineUsers() do
if nick.iProfile == 2 then
nick:SendPM(Bot, user.sName.." sent this message: "..args)
end
end
else
user:SendData(Bot, "*** Syntax Error: Type !msgvip msg")
end
else
user:SendData(Bot,"*** Error: You are not allowed to use this command.")
end
return 1
end
end
-- frmHub:GetOnlineRegUsers example : Send PM to all REG Profile users
Bot = frmHub:GetHubBotName()
ChatArrival = function (user,data)
data = string.sub(data, 1, -2)
local s,e,cmd,args = string.find( data, "%b<>%s+(%S+)%s*(.*)")
if cmd == "!msgreg" then
if user.bOperator then
if args then
for i, nick in frmHub:GetOnlineRegUsers() do
nick:SendPM(Bot, user.sName.." sent this message: "..args)
end
else
user:SendData(Bot, "*** Syntax Error: Type !msgreg msg")
end
else
user:SendData(Bot,"*** Error: You are not allowed to use this command.")
end
return 1
end
end
Cheers
I'm trying to write something similar - ie a per profile lister... but it wont work for the UNREGGED users
i've tried using profile -1 but doesnt work :(
can anyone please help ???
function GetUsers(user,data,arg)
if arg==nil then
arg1 = "Unregistered"
else
arg1 = GetProfileName(arg)
end
user:SendPM(BOTName ,"------ Users of type: "..arg1.." ----- ")
for i,usr in frmHub:GetOnlineUsers() do
if arg == nil and usr.iProfile == nil then
user:SendPM(BOTName,"Unregged\t - \t"..usr.sName)
elseif usr.iProfile == tonumber(arg) then
user:SendPM(BOTName,GetProfileName(usr.iProfile).."\t - \t"..usr.sName)
end
end
return 1
end
function GetUsers(user,data,arg)
if arg==nil then
arg1 = "Unregistered"
else
arg1 = GetProfileName(arg)
end
user:SendPM(BOTName ,"------ Users of type: "..arg1.." ----- ")
for i,usr in frmHub:GetOnlineUsers() do
if arg == nil and not(usr.bRegistered) then
user:SendPM(BOTName,"Unregged\t - \t"..usr.sName)
elseif usr.iProfile == tonumber(arg) then
user:SendPM(BOTName,GetProfileName(usr.iProfile).."\t - \t"..usr.sName)
end
end
return 1
end
Done!!,
(Untested)
Many thanks -- sorted now
didnt even think of that heheheheh
QuoteOriginally posted by Stravides
Many thanks -- sorted now
didnt even think of that heheheheh
yw, :))