Log off do not work
 

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

Log off do not work

Started by SilvaO, 23 October, 2005, 23:07:44

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SilvaO

Hi to all!

This is an IN/out user announce  LUA4

When user log in the script send a message

but when user log off the scrip does not send a massage.

I need help on this scrip please.


--Feito por nErBoS

sBot = "IN/out"

--## Usar Welcomes para os Nivies ##--

Reg = 1
Vip = 1
Operator = 1
Master = 1

--1 activa, 0 desactiva

--## Mensagens ##--

   --## Mensagens para REG ##--
   --## MSG de Entrada
   regwlcin = {
         "       RegUser ?? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d entrar.",
         "       RegUser ? ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d entrar."
   }
   --## MSG de Saida
   regwlcout = {
         "       RegUser  ?? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d Sair.",
         "       RegUser ? ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d Sair."
   }

   --## Mensagens para VIP ##--
   --## MSG de Entrada
   vipwlcin = {
         "       RegUser  ?? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d entrar.",
         "       RegUser  ?? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d entrar."
   }
   --## MSG de Saida
   vipwlcout = {
         "       RegUser   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d Sair.",
         "       RegUser   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d Sair."
   }

   --## Mensagens para OP ##--
   --## MSG de Entrada
   opwlcin = {
      "     Operador   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d entrar.",
         "     Operador   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d entrar."      
   }
   --## MSG de Saida
   opwlcout = {
      "     Operador   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d sair.",
         "     Operador   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d sair."      
   }

   --## Mensagens para MASTER ##--
   --## MSG de Entrada
   masterwlcin = {
         "     Operador   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d entrar.",
         "     Operador   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d entrar."      
   }
   --## MSG de Saida
   masterwlcout = {
         "     Operador   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d sair.",
         "     Operador   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d sair."      
   }

function Main()
   frmHub:RegBot(sBot)
end

function NewUserConnected(user, data)
   if (user.iProfile == 3 and Reg == 1) then
      local regmsg = regwlcin[random(1, getn(regwlcin))]
      regmsg, x = gsub(regmsg, "%b[]", user.sName)
      SendToAll(sBot, regmsg)
   elseif (user.iProfile == 2 and Vip == 1) then
      local vipmsg = vipwlcin[random(1, getn(vipwlcin))]
      vipmsg, x = gsub(vipmsg, "%b[]", user.sName)
      SendToAll(sBot, vipmsg)
   elseif (user.iProfile == 0 and Operator == 1) then
      local mastermsg = masterwlcin[random(1, getn(masterwlcin))]
      mastermsg, x = gsub(mastermsg, "%b[]", user.sName)
      SendToAll(sBot, mastermsg)
   elseif (user.bOperator and Operator == 1) then
      local opmsg = opwlcin[random(1, getn(opwlcin))]
      opmsg, x = gsub(opmsg, "%b[]", user.sName)
      SendToAll(sBot, opmsg)
   end
end

OpConnected = NewUserConnected

function UserDisconnected(user, data)
   if (user.iProfile == 3 and Reg == 1) then
      local regmsg = regwlcout[random(1, getn(regwlcout))]
      regmsg, x = gsub(regmsg, "%b[]", user.sName)
      SendToAll(sBot, regmsg)
   elseif (user.iProfile == 2 and Vip == 1) then
      local vipmsg = vipwlcout[random(1, getn(vipwlcout))]
      vipmsg, x = gsub(vipmsg, "%b[]", user.sName)
      SendToAll(sBot, vipmsg)
   elseif (user.iProfile == 0 and Operator == 1) then
      local mastermsg = masterwlcout[random(1, getn(masterwlcout))]
      mastermsg, x = gsub(mastermsg, "%b[]", user.sName)
      SendToAll(sBot, mastermsg)
   elseif (user.bOperator and Operator == 1) then
      local opmsg = opwlcout[random(1, getn(opwlcout))]
      opmsg, x = gsub(opmsg, "%b[]", user.sName)
      SendToAll(sBot, opmsg)
   end
end

OpDisconnected = UserDisconne

Dessamator

After a quick glance, I saw this error, its misspelled.
OpDisconnected = UserDisconne
Ignorance is Bliss.

SilvaO

Do I have to remove that?

bastya_elvtars

OpDisconnected = UserDisconnected
Everything could have been anything else and it would have just as much meaning.

SilvaO

#4
Thank you bastya_elvtars works 100%

SMF spam blocked by CleanTalk