PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Smulf on 15 January, 2004, 16:34:22

Title: Rules in Main
Post by: Smulf on 15 January, 2004, 16:34:22
I need a simpel script that shows the Hub rules in the main chat window then a user connects. I need to write the rules in a text file, so they have to be shown from there...

Thx for your time...
Title: Rewriting the Subject:)
Post by: Smulf on 15 January, 2004, 17:13:31
Well I'v tried:

botname = "OP_Rules"
file = "rules.txt"

function NewUserConnected(user)
readfrom(file)
local message = ""
while 1 do
local line = read()
if (line == nil) then break else
message = message..line.."\r\n"
end
end
user:SendPM(botname,message)
end
 

But when the message apears it saids: "Private message from OP_Rules: "... Is it posible to remove the first part, so it only saids: ""...?
Title:
Post by: raz on 15 January, 2004, 17:29:17
why u want 2 to send them 2 a user when u got op rules written as bot name. lol  :D
Title:
Post by: Pacman on 15 January, 2004, 18:11:45
botname = "OP_Rules"
file = "rules.txt"

function NewUserConnected(user)
readfrom(file)
local message = ""
while 1 do
local line = read()
if (line == nil) then break else
message = message..line.."\r\n"
end
end
user:SendData(botname,message)
end

try that.

// Pacman
Title:
Post by: Smulf on 16 January, 2004, 16:53:17
--> raz; all my scripts has "OP_", in front...

--> Pacman; it dosn't work... And I'v found out that the other script, dosn't work at all... damn...
Title: Quick reply
Post by: Smulf on 16 January, 2004, 16:55:42
Sry Pacman, it was because I was logged in as an OP... all thing is fine, thx for the help...