could someone please make me a pm upon eantering script one to pm ops when they enter and one to pm regular users when they enter?
Bot = "Your_Bot_Name_Here"
function NewOpConnected(user)
SendPmToAll(Bot, "Welcome Home "..user.sName.." Beware this beast ...")
end
function OpDisconnected(user)
SendPmToAll(Bot, "Where do you think you are going "..user.sName.."? Get back emediately...")
end
-- Modified by BlazeX
-- Originally written by Kepp
Bot = "Your_Bot_Name_Here"
function NewOpConnected(user)
SendPmToNick(Bot, "Welcome Home "..user.sName.." Beware this beast ...")
end
function OpDisconnected(user)
SendPmToNick(Bot, "Where do you think you are going "..user.sName.."? Get back emediately...")
end
function NewUserConnected(user)
SendPmToNick(Bot, "Welcome Home "..user.sName.." Enjoy Your Stay ...")
end
function UserDisconnected(user)
SendPmToNick(Bot, "Bye Bye "..user.sName.." Thx for your stay ...")
end
--- End of Script
Kepp: I think he asked for new users too.. not just OPs.. So i just made a little modification to ur original one.. :D
oups, 2 more cup of coffe's and i would have done that :D :P
HeeHee.. lol.. No probs :)
ahhh thanks guys
Yo blaze do you think u can have it where it loads from a text file? and the disconnecting messege could be takin out I only would like to pm them when they enter.
ya having it read from a terxt file would be nice.
OK No problem.. I will write one tonight and post it ..
Bot = "BotName_Here"
file = "txt/Welcome.txt"
function OpConnected(user)
readfrom(file,"a")
msg = ""
while 1 do
line = read()
if line == nil then break
else
message = msg..line.."\r\n"
end
end
SendPmToNick(Bot, message)
readfrom()
return 1
end
I have not tested this one!
Hia :)
I wrote one few months back, which reads two seperate files for diff profiles.. Might be useful for others..
-- Start copying from this line
-- Requested by liq?i?sw?rdz
-- Written by BlazeXxX
Bot = "Welcomer"
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(curUser)
readfrom("users.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
function NewOpConnected(curUser)
readfrom("op.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
Just what I was looking for...thanks blaze
No probs.. You can try kepp's one to .. u have alternatives to choose from :)
Yo i cant get neither script to work can someone please help...............anybody
Hello,
I don't know this was the cause of the problem but maybe it is....
I've done a little change in the script:
("function NewOpConnected(curUser)" -> "function OpConnected(curUser)"
now the Op gets the message every time he connects and not only when he is a new one.
Add your own profiles, as example I have now added the profiles: OP, SOP and MASTER.
Don't forget to make your .txt documents.
-- Requested by liq?i?sw?rdz
-- Written by BlazeXxX
Bot = "your botname here"
function Main()
frmHub:RegBot(Bot)
end
function OpConnected(curUser)
readfrom("op.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
function SOPConnected(curUser)
readfrom("sop.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
function MASTERConnected(curUser)
readfrom("master.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
-----
[NL]MrBuitenhuizen
And you noticed that your script dosen't work :P
To display some rules for a certain Profile
you can just use
if curUser.iProfile == 0 or
curUser.iProfile == 1 then
--// Open up some text for those two
end
Hello,
You're right it doesn't open the .txt file, but for me it works because I write the message between the " ", at:
"local message = " " "
So it doesn't work the way wanted (load from a txt file)
So now we wait when you're returning from your work kepp :D
[NL]MrBuitenhuizen
Having the script load from different files for different profiles would be nice.....but I have tried alllot of scripts and none seem to work. So if yours work please post
with instructions please
OK Sorry.. I didn't test it man.. Will post a new one that works with all profiles :)
Bye 4 now :)
I made some changes on a script... and would like to know if it will works or not...(I'm the only admin of the hub cause I want to be the only one to receive this message)
"
BotName = "my bot name"
function NewUserConnected(curUser)
SendPmToAdmin(Bot, "User: "..curUser..", a not registered user enter the hub...")
end
function NewUserDisconnected(user)
SendPmToAdmin(Bot, "User: "..curUser.." is gone...")
end
"
Instead of : "SendPmToAdmin"..
Is there another stuff like SendPmToMe or something else I don't know???
Could you correct it if it needs..
Other stuff..
In the "gone" message I would like to know how many time the user spend on the hub...possible???Could you add this fonction on my script???
Thanx to reply...and correct me...That's better to learn when mistakes are said by a good teacher..lol
++
Actually I'm sure my script contains mistakes cause new users just connected and I didn't received anything :(
Hi there,
See if this one helps.. I modified the script for you..
Byez,
BlazeX
--// Modified by BlazeXxX
--// Random Intros and Outros
--// Originally By Chaggydawg
HubOwner = "HubOwnerName"
intros = {
"[USERNAME] Crawls In On Their Hands And Knees.",
"In A Fiery Explosion [USERNAME] Appears.",
"With A Crazed Look In Their Eyes [USERNAME] Arrives.",
"Sir [USERNAME] Of The East Lunatic Fringe Has Arrived.",
"[USERNAME] Arrives Yelling And Screaming Like A Maniac.",
"[USERNAME] Arrives Ranting And Raving About Aliens Or Some Such Rot.",
"The Demented [USERNAME] Has Arrived.",
"[USERNAME] Climbs In Through The Window.",
"[USERNAME] Falls From The Skylight And Lands On A Chair.",
"[USERNAME] Enters the Room Via The Basement Door.",
"[USERNAME] is here, How about a round of elfgirls for everyone?",
}
outros = {
"[USERNAME] Has Left The Hub",
"Jumping Through A Plate-Glass Window [USERNAME] Leaves The Hub.",
"Aliens Rocks Abduct [USERNAME], And They Are Gone.",
"[USERNAME] Begins Shrinking, And Eventually Disappears From The Hub.",
"Suddenly [USERNAME] Leaps Up And Bolts For The Door.",
"[USERNAME] Tosses A Ten On Janine Dresser And Walks Out The Door.",
"[USERNAME] Runs Around The Room Screaming And Then Leaps Out The Window.",
}
function OpConnected(curUser)
Blaze = GetProfileName(curUser.iProfile)
if GetProfileName(curUser.iProfile) == "Master" then Blaze = "Administrator" end
if curUser.sName == HubOwner then Blaze = "Hub Owner" end
intro, x = gsub(intros[random(1,getn(intros))], "%b[]", curUser.sName)
SendToAll(Blaze, intro)
end
function OpDisconnected(curUser)
Blaze = GetProfileName(curUser.iProfile)
if GetProfileName(curUser.iProfile) == "Master" then Blaze = "Administrator" end
if curUser.sName == HubOwner then Blaze = "Hub Owner" end
outro, x = gsub(outros[random(1,getn(outros))], "%b[]", curUser.sName)
SendToAll(Blaze, outro)
end