Automatic Banner Bot
 

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

Automatic Banner Bot

Started by Sammy P, 04 January, 2005, 21:26:31

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Sammy P

right, as ull probably notice i CANT write lua very well.

What im after is summin that will paste the following message into main chat every 20minutes, without someone typin !banner or whatever the command was
   
          -------------------------(?`?._.?[URBAN FM]?._.???)-------------------------
           
        ????`????LoCk On To ThE OfFiCiAL URBAN FM RaDiO????`????
           
         .???`?-> http://www.urbantingz.com/listen.rm    <-???`?.ReAl AmP
         .???`?-> http://www.urbantingz.com/listen.m3u <-???`?.WiN AmP
         .???`?-> http://www.urbantingz.com/listen.asx  <-???`?.WiN MeDiA
   
   www.uRBANTINGz.com/forum <-- Make sure ur regged. PASS THIS ON
           
       ????`????LoCk On To ThE OfFiCiAL URBAN FM RaDiO????`????


Cheers

Sammy P

Anna

there's a script called timedmess that can do that for you (at least close to)

So far I havent managed to alter it enough to get it so not show timestamps... originaly it sent bot name on everi line as well, but that was a fairly easy edit.... if you search on the board I'm sure you can find it, if not send me a pm or some and I'll send it over to you (havent got a place to host it so cant get you a dl link)

bastya_elvtars

already solved, he only opened the topic twice ;)

btw timestamps are clientside - users have to disable it manuallly.
Everything could have been anything else and it would have just as much meaning.

Anna

if you for instance look at robocops hub add, there arent timestamps for each row.... neither is it if I send a banner through !banner command..

and also if I type a message in main  thats more then 1 row i dont get a timestamp on each row... this message I have in timedmess shows timestamp for everyrow in the actual message.. it would be nice if the timestamp only was shown at the first row as it is when typing in the message...

bastya_elvtars

my script does that...
Everything could have been anything else and it would have just as much meaning.

Anna

:) ok
where can I get a hold of your script then?

[UK]Madman

When adding the message to the timer script, rather than....

SendToAll (bot, "message line 1")
SendToAll (bot, "message line 2")
SendToAll (bot, "message line 3")

try

mess = ""
mess = mess.."\r\n\t\n"
mess = mess.."message line 1"
mess = mess.."message line 2"
mess = mess.."message line 3"
SendToAll (bot,..mess)

can use \r\n to add a new line too :o)

Anna

the script I have uses a separate file for the actual message... So I guess it would require a bit more of a change to get it working without showing timestamp for each line

bastya_elvtars

QuoteOriginally posted by Anna
the script I have uses a separate file for the actual message... So I guess it would require a bit more of a change to get it working without showing timestamp for each line

post it here. i will see what i can do.
Everything could have been anything else and it would have just as much meaning.

Anna

OK here it comes, the txt file is just plain text as it is now and the script kind of ignore blank lines as well

CODE
-------------------------------------------------------------------

botname = "?????_ThaSwing_?????"
minutes = 60
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)
SendToAll(botname,line)
line = read(handle)
while line do
SendToAll(line)
line = read(handle)
end
closefile(handle)
end
end

-----------------------------------------------------
END

hope ya can do some :D

bastya_elvtars

#10
sure...

-- by dunno who
-- remade by bastya_elvtars

botname = "??^(o)??_ThaSwing_??^(o)??"
minutes = 60
file = "MsgAll.txt"

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

function OnTimer()
	MessageToAll()
end

function MessageToAll()
	local msg=""
	readfrom(file)
	while 1 do
		local line=read()
		if not line then
			readfrom()
			break
		end
		msg=msg.."\r\n"..line
	end
	readfrom()
	SendToAll(botname,msg)
end
Everything could have been anything else and it would have just as much meaning.

Anna

thanx for the help, but somewhere something dont work right, I got this when the message should be sent

Syntax error: bad argument #1 to `readfrom' (string expected, got nil)
stack traceback:
   1:  function `readfrom' [C]
   2:  function `MessageToAll' at line 19 [file `...:\Program\hubbar\PlayWerx\scripts\timedmess.lua']
   3:  function `OnTimer' at line 14 [file `...:\Program\hubbar\PlayWerx\scripts\timedmess.lua']

bastya_elvtars

sry. edited above.
Everything could have been anything else and it would have just as much meaning.

Anna

:D works fine now, except it dont tell who sends it... but thats not importent really

bastya_elvtars

check now.

btw gnite :)
Everything could have been anything else and it would have just as much meaning.

Anna

:) just perfect

night and thanx for the help

Anna

ok, i am putting an old thread up to live again.. did a search, but didnt find this script working in lua5... maybe I just missed it..
in any case if it already exists please point me in the right direction, if not please help me update it, found a use for it once again

bastya_elvtars

-- by dunno who
-- remade by bastya_elvtars
-- lua5 version by bastya_elvtars


botname = "??^(o)??_ThaSwing_??^(o)??"
minutes = 60
file = "MsgAll.txt"

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

function OnTimer()
  MessageToAll()
end

function MessageToAll()
  local msg=""
  local f=io.open(file)
  if f then
    for line in f:lines() do
      msg=msg.."\r\n"..line
    end
    f:close()
  end
  SendToAll(botname,msg)
end
Everything could have been anything else and it would have just as much meaning.

Anna

thanx :D preciate it

SMF spam blocked by CleanTalk