passive and blocked user counter
 

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

passive and blocked user counter

Started by dreveltje, 25 January, 2005, 10:25:02

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dreveltje

Hi there.
this is the first time i write to this forum,so let's make it a good one.
what i want to do is:
count total users in the hub,count the passive users in the hub,and count the not-registered users in the hub.
why?
i want to let the script sen a pm to all the passive users and tell them that they can't download from the other passive users.in the pm should be te ammount of passive users that are in the hub,and the active
the same i want with te not registered users.
and can this be done with a timer?so they will get a message everey 6 hour or so?
don't know what happens when a user is a non registered passive user ?(  :O
is ther also a way to limit the ammount of passive users in the hub?
so if i set the max to 150 passive users,all the other passive users will be rederected to the network?
ok,this is it for now
thanks for the time it took reading this message,
seeya,
greetings dreveltje.

enema

the Idea is not bad at all, only thing there (AFAIK) isint such a function that counts active or passive users (If there is, then post it here)

dreveltje

okey i am trying to get this script working,somehow it doesn't send a pm.i have made a textfile in my scriptsmap so that isn't the problem.
i know this script works,because i've used it before.



botsName = "HeyPassive"            --- Change this to whatever u want
TxtPassive = "getactive.txt"            --- be sure to have a file corresponding to this one in the 'scripts'
passivecmd = "!goactive"            --- change this to whatever u want ...
countOPs = 0               --- if u want your Operators to receive such pm then put this equal to 1
secs = 1000
mins = 60*secs
timerinterval = 59*secs            --- I hope this is clear enough ...

function Main()
tPassiveUsers = {n=0};            --- don't touch this one ...
frmHub:UnregBot(botsName)            --- Unreg the Bot from the NickList, ( using the string defined by the ' botsName ' value )
frmHub:RegBot(botsName)            --- and Register it again ... ( using the string defined by the ' botsName ' value, again )
SetTimer(timerinterval)
StartTimer()
end

function OnTimer()
for index, nick in tPassiveUsers do
   SendPmToNick(nick, botsName, ReadTextFile(TxtPassive))
end
end

function OpConnected(user)
if ( countOPs == 1 ) then
NewUserConnected(user)
end
end

function NewUserConnected(user)
if ( strfind(user.sMyInfoString, ",M:P,") ) then
   tinsert(tPassiveUsers, (getn(tPassiveUsers)+1), user.sName)
end
end

function UserDiconnected(user)
if user.sName == tPassiveUsers then
   tremove(tPassiveUsers, user.sName)
end
end

function OpDisconnected(user)
if ( countOPs == 1 ) then
UserDiconnected(user)
end
end

function DataArrival(user, data)
if ( ( strsub(data, 1, 1) == "<" ) and user.bOperator )then
   data = strsub(data,1,strlen(data)-1)
   local    s,e,cmd = strfind( data, "%b<>%s+(%S+)" )
   if ( cmd == passivecmd ) then
      if getn(tPassiveUsers) >= 25 then
         user:SendPM(botsName, getn(tPassiveUsers).." users have been notified on their passive connection mode.")
      else   user:SendPM(botsName, "The following users have been notified on their passive connection mode : ")
         for i = 1, getn(tPassiveUsers) do
            user:SendPM(botsName, "\t"..tPassiveUsers)
         end
      end
      for index, nick in tPassiveUsers do
         if nick == user.sName then
         else    SendPmToNick(nick, botsName, ReadTextFile(TxtPassive))
         end
      end
   end
end
end

function ReadTextFile(file)
local message = "\r\n"
readfrom(file, "r")
while 1 do
local    line = read()
   if ( line == nil ) then break
   else   message = message.."\t"..line.."\r\n"
   end
end
readfrom()   
return message
end


i also use this script,it sends a pm to the not-regged user,and displays a message in main.
this one works just fine.
maybe there is something in it you like :P

botsName = "HeyPassive"            --- Change this to whatever u want
TxtPassive = "getactive.txt"            --- be sure to have a file corresponding to this one in the 'scripts'
passivecmd = "!goactive"            --- change this to whatever u want ...
countOPs = 0               --- if u want your Operators to receive such pm then put this equal to 1
secs = 1000
mins = 60*secs
timerinterval = 59*secs            --- I hope this is clear enough ...

function Main()
tPassiveUsers = {n=0};            --- don't touch this one ...
frmHub:UnregBot(botsName)            --- Unreg the Bot from the NickList, ( using the string defined by the ' botsName ' value )
frmHub:RegBot(botsName)            --- and Register it again ... ( using the string defined by the ' botsName ' value, again )
SetTimer(timerinterval)
StartTimer()
end

function OnTimer()
for index, nick in tPassiveUsers do
   SendPmToNick(nick, botsName, ReadTextFile(TxtPassive))
end
end

function OpConnected(user)
if ( countOPs == 1 ) then
NewUserConnected(user)
end
end

function NewUserConnected(user)
if ( strfind(user.sMyInfoString, ",M:P,") ) then
   tinsert(tPassiveUsers, (getn(tPassiveUsers)+1), user.sName)
end
end

function UserDiconnected(user)
if user.sName == tPassiveUsers then
   tremove(tPassiveUsers, user.sName)
end
end

function OpDisconnected(user)
if ( countOPs == 1 ) then
UserDiconnected(user)
end
end

function DataArrival(user, data)
if ( ( strsub(data, 1, 1) == "<" ) and user.bOperator )then
   data = strsub(data,1,strlen(data)-1)
   local    s,e,cmd = strfind( data, "%b<>%s+(%S+)" )
   if ( cmd == passivecmd ) then
      if getn(tPassiveUsers) >= 25 then
         user:SendPM(botsName, getn(tPassiveUsers).." users have been notified on their passive connection mode.")
      else   user:SendPM(botsName, "The following users have been notified on their passive connection mode : ")
         for i = 1, getn(tPassiveUsers) do
            user:SendPM(botsName, "\t"..tPassiveUsers)
         end
      end
      for index, nick in tPassiveUsers do
         if nick == user.sName then
         else    SendPmToNick(nick, botsName, ReadTextFile(TxtPassive))
         end
      end
   end
end
end

function ReadTextFile(file)
local message = "\r\n"
readfrom(file, "r")
while 1 do
local    line = read()
   if ( line == nil ) then break
   else   message = message.."\t"..line.."\r\n"
   end
end
readfrom()   
return message
end



aggain thanks for your time.
greetings dreveltje.

Acidpadd

guestion .... i started the script .. and i am wondering way not all profiles get the pop up! Wat can i do ?
             ? ? ?? Classical Psytrance ?? ? ?  
?--> psychedeliche.no-ip.org <--?

SMF spam blocked by CleanTalk