hi all
i need a script that pop up a new page for rules
this way all poeple who log will see it
thanx in advance
Riouel 8)
Hi there,,
--mini onconect rules on request
--by phatty
--make a file in the scripts directory called rules.txt for your rules
Bot = "Wolf"
RulesFile = "rules.txt"
function NewUserConnect(user)
readfrom(RulesFile)
while 1 do
line = read("*a")
if line == nil then
break
end
user:SendData(Bot,line)
readfrom()
end
end
l8rr,,
-phatty
It works NOT!!
- Start Copying from here
- Scripted by BlazeX
- Requested By Riouel
Bot = "RulesBOT"
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(curUser)
readfrom("rules.txt")
local message = ""
while 1 do
local line = read()
if (line == nil) then break else
message = message..line.."\r\n"
end
end
curUser:SendPM(Bot,message)
end
- Finish copying at this line
You need to have a text file called rules.txt in your scripts directory.. once u done that, restart ur scripts..
REMEBER: IT won't show the rules, if u are logged in as op ! so login as user, u will see it!
Cya!
just... one thing I don't think its so great to have the hub read from disk everytime a user connects so I would do it like this actually
File = "File.txt"
function Main()
rules = function ReadFile()
end
function NewUserConnected(curUser)
curUser:SendData(rules)
end
function ReadFile()
local handle = openfile("txt/"..File, "r")
if handle then
local contents = gsub(read(handle, "*a"),strchar(10), "\r\n")
closefile (handle)
return contents
end
end
1 + 4 = 5
2 + 3 = 5
Does the same job, hehe.. kidding ;) will try that one and see how effective it is :D
THANX BlazeXxX ;)
I WORK LIKE I WANT
I REALLY APRECIATE IT
Riouel :D
QuoteOriginally posted by (uk-kingdom)pH?tt?
Hi there,,
--mini onconect rules on request
--by phatty
--make a file in the scripts directory called rules.txt for your rules
Bot = "Wolf"
RulesFile = "rules.txt"
function NewUserConnect(user)
readfrom(RulesFile)
while 1 do
line = read("*a")
if line == nil then
break
end
user:SendData(Bot,line)
readfrom()
end
end
l8rr,,
-phatty
oops sorry i made one tiny little mistake, my head was spinning that night lol
--mini onconect rules on request
--by phatty
--make a file in the scripts directory called rules.txt for your rules
Bot = "Wolf"
RulesFile = "rules.txt"
function NewUserConnected(user)
readfrom(RulesFile)
while 1 do
line = read("*a")
if line == nil then
break
end
user:SendData(Bot,line)
readfrom()
end
end
so it does work :P