mass script
 

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

mass script

Started by [NL]trucker, 10 February, 2004, 11:49:55

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

[NL]trucker

hello you fine folks

i could use a script where i can send a message to either
Vips or regged users or unreggged users from a txt file.
and if posibble on a timer but no need for the bot to register in hub.

my profile list for these are :

unreg -1
reg = 6
vip= 5

and the txt files would be :

Unreg.txt
Reg.txt
Vips.txt

and i wanted to put the txt files in a dir called usertxt.
so if any of you fine scripters has some spare time...... :D
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

#1
Hope this helps you

sBot = "-==LOL==-" 

function Main() 
   --frmHub:RegBot(sBot)
end 

function NewUserConnected(user)
   if user.iProfile == -1 then
      READuser(user)
   elseif user.iProfile == 6 then
      READuserReg(user)
   elseif user.iProfile == 5 then
      READuserVip(user)
   end
end

function READIT(user)
   while 1 do
   local line = read()
      if line == nil then break end
         user:SendPM(sBot,line)
      end
   end
   readfrom()
end


function READuser(user)
   readfrom("text/usermsg.txt")
   READIT(user)
end

function READuserReg(user)
   readfrom("text/regmsg.txt")
   READIT(user)
end

function READuserVip(user)
   readfrom("text/vipmsg.txt")
   READIT(user)
end
Guarding    

[NL]trucker

#2
Kepp

thnx m8 im gonna try this one and let you know how it works.


by the way am i the only one who cant see your post other then by giving a reply to it?

i have noticed this in other post you made that there were no lines and i allready had made a comment in this when i did discover that you indeed made a reply ...strange things are happening .

Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


[NL]trucker

Kepp


i just noticed this script does send a message on login
and i would like it so that I could send a message whenever I want so with a command like !send vip that it then reads the message from txtfile and sends it to all online  vips.

could you make that for me?
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

sBot = "-==LOL==-" 

VIP = {}
REG = {}
UNREG = {}

function Main() 
   --frmHub:RegBot(sBot)
end 

function NewUserConnected(user)
   if user.iProfile == -1 then
      if UNREG[user.sName]==nil then
         UNREG[user.sName]=1
      end

   elseif user.iProfile == 6 then
      if REG[user.sName]==nil then
         REG[user.sName]=1
      end

   elseif user.iProfile == 5 then
      if VIP[user.sName]==nil then
         VIP[user.sName]=1
      end
   end
end

function UserDisconnect(user)
   VIP[user.sName]=nil;
   REG[user.sName]=nil;
   UNREG[user.sName]=nil;
end

function MassReg(user, data)
   readfrom("text/regmsg.txt")
      while 1 do
      local line = read()
         if line == nil then break end
            for i,v in REG do
            SendPmToNick(i,sBot,line)
         end
      end
   end
   readfrom()
end

function MassUnregg(user, data)
   readfrom("text/unregmsg.txt")
      while 1 do
      local line = read()
         if line == nil then break end
            for i,v in UNREG do
            SendPmToNick(i,sBot,line)
         end
      end
   end
   readfrom()
end

function MassVIP(user, data)
   readfrom("text/vipmsg.txt")
      while 1 do
      local line = read()
         if line == nil then break end
            for i,v in UNREG do
            SendPmToNick(i,sBot,line)
         end
      end
   end
   readfrom()
end

function DataArrival(user, data)
   if (strsub(data,1,1) == "<") then
   data=strsub(data,1,strlen(data)-1)
   s,e,cmd=strfind(data,"%b<>%s+(%S+)")
      if cmd=="+massvip" then
         MassVIP(user, data) return 1
         
      elseif cmd=="+massunreg" then
         MassUnregg(user, data) return 1
        
      elseif cmd=="+massreg" then
         MassReg(user, data) return 1
      end
   end
end

I haven't tested it... Sorry, lack of time now!!
But i think it should work...

Actually i haven't noticed anything at all, Weird :S
Guarding    

kepp

#5
A little fix... Noticed too many ends :)
By the way, You must register the bot!!
else they will recieve it in main!!
sBot = "-==LOL==-" 

VIP = {}
REG = {}
UNREG = {}

function Main() 
   --frmHub:RegBot(sBot)
end 

function NewUserConnected(user)
   if user.iProfile == -1 then
      if UNREG[user.sName]==nil then
         UNREG[user.sName]=1
      end

   elseif user.iProfile == 6 then
      if REG[user.sName]==nil then
         REG[user.sName]=1
      end

   elseif user.iProfile == 5 then
      if VIP[user.sName]==nil then
         VIP[user.sName]=1
      end
   end
end

function UserDisconnect(user)
   VIP[user.sName]=nil;
   REG[user.sName]=nil;
   UNREG[user.sName]=nil;
end

function MassReg(user, data)
   readfrom("text/regmsg.txt")
      while 1 do
      local line = read()
         if line == nil then break end
            for i,v in REG do
            SendPmToNick(i,sBot,line)
      end
   end
   readfrom()
end

function MassUnregg(user, data)
   readfrom("text/unregmsg.txt")
      while 1 do
      local line = read()
         if line == nil then break end
            for i,v in UNREG do
            SendPmToNick(i,sBot,line)
      end
   end
   readfrom()
end

function MassVIP(user, data)
   readfrom("text/vipmsg.txt")
      while 1 do
      local line = read()
         if line == nil then break end
            for i,v in UNREG do
            SendPmToNick(i,sBot,line)
       end
   end
   readfrom()
end

function DataArrival(user, data)
   if (strsub(data,1,1) == "<") then
   data=strsub(data,1,strlen(data)-1)
   s,e,cmd=strfind(data,"%b<>%s+(%S+)")
      if cmd=="+massvip" then
         MassVIP(user, data) return 1
         
      elseif cmd=="+massunreg" then
         MassUnregg(user, data) return 1
        
      elseif cmd=="+massreg" then
         MassReg(user, data) return 1
      end
   end
end
Guarding    

SMF spam blocked by CleanTalk