PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: [ES]latinmusic on 02 December, 2003, 23:08:28

Title: ![AscIIArtBot]!? v:1.0
Post by: [ES]latinmusic on 02 December, 2003, 23:08:28
I was taking a look inside the Artbot 1.0 made by [NL]MrBuitenhuizen and does not like me because each ascii file requiered a single command, taking as an example, if i put 40 single ascii files i have in result 40 extra commands added to the current available commands running inside the hub. For this reason i have take the dessicion to make my own.
From readme.txt file included inside the zip file:
-- ![AscIIArtBot]!? V:1.0 by [ES]latinmusic << Compiled Version >>
-- Based as usual in tezlo code
-- Thanks to [NL]MrBuitenhuizen for the idea
-- AscII text files from Artbot 1.0 made by: [NL]MrBuitenhuizen
-- Two more cool files added :-)
-- Commands:
--> -showart  --> for all users, display ascii files randomly
--> -showhelp --> for all users, display the help of the bot
--> -startimer   --> for operators only, start the timer function.
--> -stoptimer  --> for operators only, stop the timer function.
--> -reloadart  --> for master only, reload the art files
-- Features:
-- Can display ascii files randomly using only one command
-- Can display ascii files randomly in main chat using a timer, the value for the timer can be easily setted by the command: -reloadart
-- If timer function is active, the command --> -showart is deactivated. Apropiated messages are displayed when you activate the timer or if a user is trying to use the command -showart
-- If timer function is NOT active, the command --> -showart is activated. Apropiated message is displayed when you deactivate the timer
-- You can add or delete ascii files without stopping or editting the script manually
-- NOTE: In case of addition or delection of the ascii files, update the script using
--> -reloadart
-- NOTE: The directory --> AscIIArtFiles can't be empty
-- NOTE: The file --> ArtList.txt created inside the script folder can't be deleted
-- How to install it?
-- Uncompress the zip into the script folder of ptokax
-- You will see 1 folder with the art files included, don't rename it
-- You will see this readme.txt
-- Don't delete nothing, all files and folders are requiered for the script
-- You need more help? --> Run the script and play with the commands.
-- Enjoy.............
The script can be downloaded from here (http://aracnidos.no-ip.org/PublicScripts/AscIIArtBot.zip)
I hope the link works, i was formating my machine last week..........
Title:
Post by: RiPOFF on 02 December, 2003, 23:25:11
why compile it?
Title:
Post by: [ES]latinmusic on 03 December, 2003, 00:01:53
Because i'm angry, last week i see an interesting function inside an script and when i finished the download the script to see if i can do something similar into a bot i'm rigthing the script was compiled :(
Title:
Post by: Optimus on 03 December, 2003, 00:16:37
Hehe, and witch 1 is it??

Glory is Compiled, Robo is Compiled, IceGuard is Compiled, PzoZyZBoT is Compiled & probably Gekko also...

Don't be angry... i think because they are packages they are compiled.

but with a small single script i don't see any reason to compile. ( Reason such as performance )

maybe ask the author off compiled script to give you the code or a example
Title:
Post by: RiPOFF on 04 December, 2003, 19:14:29
you dont have to do what everyone does i mean thats not fair!
Title:
Post by: MrBuitenhuizenJunior on 05 December, 2003, 14:42:30
Hello,

Nice that people are using the idea.
The readme file sounds great, makes me wanna use it  :) .


[NL]MrBuitenhuizen
Title:
Post by: IceCoder on 05 December, 2003, 14:48:24
Just Compil the good big scripts with hard codes
Title:
Post by: [ES]latinmusic on 06 December, 2003, 16:48:40
QuoteOriginally posted by MrBuitenhuizenJunior
Hello,

Nice that people are using the idea.
The readme file sounds great, makes me wanna use it  :) .


[NL]MrBuitenhuizen
The idea is good and it comes from you, but still this board is pissing me off many times so i'm still angry, tell me if you like the script and continues using it.
The script code is very easy and can be use to do another things, there is no complication on it.
I wanna know if there are someone currently using the script. The point if i have many things to thanks to this board and the old one, and also to many people in here, including even the people with i have a few bad words because arguing bussines  :) so, if there are few people using the script and wanna see the code, i will paste it here as usual and also include nice ascii art files.
Title:
Post by: [ES]latinmusic on 15 December, 2003, 12:29:21
After a few pms and mails requesting the code, here it is
-- ![AscIIArtBot]!? V:1.1 by [ES]latinmusic
-- Some improvements inside the code
-- Old AscII files have been retouched for better display
-- New cool art files have been added
-- To download the new ASCII files use the same link as before
-- For install the script, use the old instructions given
-- Enjoy
botName = "![AscIIArtBot]!?"
DirArray = {}
TimerStatus = 0
CommandStatus = 1
file = "ArtList.txt"
ErrorMsg = "You do not have enough privileges to execute this command."
function Main()
execute("dir AscIIArtFiles > ArtList.txt /B")
MakeArray(curUser)
local version = botName.." V:1.1 by [ES]latinmusic"
SendToAll(botName, "Script restarted.\r\n  "..version..date(" launched at day: %d/%m/%Y. Local Hub Time: %X."))
SendToAll(botName, "The 'AscII Art List File' have been generated.")
end
function DataArrival(curUser, data)
if strsub(data, 1, 1) ~= "<" then return end
local s, e, cmd, args = strfind(data, "^%b<> %-(%a+)%s*(.*)%|$")
if not s then return end
cmd = strlower(cmd)
if cmd == "showart" then
if CommandStatus == 1 then
variable = DirArray[random(1,getn(DirArray))]
local result = Show(TheFile)
curUser:SendData(botName,result)
else
curUser:SendData(botName,"The command '-showart' is temporarily deactivated.")
end
return 1
elseif cmd == "reloadart" then
if (curUser.iProfile ~= 0) then curUser:SendData(botName,ErrorMsg) return 1 end
execute("dir AscIIArtFiles > ArtList.txt /B")
MakeArray(curUser)
SendToAll(botName,"The 'AscII Art List File' have been updated.\r\n")
return 1
elseif cmd == "showhelp" then
curUser:SendData(botName,"List of the commands available for "..botName.."\r\n\r\nCommands --> Description\r\n-reloadart --> Reload the AscII art files\r\n-startimer --> Start the timer\r\n-stoptimer --> Stop the timer\r\n-showart --> Display AscII art files ramdomly on user request\r\n-showhelp --> Display this help\r\n")
elseif cmd == "startimer" then
if not curUser.bOperator then curUser:SendData(botName,ErrorMsg) return 1 end
if TimerStatus == 0 then
local s,e,_,minutes = strfind( data, "%b<>%s+(%S+)%s+(%S+)%|$")
if not s then curUser:SendData(botName,"Syntax: -startimer ") return 1 end
TimerStatus = 1
CommandStatus = 0
SetTimer(minutes*60000)
StartTimer()
curUser:SendData(botName,"The 'Timer' function have been activated. First 'AscII Art' will be displayed in "..minutes.." minute(s) from now.")
SendToAll(botName,"The command '-showart' have been temporarily deactivated.")
else
curUser:SendData(botName,"The 'Timer' function is already active.")
end
return 1
elseif cmd == "stoptimer" then
if not curUser.bOperator then curUser:SendData(botName,ErrorMsg) return 1 end
if TimerStatus == 1 then
TimerStatus = 0
CommandStatus = 1
StopTimer()
curUser:SendData(botName,"The 'Timer' function have been deactivated.")
SendToAll(botName,"The command '-showart' have been activated.")
else
curUser:SendData(botName,"The 'Timer' function is already deactivated.")
end
return 1
else return end
end
function MakeArray(curUser)
readfrom(file,"r")
while 1 do
local line = read()
if line == nil or line == "" then break
else
tinsert(DirArray, line)
end
end
readfrom()
return DirArray
end
function Show(TheFile)
readfrom("AscIIArtFiles/"..variable,"r")
local art = ""
while 1 do
local line = read()
if line == nil then break
else
art = art..line.."\r\n"
end
end
readfrom()
return art
end
function OnTimer()
variable = DirArray[random(1,getn(DirArray))]
local result = Show(TheFile)
SendToAll(botName,result)
end
Title:
Post by: acethecase on 15 December, 2003, 14:23:40
Nice One!!
Title:
Post by: MrBuitenhuizenJunior on 16 December, 2003, 05:06:37
Thnx [ES]latinmusic  :)

[NL]MrBuitenhuizen
Title: Finally
Post by: Hades on 16 December, 2003, 07:25:44
Great script.
Nice design and all I must say!!!
But can we make more fantastic art??
Please!!!

Keep up the great work latin!!!
Title:
Post by: kb2000 on 22 January, 2004, 16:22:14
QuoteOriginally posted by [ES]latinmusic
I was taking a look inside the Artbot 1.0 made by [NL]MrBuitenhuizen and does not like me because each ascii file requiered a single command, taking as an example, if i put 40 single ascii files i have in result 40 extra commands added to the current available commands running inside the hub. For this reason i have take the dessicion to make my own.
From readme.txt file included inside the zip file:
-- ![AscIIArtBot]!? V:1.0 by [ES]latinmusic << Compiled Version >>
-- Based as usual in tezlo code
-- Thanks to [NL]MrBuitenhuizen for the idea
-- AscII text files from Artbot 1.0 made by: [NL]MrBuitenhuizen
-- Two more cool files added :-)
-- Commands:
--> -showart  --> for all users, display ascii files randomly
--> -showhelp --> for all users, display the help of the bot
--> -startimer   --> for operators only, start the timer function.
--> -stoptimer  --> for operators only, stop the timer function.
--> -reloadart  --> for master only, reload the art files
-- Features:
-- Can display ascii files randomly using only one command
-- Can display ascii files randomly in main chat using a timer, the value for the timer can be easily setted by the command: -reloadart
-- If timer function is active, the command --> -showart is deactivated. Apropiated messages are displayed when you activate the timer or if a user is trying to use the command -showart
-- If timer function is NOT active, the command --> -showart is activated. Apropiated message is displayed when you deactivate the timer
-- You can add or delete ascii files without stopping or editting the script manually
-- NOTE: In case of addition or delection of the ascii files, update the script using
--> -reloadart
-- NOTE: The directory --> AscIIArtFiles can't be empty
-- NOTE: The file --> ArtList.txt created inside the script folder can't be deleted
-- How to install it?
-- Uncompress the zip into the script folder of ptokax
-- You will see 1 folder with the art files included, don't rename it
-- You will see this readme.txt
-- Don't delete nothing, all files and folders are requiered for the script
-- You need more help? --> Run the script and play with the commands.
-- Enjoy.............
The script can be downloaded from here (http://aracnidos.no-ip.org/PublicScripts/AscIIArtBot.zip)
I hope the link works, i was formating my machine last week..........

Can't download the zip file. Please help
Title:
Post by: plop on 23 January, 2004, 00:06:44
QuoteOriginally posted by kb2000
Can't download the zip file. Please help
he had a hdd crash last week.
don't know if he managed 2 recover everything, so i can be that the zip is lost.
if any1 has it pls give it 2 optimus or place it on a website and offcourse latin must like 2 have it back.

plop
Title:
Post by: SaintSinner on 23 January, 2004, 16:51:53
QuoteOriginally posted by plop

he had a hdd crash last week.
don't know if he managed 2 recover everything, so i can be that the zip is lost.
if any1 has it pls give it 2 optimus or place it on a website and offcourse latin must like 2 have it back.

plop

here  you go latin and kb2000


zip file (http://members.cox.net/saintsinner/AscIIArtBot.zip)
Title:
Post by: kb2000 on 23 January, 2004, 19:20:15
Thankyou saintsinner and plop..
Title:
Post by: plop on 24 January, 2004, 02:58:11
QuoteOriginally posted by SaintSinner
QuoteOriginally posted by plop

he had a hdd crash last week.
don't know if he managed 2 recover everything, so i can be that the zip is lost.
if any1 has it pls give it 2 optimus or place it on a website and offcourse latin must like 2 have it back.

plop

here  you go latin and kb2000


zip file (http://members.cox.net/saintsinner/AscIIArtBot.zip)
thx m8

plop
Title:
Post by: kb2000 on 24 January, 2004, 11:39:22
Where can i find more ASCII ART files......

TIA..
Title:
Post by: angelsanges on 24 January, 2004, 11:47:04
you can find some ascii arts Here (http://www.chris.com/ascii/)
Title:
Post by: kb2000 on 24 January, 2004, 12:52:18
Thanks a lot.....