Hey ladies and gents... well i've been tryin to find a bot That works... i whant it to send a welcome message in pm... like the rules ... Got one but it seems to be something wroong with it... couse it just sends the rules in the main chatt would relly like one to that works for users and ops in pm messages thx....
Cheers =P
hey.. got it to work but whant it to be able to use as command to like !rules i use mean machine and when i add the rules in rules.txt it shows in main window so if someone can help me....
Oh and i use this script......
--Requested by Woodster
--Made by nErBoS
Bot = "Welcome-Bot"
welcome = "text/welcome.txt" --in script folder
rules = "text/rules.txt"
disclaimer = "text/dsc.txt"
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(user, data)
Readtextfile(user, welcome)
Readtextfile(user, rules)
Readtextfile(user, disclaimer)
end
function Readtextfile(user, file)
local filecontents = ""
local handle = openfile(file, "r")
if (handle ~= nil) then
local line = read(handle)
while line do
filecontents = filecontents..line.."\r\n"
line = read(handle)
end
closefile(handle)
user:SendPM(Bot, filecontents)
end
end
LoL Well got it to dissapear was pretty easy... but still whant it to show rules in pm to op's and master... will tell u al if i get it to work... if its possible to get it to do so....
Cheers =P
Hi,
If i understand you want the bot to send the rules to ops and master in pm when they get connected ???
And what about users ??
Can you be more clear on your request.
Best regards, nErBoS
Yes like i said masters and op's and offcourse users to... the thing is i use mean machine and it has the inbuilt command !rules i would relly like so it can be shown in pm to like first when everyone logs on it shows the rules in pm... and when u write !rules/+Rules it shows the rules again in pm =)... if its possible
Cheers =P
Hi,
Is this what you want ???...
--Requested by uNiOn
--Made by nErBoS
Bot = "Welcome-Bot"
rules = "text/rules.txt" --Location of rules txt
sRules = ""
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(user, data)
if (sRules == "" and readfrom(rules) ~= nil) then
Readtextfile(rules, sRules)
elseif (sRules ~= "") then
user:SendPM(Bot, sRules)
end
end
OpConnected = NewUserConnected
function Readtextfile(file, string)
readfrom(file)
while 1 do
local line = read()
if (line == nil) then
break
else
string = string..line.."\r\n"
end
end
readfrom()
return string
end
Best regards, nErBoS
yeah thats almost right but that will do it i think thx agin
Cheers =P
A small bugg caused the textfile to be read every time...
--Requested by uNiOn
--Made by nErBoS
--Small fix by Skrollster
Bot = "Welcome-Bot"
rules = "text/rules.txt" --Location of rules txt
sRules = ""
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(user, data)
if (sRules == "" and readfrom(rules) ~= nil) then
sRules = Readtextfile(rules)
user:SendPM(Bot, sRules)
elseif (sRules ~= "") then
user:SendPM(Bot, sRules)
end
end
OpConnected = NewUserConnected
function Readtextfile(file)
local string
readfrom(file)
while 1 do
local line = read()
if (line == nil) then
break
else
string = string..line.."\r\n"
end
end
readfrom()
return string
end
Hi,
Yep Skrollster you are right thanks.
Best regards, nErBoS