PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: MrBuitenhuizenJunior on 15 November, 2003, 02:24:59

Title: Artbot 1.0
Post by: MrBuitenhuizenJunior on 15 November, 2003, 02:24:59
Hello,

I wanted a script that displays a txt art (ASCI drawings) when you type a keyword without a trigger and directly from a txt file.
After some copy paste work this is the result.
So al the script credits go to the pheople who really wrote the scripting lines (see the script for it)
Have fun with it!

[NL]MrBuitenhuizen

-------------------------
--Artbot 1.0 made by: [NL]MrBuitenhuizen
--Artbot has most of the scripting lines from > :
-->ShowInfo v1.0 by latinmusic == poweroperator 18/04/2003
--Based on TrickerBot 2 by ?Ptaczek?
--Based on a few lines of DirtyBot made by Dirty Finger)
-->Brutus 0.2. by Troubadour
-->you need to have the directory "art" in your txt directory (so it won't become a mess to search for the files ;) )
--have fun with it

BotName = "here your botname"
Files = {
["here the word that opens the txt file"] = "txt/art/here the file name.txt",


}
function Main()
end
function DataArrival(user, data)
if( strsub(data, 1, 1) == "<" ) then
s,e,msg = strfind(data, "%b<> ([ -z]*)")
for key, value in Files do
if( strfind( strlower(msg), key) ) then
txtToShow, x = gsub(value, "%b[]", user.sName)
SendToAll( data )
Show(user, TheFile)
return 1
end
end
end
end
function Show(user, TheFile)
readfrom(txtToShow, "r")
local message = ""
while 1 do
local line = read()
if line == nil then break
else
message = message..line.."\r\n"
end
end
SendToAll( BotName, message ) -- send bot's message
readfrom()
return 1;
end

----------------------------
Title: hi :P
Post by: Masterload on 15 November, 2003, 18:33:04
nice one mr













visit this one sign the guestmap give me some tips or ideas ! (http://www.cannabisnetwork.netfirms.com) mail me ! (esnelleman@hotmail.com)
Title:
Post by: Troubadour on 15 November, 2003, 23:57:58
Keep up the good work [NL]MrBuitenhuizen.

Greetz Troubadour
Title: hi
Post by: Janyn on 17 November, 2003, 22:26:07
can somebody put i timer in that script ?
Title:
Post by: Jabo on 19 November, 2003, 19:24:48
having a small prob......made a art folder in the scripts/txt folder...put my acsii txt in it but when i type in the command for it....the bot name appears but not the txt.  

Files = {
["here the word that opens the txt file"] = "txt/art/here the file name.txt",

i put this.....

Files = {
["*jimbo"] = "jimbo.txt",

is this correct
Title:
Post by: BlazeXxX on 19 November, 2003, 20:13:21
Hi There,

["!jimbo"] = "txt/art/jimbo.txt",

Try that way...
Put your Text file inside the art directory..

Something like:

txt/art/jimbo.txt

If the Art is not loaded up still, check the Script Editor's window.. There might be some error..

Thanx,
BlazeX
Title:
Post by: Jabo on 19 November, 2003, 20:21:23
alright....that fixed it, but my acsii art doesnt show up in the hub like it does in the txt file.  in the hub everything looks mashed together.....why?
Title:
Post by: BlazeXxX on 19 November, 2003, 20:28:45
OK.. That is not the script problem...

The DC++'s default font is Microsoft Seriff Sans 8pnt and your Notepad/WordPad has different font for it ?

So If you change the Word Editor you using to the font i mentioned.. It would show the smashed up image there as well.. So Do any drawings with that font.. and it will show properly..

Byez,
BlazeX
Title:
Post by: Jabo on 19 November, 2003, 20:41:39
hmmm.....changed my notepad and wordpad to the specified font, but it still showed up the same as the others did.  not unless im still doing something wrong.
Title:
Post by: BlazeXxX on 19 November, 2003, 21:02:15
Hmmm... If your ASCII Art was drawn using a different Font.. Such as Tahoma or something.. Then it won't be the same when u try with Microsoft seriff Sans..

Try Downloading or drawing ASCII arts with that fone (Seriff Sans) and use that ASCII art to see if the script is showing the right one..
Title:
Post by: MrBuitenhuizenJunior on 19 November, 2003, 23:04:59
Hello,

It is:

BotName = "[NL]Barman"
Files = {
["lol"] = "txt/art/lol.txt",


-Without a trigger like: !,#,+ etc..
(that's one "special" thing in this script, it works without trigger)

-keep in mind to have: "txt/art/lol.txt"

Klik this link to download the whole script with the art directory:

http://www.home.zonnet.nl/petroleummax/Artbot1.0.rar


[NL]MrBuitenhuizen
Title:
Post by: Jabo on 20 November, 2003, 01:25:36
anyone know a good place i can go to get more ascii art that will work with this.....?
Title:
Post by: MrBuitenhuizenJunior on 20 November, 2003, 02:36:43
Hi,

The drawings I use, I copy pasted from the mainchat in different hubs. They are already ready to use   :D
note: always begin the drawing with a empty rule so the real drawing rule will start under the botname.

A original ASCI drawing you have to modify so it will appear the right way in the mainchat.

Time for hub hopping  :P

See ya,

[NL]MrBuitenhuizen
Title:
Post by: plop on 20 November, 2003, 13:05:48
QuoteOriginally posted by MrBuitenhuizenJunior
note: always begin the drawing with a empty rule so the real drawing rule will start under the botname.
See ya,
[NL]MrBuitenhuizen
change this.
local message = ""
for this.
local message = "\r\n"
that adds 1 extra blanc line @ the start.

plop
Title:
Post by: MrBuitenhuizenJunior on 20 November, 2003, 17:09:40
Yep,

It's more easy to change the script one time then insert a empty rule in every .txt file, thnx. Plop.

[NL]MrBuitenhuizen
Title:
Post by: MrBuitenhuizenJunior on 20 November, 2003, 17:24:39
Download link updated, link: see message nr. 11
(first a empty rule now, before .txt messages)

[NL]MrBuitenhuizen
Title:
Post by: yepyepyep4711 on 20 November, 2003, 17:32:03
Hi there,

just wanted to add that the next version of PtokaX will have support for text files (if things stay the way they are), so you'll be able to type e.g. !birthday, and the text "happy birthday" will appear in the main chat. And obviously instead of it it could be ASCII art.  :D
And that with as many files as you wish 8)

Ain't that great?

Cheers
Title:
Post by: MrBuitenhuizenJunior on 20 November, 2003, 17:39:49
Hello,

You're right, when I was "making" this script I already know that feature would be avaible in the new PtokaX.

But because a lot users are still on td4 or lower (like me), this is a very easy way to have .txt files shown at the mainchat.

[NL]MrBuitenhuizen
Title:
Post by: Troubadour on 20 November, 2003, 18:16:25
While waiting on the next version of ptokax (with the inbuilt txt show option), this is the best alternative!

Keep it up!

-Troubadour-
Title:
Post by: RiPOFF on 24 November, 2003, 01:02:34
Could someone mod the artbot to have these and
- Display art to the main chat
+asci ra         : Displays random art from
+asci rf       : Displays from random author (can be used even if only 1 author has a file named )
+asci rc           : Displays random art having in the art file's name
+asci : Displays from
 * Examples :
 +asci ra jadie         +asci rf brb smoking
 +asci rc xmas         +asci rosae bunny

 - List available art
+asci list authors: Lists all authors in the library
+asci list art    : Lists all art files in the library
+asci list both   : Lists all authors in the library and their respective art

 - Misc commands
+asci help       : Displays the help
+asci reload lib : Reloads the library (OP classes and above only)


automaticlly build a db like how ptokax has one or make it read from it cause i have a db and a load of art all tested for asciisizing here lemme upload it and whoever wants to make it for me that would be cool have it read and write to database :)

Link (http://download.uknnet.com:6893/AsciiArt.zip)
Title:
Post by: [ES]latinmusic on 24 November, 2003, 14:05:16
QuoteOriginally posted by MrBuitenhuizenJunior You're right, when I was "making" this script I already know that feature would be avaible in the new PtokaX.
What are you talking about?, the best way to add ascii is an script and not the upcoming feature inside ptokax, text file are mostly implementent it to another kind of text file and not for art althougth kind be used, why is better i post the reasons later, now i have no time.
Title:
Post by: MrBuitenhuizenJunior on 25 November, 2003, 02:02:17
Hello,

I heared that the new PtokaX will have a ASCI feature (or something like that......) inside, that's all.
I'm looking forward to see the reasons why it's better to have it scripted.

[NL]MrBuitenhuizen
Title:
Post by: [ES]latinmusic on 25 November, 2003, 12:57:17
Yes ptokax will include support for text file.
Looking for reasons, here we go, personal opinion.
New ptokax will come with:
cmdprefix = !
inside ptokax.ini file
also will come support for txt file.
How works?:
You name your file for instance as: ascii.txt
then in main chat you type:
cmdprefixascii or better explain your command prefix followed by the name of the file:
!ascii
with the result of the file displayed in main chat.
------------------------------------------
Now suppose you have 10 ascii arts, you have two options to display the ascii art:
1.- Put all your art files inside the same file to display all at once or
2.- Make 10 different files with diferent names.
The second option will generated 10 news commands each one for display each file.txt
In my case i prefer only one command to display ramdomly each art file instead add one more command every time i add an ascii art. Catch it?.
-------------------------------------------
For me the text file support is nice to basic functions like display help, rules, netinfo, etc. In this way the size and resources taken by script will decrease because this, for more sofisticated features we still have the script support.
Title: Artbot 2.0
Post by: MrBuitenhuizenJunior on 13 September, 2004, 21:54:44
Artbot Version 2.0

Download/Info avaible ->here<- (http://www.buitenhuizen.org/scripts/artbot.html)

MrBuitenhuizen
Title:
Post by: TiMeTrAVelleR on 13 September, 2004, 23:49:55
---====Settings are done in the ArtbotSettings cfg file inside Artbot-data

seems  to be missing this  file m8

its the error it gives

Syntax error: assertion failed!  settings file error
stack traceback:
   1:  function `assert' [C]
   2:  main of file `...r\Bureaublad\Trance Hub\scripts\Artbot2.0-A.lua' at line 20

Syntax error: assertion failed!  settings file error
stack traceback:
   1:  function `assert' [C]
   2:  main of file `Artbot2.0-A.lua' at line 20
   3:  function `dofile' [C]
   4:  main of file `...r\Bureaublad\Trance Hub\scripts\Artbot2.0-B.lua' at line 4
Title:
Post by: MrBuitenhuizenJunior on 14 September, 2004, 01:03:25
QuoteOriginally posted by T?M??r?V?ll?R
---====Settings are done in the ArtbotSettings cfg file inside Artbot-data

seems  to be missing this  file m8



The cfg file is created when you push the "Save Artbot Config" button at the GUI
Title:
Post by: TiMeTrAVelleR on 14 September, 2004, 08:35:14
Oki thanks
Title: Can't get !startimer to work V2.0
Post by: catwo on 25 December, 2004, 00:06:44
Hi i cannot get the start timer to work i type  !startimer 1 as directed by help file but it just doesnt work.  This is driving me nuts i have checked startimer in config GUI and saved but no matter what i try it wont work.  I want the files to play at timeed intervals?  Please HELP!
Title:
Post by: H?LL?L?L??nG?L on 13 September, 2005, 20:00:03
Can someone plz make the artbot in lua 5 plz. i just want the first one not with the gui or anything just artbot 1.0  It dont work

This 1:-

--Artbot 1.0 made by: [NL]MrBuitenhuizen
--Artbot has most of the scripting lines from > :
-->ShowInfo v1.0 by latinmusic == poweroperator 18/04/2003
-->Based on TrickerBot 2 by ?Ptaczek?
-->Based on a few lines of DirtyBot made by Dirty Finger)
--nov 2003 = start empty rule idea by Plop
--thnx to the people who made the Art txt files
--you need to have the directory "art" in your txt directory
--have fun with it

BotName = "Your Botname"
Files = {
["lol"] = "txt/art/lol.txt",
["toast"] = "txt/art/toast.txt",
["toilet"] = "txt/art/toilet.txt",
["devil"]= "txt/art/devil.txt",
["sleep"]= "txt/art/sleep.txt",
["goodnight"]= "txt/art/goodnight.txt",
["dance"]= "txt/art/dance.txt",
["rabbit"]= "txt/art/rabbit.txt",

}
function Main()
end
function DataArrival(user, data)
if( strsub(data, 1, 1) == "<" ) then
s,e,msg = strfind(data, "%b<> ([ -z]*)")
for key, value in Files do
if( strfind( strlower(msg), key) ) then
txtToShow, x = gsub(value, "%b[]", user.sName)
SendToAll( data )
Show(user, TheFile)
return 1
end
end
end
end
function Show(user, TheFile)
readfrom(txtToShow, "r")
local message = "\r\n"
while 1 do
local line = read()
if line == nil then break
else
message = message..line.."\r\n"
end
end
SendToAll( BotName, message ) -- send bot's message
readfrom()
return 1;
end

THX
Title:
Post by: Psycho_Chihuahua on 13 September, 2005, 20:28:53
Well you could take the Ascii's from that Bot and make your own

BotName = frmHub:GetHubBotName()

function ChatArrival(user, data)
data=string.sub(data,1,string.len(data)-1)
s,e,cmd = string.find( data, "%b<>%s+(%S+)" )


if (cmd=="#dancing") then
SendToAll(BotName, " ")
SendToAll(BotName, "               *                 *                                     ")
SendToAll(BotName, "      _O_/       \\_O_                *                           ")
SendToAll(BotName, "     / )(      *      ((  \\                                            ")
SendToAll(BotName, "      /  \\            / \\                                              ")
SendToAll(BotName, " ")
SendToAll(BotName, "                                                                           ")
SendToAll(BotName, "   *    O_/                       *                                   ")
SendToAll(BotName, "     _/))                               /_O_/                              ")
SendToAll(BotName, "        \\\\                                  []                               ")
SendToAll(BotName, "        //                                 //                                      ")
SendToAll(BotName, "                                           \\\\                                       ")
SendToAll(BotName, " ")
SendToAll(BotName, "                                                                                          ")
SendToAll(BotName, "                  *** Dancing in the Hub***                               ")
SendToAll(BotName, "        _O_/                                                   /_O_/                                 ")
SendToAll(BotName, "       / )(                                                         []                   ")
SendToAll(BotName, "        /  \\                                                        //                          " )            
SendToAll(BotName, "                                                                     \\\\                                 ")
SendToAll(BotName, " ")
SendToAll(BotName, " ")
end

end

I know its not the same but you can add as many pictures as you want to
Title:
Post by: ??????Hawk?????? on 13 September, 2005, 20:30:22
--Artbot 1.0 made by: [NL]MrBuitenhuizen
--Artbot has most of the scripting lines from > :
-->ShowInfo v1.0 by latinmusic == poweroperator 18/04/2003
-->Based on TrickerBot 2 by ?Ptaczek?
-->Based on a few lines of DirtyBot made by Dirty Finger)
--nov 2003 = start empty rule idea by Plop
--thnx to the people who made the Art txt files
--you need to have the directory "art" in your txt directory
--have fun with it
-- LUA 5 By  ??????Hawk??????

BotName = "Your Botname"
Files = {
["lol"] = "txt/art/lol.txt",
["toast"] = "txt/art/toast.txt",
["toilet"] = "txt/art/toilet.txt",
["devil"]= "txt/art/devil.txt",
["sleep"]= "txt/art/sleep.txt",
["goodnight"]= "txt/art/goodnight.txt",
["dance"]= "txt/art/dance.txt",
["rabbit"]= "txt/art/rabbit.txt",

}

function ChatArrival(user, data)
s,e,msg = string.find(data, "%b<> ([ -z]*)")
for key, value in Files do
if( string.find( string.lower(msg), key) ) then
txtToShow, x = string.gsub(value, "%b[]", user.sName)
SendToAll( data )
Show(user, value)
return 1
end
end
end


function Show(user, txtToShow)
local f,e = io.open(txtToShow,"r")
local message = ""
while 1 do
local line = f:read("*l")  
if line == nil then break
else
message = message..line.."\r\n"
end
end
f:close(f)
SendToAll(BotName,message)
return 1
end
Title:
Post by: H?LL?L?L??nG?L on 13 September, 2005, 20:33:43
Thank you psycho i'll think about that 1. And Thank you Hawk ya wee Darlin :p:p