Need help with this script for Random Messages
 

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

Need help with this script for Random Messages

Started by xfiles, 14 February, 2004, 23:04:05

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

xfiles

Hello everyone,

is there a scripter out there that can help me with this script?
i?ve changed it a little but it seems not work yet.
it is supposed to send Random Messages from time to time.
can anyone help me with it???


botname = "?RoboCop??"
minutes = 60
file1 = "txt/lusoarenainfo.txt"
file2 = "txt/lusoarenareg.txt"

countmin = "2"

function Main()
SetTimer(minutes*60000)
StartTimer()
end

function OnTimer()
MessageToAll()
end

function MessageToAll()
  if countmin=="0" then
    local handle = openfile(file1, "r")
    if (handle ~= nil) then
      local line = read(handle)
      while line do
        SendToAll(botname,line)
        line = read(handle)
      end
      closefile(handle)
      countmin = "1"
    end
  elseif countmin=="1" then
    local handle = openfile(file2, "r")
    if (handle ~= nil) then
      local line = read(handle)
      while line do
        SendToAll(botname,line)
        line = read(handle)
      end
      closefile(handle)
      countmin = "2"
    end
end
end


Thx guys...

nErBoS

Hi,

the reason why isn't working is because of this...
countmin = "2"

If you take a good look at function MessageToAll you will notice that the functio will only work if countmin is in 1 or 0

Best regards, nErBoS
--## nErBoS Spot ##--

xfiles

oi nerbos,

obrigado :)
nao notei nisso.
vou experimentar.

thx m8

xfiles


SMF spam blocked by CleanTalk