i just want to send the rules from rules.txt whitout getting every line a new line from the txt file
rules.txt: (with the "enters")
rule 1
rule 2
rule 3
rules!!!
than we get the lua code:
if cmd == "!rules" or cmd == "+rules" then
SendRules(user)
return 1
-------------------------------------------------
function SendRules(user)
readfrom("txt/rules.txt")
while 1 do
line = read()
if line == nil then
break
end
user:SendData(Bot,line)
end
readfrom()
end
i get as result:
[13:56] <-=[ToXiC?]=-> rule 1
[13:56] <-=[ToXiC?]=-> rule 2
[13:56] <-=[ToXiC?]=-> rule 3
[13:56] <-=[ToXiC?]=-> rules!!!
but i want the results like:
[13:56] <-=[ToXiC?]=->
rule 1
rule 2
rule 3
rules!!!
can some1 help me fixt it??
sorry for my crappy engish ;-)
//ZeroX
here are some hints, you try 2 place them on the right place.
local text = "\r\n" --- declare text which is gone hold the full file (starting with a line feed)
text = line.."\r\n" -- insert the line into text ending with a line feed
user:SendData(Bot,text.."|") -- sending the full text
as you see every line has it's comments so it should be easy 2 find there place.
plop
i dont get it now i'm getting after every rule a break
[18:44] <-=[ToXiC?]=-> rule 1
[18:44] <-=[ToXiC?]=-> rule 2
[18:44] <-=[ToXiC?]=-> rule 3
[18:44] <-=[ToXiC?]=-> rules!!!
(i had it a few hours ago when i was try-ing a lot of things)
my code currentyl says:
function SendRules(user)
readfrom("txt/rules.txt")
while 1 do
line = read()
local text = "\r\n"
if line == nil then
break
end
text = line.."\r\n"
user:SendData(Bot,text.."|")
end
readfrom()
end
hope some1 can help me out
ZeroX
try this m8 :- ( untested )
function SendRules(user)
readfrom("txt/rules.txt")
local text = "\r\n"
while 1 do
line = read()
if line == nil then
break
end
text = text.."\r\n"..line
end
user:SendData(Bot,text.."|")
readfrom()
end
yup thnx m8 its WORKING 8) :D :)) :]
:))
damn my hints had a bug. lol
but thx for fixing it hawk.
plop
he he he
plop
i learned it all from you and the other great scripters in here m8
unfortunately its taken me 4 months to learn enough to be of some use here, however little it is