PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: Re@SoN on 26 January, 2005, 18:26:04

Title: help with the script artbot
Post by: Re@SoN on 26 January, 2005, 18:26:04
hello!

cold anyone help me  put this script showing the txt in pm instead of showing in the main chat when we do the comand??
here is the script:

----------------------------------------------------------------------
--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 = "? M?X?H?Lp ?"
Files = {
["!lol"] = "txt/art/lol.txt",
["!codecs"] = "txt/art/codecs.txt",
["!programas"]= "txt/art/programas.txt",
["!cracks"]= "txt/art/cracks.txt",
["!uteis"]= "txt/art/uteis.txt",
["!legendas"]= "txt/art/legendas.txt",
["!speed"]= "txt/art/speed-test.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
-----------------------------------------------------------------------

greatings, Re@SoN
Title:
Post by: [UK]Madman on 26 January, 2005, 18:44:45
Change

SendToAll( BotName, message ) -- send bot's message

for

user:SendPm(BotName, message)
Title:
Post by: [UK]Madman on 26 January, 2005, 19:06:09
Quite right mutor, forgot about that :o)
Title:
Post by: Re@SoN on 27 January, 2005, 03:34:19
tks Mutor!!! :D

i already tested and it works fine now the txt apears em pm...much better now..heh


greatings, Re@SoN