Timed Message
 

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

Timed Message

Started by BrokenBrick, 22 October, 2003, 00:42:12

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

BrokenBrick

Heres another one, its a timed message script, and its uses are pretty self explanitory, it should work in IceCube and TD.  I did not write it but if you have trouble I will try to help :-p
_____________________________________

botname = "Reminder"
minutes = 360
file = "MsgAll.txt"

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

function OnTimer()
MessageToAll()
end

function MessageToAll()
local handle = openfile(file, "r")
if (handle ~= nil) then
local line = read(handle)
while line do
SendToAll(botname,line)
line = read(handle)
end
closefile(handle)
end
end
Indiecent Music
indiecent.no-ip.com:4141


Live the lonely life, walk the lonely path, die a lonely death

liq?i?sw?rdz

DO I have to make a folder called "txt" and and put a file in it called MsgAll.txt to make this work?
a sl?t is a terrible thing to waste
[]-[]-[]-free_l?aders_Paradis?-[]-[]-[]

kepp

in the script folder i suppose
Guarding    

pHaTTy

Hmm because its only using the timer once instead of jumping from timer to another function might as well be all in timer

bot = "Reminder" 
mins = 360 
file = "MsgAll.txt" 

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

function OnTimer() 
local handle = openfile(file, "r") 
if (handle ~= nil) then 
local line = read(handle) 
while line do 
SendToAll(bot,line) 
line = read(handle) 
end 
closefile(handle) 
end 
end
Resistance is futile!

angelsanges

how to modify this bot for sending message in PM instead of main?

blackwings

#5
QuoteOriginally posted by angelsanges
how to modify this bot for sending message in PM instead of main?

Replace this line=
SendToAll(bot,line)

with this =
SendPmToAll(bot,line)


angelsanges

i have this error if i modify that line

Syntax error: cannot access a variable in outer scope;
  last token read: `handle' at line 16 in string "bot = "Offertissime"
..."

SMF spam blocked by CleanTalk