PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: B@B? on 13 May, 2005, 11:17:44

Title: Picture-Bot
Post by: B@B? on 13 May, 2005, 11:17:44
Maybe someone can make an Lua 5-Script for me
from this one wich worked fine with Lua4.

-- Pic/Text-Bot
-- shows TEXT-files from a folder named TEXT.
-- doesn't mather what prefix it used (+test.txt or #test.txt, etc.).

Bot = "NAME"

function Main()
frmHub:RegBot(Bot)
end

function DataArrival(user, data)
   data=strsub(data,1,strlen(data)-1)
   if( strsub(data, 1, 1) == "<" ) then
      s,e,cmd = strfind(data,"%b<>%s+(%S+)")
      cmd = strsub(cmd, 2,strlen(cmd))
      if readfrom("text/"..cmd..".txt") then
         showtext(user, cmd)
         return 1
      end
   elseif(strsub(data, 1, 4) == "$To:") then
      s,e,cmd = strfind(data,"$To:%s+%S+%s+From:%s+%S+%s+$%b<>%s+(%S+)")
      cmd = strsub(cmd, 2,strlen(cmd))
      if readfrom("text/"..cmd..".txt") then
         showtext(user, cmd)
         return 1
      end
   end
end

function showtext(user, cmd)
   lines = "\r\n\r\n"
   readfrom("text/"..cmd..".txt")
   while 1 do
      local line = read()
      if line == nil then
         readfrom()
         break
      end
      lines = lines..line.."\r\n"
   end
   --user:SendPM(Bot, lines.." |")
   SendToAll(Bot, lines.." |")
end

Thank YOU!

Btw:
It will be very nice if the bot has an function to allow me
to set an timer on or off wich shows the pictures randomly all XX min.

But that should not be the Main-Funktion!

The Main-Function should be to call an Pictures by the given command...like above.
Title:
Post by: Dessamator on 13 May, 2005, 11:34:52
Check this link (http://home.comcast.net/~benbrausen/Funny/Posting.swf)
Title:
Post by: B@B? on 13 May, 2005, 12:07:11
Nice. Very nice!  :rolleyes:

But:

1. The script i requested is not in the database
>>> (I allways search before)

2. My request should be in the right form

What?s wrong?  ?(

The shortest way to help isn?t discuss...

The shortest way to help, i  think, is copy!  ;)

btw: An link to the script, wich- YOU think that it is the requested, makes more sense...

QuoteIn this Topic you are allowed to ask for new scripts - or even to ask if some still exists
...
Title:
Post by: jiten on 13 May, 2005, 17:15:39
Give this (http://board.univ-angers.fr/thread.php?threadid=4366&boardid=26&styleid=1&sid=4b4a78ff0622352473587b2da7d332c8&page=2#26) a try.

Best regards
Title:
Post by: Dessamator on 13 May, 2005, 17:38:22
QuoteOriginally posted by B@B€
Nice. Very nice!  :rolleyes:

But:

1. The script i requested is not in the database
>>> (I allways search before)

2. My request should be in the right form

What?s wrong?  ?(

The shortest way to help isn?t discuss...

The shortest way to help, i  think, is copy!  ;)

btw: An link to the script, wich- YOU think that it is the requested, makes more sense...

QuoteIn this Topic you are allowed to ask for new scripts - or even to ask if some still exists
...

hmm indeed, i just put that to show u the link already exists, if u searched and didnt find, well, maybe i was incorrect, but an ascii bot exists for a veeeery long time,
and heres the proof :
QuoteOriginally posted by jiten
Give this (http://board.univ-angers.fr/thread.php?threadid=4366&boardid=26&styleid=1&sid=4b4a78ff0622352473587b2da7d332c8&page=2#26) a try.

Best regards

 maybe the script should be renamed to allow acomodate some ppl, :)
Title:
Post by: B@B? on 13 May, 2005, 22:51:56
THANK YOU VERY! MUCH @ "jiten" (http://board.univ-angers.fr/images/icons/thumb_up.gif)

The second time YOU SAVED MY LIFE...  ;)

btw;

I have this script from you, but as i putted an Pic.txt-file with an ASCII inside in the folder i had only Hyroglyphs on my screen inside of my client...so i thought, it?s not perfect...for normaly Text-files like Hub-Info-Text it worked great! That?s the reason i setted this question.

Now i copied the script again and it works GREAT!  :]

@ Dessamator: np...  :D
Title:
Post by: Dessamator on 13 May, 2005, 23:06:49
hmm, ok
Title:
Post by: jiten on 14 May, 2005, 11:22:11
You're welcome, B@B?

Quotemaybe the script should be renamed to allow acomodate some ppl, :)
Next time I make some changes in Rotating Message, I'll add more info to its description :D

Best regards,

jiten
Title:
Post by: Dessamator on 14 May, 2005, 11:35:04
indeed, great idea, add the words "picture bot, ascii bot with timer, text viewer " hmm and whatever comes to ur mind, ;)