Bot = "BOT"
function NewUserConnected(user)
if strfind(data, "rules",1,1) then
readfrom("rules.txt")
while 1 do
line = read()
if line == nil then break end
user:SendPM(Bot,line)
end
readfrom()
end
end
If i am correct - then that will send to connected users the "Rules"
Still fairly new to LUA and was wondering from this that i have used - how would i now develop this to not show a bot on the userlist??
well u can simply do
function Main()
frmHub:RegBot(Bot)
end
So that would work ??
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(user)
if strfind(data, "rules",1,1) then
readfrom("rules.txt")
while 1 do
line = read()
if line == nil then break end
user:SendPM(Bot,line)
end
readfrom()
end
end
QuoteOriginally posted by Woodster
So that would work ??
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(user)
if strfind(data, "rules",1,1) then
readfrom("rules.txt")
while 1 do
line = read()
if line == nil then break end
user:SendPM(Bot,line)
end
readfrom()
end
end
no
function NewUserConnected(user)
if strfind(data, "rules",1,1) then
readfrom("rules.txt")
while 1 do
line = read()
if line == nil then break end
user:SendPM(Bot,line)
end
readfrom()
end
end
this is wrong ;)
if strfind(data, "rules",1,1) then
what data?
function NewUserConnected(user)
readfrom("rules.txt")
while 1 do
line = read()
if line == nil then
break
end
user:SendPM(Bot,line)
end
readfrom()
end
Just tested it and it doesnt send the Rules on connection???
What have i done wrong?
^
I dont know what im doing wrong but still it is not sending the rules to connecting users??
QuoteOriginally posted by Woodster
I dont know what im doing wrong but still it is not sending the rules to connecting users??
hvae you made file named rules.txt?
Yup! This is what i using:
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(user)
readfrom("rules.txt")
while 1 do
line = read()
if line == nil then
break
end
user:SendPM(Bot,line)
end
readfrom()
end
(its probably that which is incorrect)
my mistake lol
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(user)
readfrom("rules.txt")
while 1 do
line = read()
if line == nil then
break
end
user:SendPM(Bot,line)
readfrom()
end
end
plz when posying code use [ c o d e ] [ / c o d e ] without spaces :)
ok then :) sorry
LOL
Bet ya getting annoyed now!! lol
still not working......
where do i save the rules.txt?
lol dont forget to add
Bot = "whatever"
and the rules file goes in scripts dir
Bot = "Rules"
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(user)
readfrom("rules.txt")
while 1 do
line = read()
if line == nil then
break
end
user:SendPM(Bot,line)
readfrom()
end
end
lol, this lua thing is frustrating when it dont work lol!!
Last attempt otherwise im not gonna bother!
Will that pm Users, Reg's, Op's, Masters etc.. the rules on connection??
no
add this line
OpConnected = NewUserConnected
grr got me all confused lol
Bot = "Rules"
function Main()
frmHub:RegBot(Bot)
end
OpConnected = NewUserConnected
function NewUserConnected(user)
readfrom("rules.txt")
while 1 do
line = read()
if line == nil then
break
end
user:SendPM(Bot,line)
end
readfrom()
end