PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: slick on 10 July, 2005, 17:56:35

Title: simple script
Post by: slick on 10 July, 2005, 17:56:35
i'm looking for a simple script that any user can type in a certain command and it will open a text file maybe one exists dunno but i couldn't find nothing
Title:
Post by: slick on 11 July, 2005, 19:59:57
ok i searched again, i'm sorry but i know absolutely nothing about scripts, so i don't know what to search for i d/l a few such as message boards chat bots and a readme one but none do the simple thing that i want done, my apoligies if i seem stupid
Title:
Post by: Dessamator on 11 July, 2005, 22:23:47
try searching the forum for.: "ptokax text support"
Title:
Post by: slick on 11 July, 2005, 23:59:52
funny thing i had what i needed all along readme 1.0 {hmm wonder who wrote it :) } just didn't clue in there had to be text in the text file, anyway it does what i want t/y except only seems that ops can excess it could you please tell me what needs to be changed so every level of user can excess it


--Readme 1.0
--by Mutor
--
Command ="+commands"
TextFile ="commands.txt"
Send2All ="no" --Show all users? "yes"/"no"
--
function DataArrival(user, data)
s,e,cmd = strfind(data,"^%b<>%s(%S+)|")
   if cmd == Command then
      if user.bOperator then
         ReadText(user)
         return 1
      end
   end
end

function ReadText(user)
readfrom(TextFile)
while 1 do
local line = read()
if line == nil then break end
if Send2All =="yes" then
SendToAll(line)
else
user:SendData(line)
end
end
readfrom()
end
Title:
Post by: slick on 12 July, 2005, 02:09:19
thank you very much i only need it to open just the one text file