Need a Pm when entering script
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Need a Pm when entering script

Started by liq?i?sw?rdz, 17 November, 2003, 11:39:51

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

liq?i?sw?rdz

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?
a sl?t is a terrible thing to waste
[]-[]-[]-free_l?aders_Paradis?-[]-[]-[]

kepp

#1
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
Guarding    

BlazeXxX

#2
-- 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

kepp

oups, 2 more cup of coffe's and i would have done that :D :P
Guarding    

BlazeXxX

HeeHee.. lol.. No probs :)

liq?i?sw?rdz

a sl?t is a terrible thing to waste
[]-[]-[]-free_l?aders_Paradis?-[]-[]-[]

liq?i?sw?rdz

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.
a sl?t is a terrible thing to waste
[]-[]-[]-free_l?aders_Paradis?-[]-[]-[]

lazyj189

ya having it read from a terxt file would be nice.
DivX Dominion Hub Owner
3 years running
DivX Dominion Hub

BlazeXxX

OK No problem.. I will write one tonight and post it ..

kepp

#9
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!
Guarding    

BlazeXxX

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

liq?i?sw?rdz

Just what I was looking for...thanks blaze
a sl?t is a terrible thing to waste
[]-[]-[]-free_l?aders_Paradis?-[]-[]-[]

BlazeXxX

No probs.. You can try kepp's one to .. u have alternatives to choose from :)

liq?i?sw?rdz

Yo i cant get neither script to work can someone please help...............anybody
a sl?t is a terrible thing to waste
[]-[]-[]-free_l?aders_Paradis?-[]-[]-[]

MrBuitenhuizenJunior

#14
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

kepp

#15
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
Guarding    

MrBuitenhuizenJunior

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

liq?i?sw?rdz

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
a sl?t is a terrible thing to waste
[]-[]-[]-free_l?aders_Paradis?-[]-[]-[]

BlazeXxX

OK Sorry.. I didn't test it man.. Will post a new one that works with all profiles :)

Bye 4 now :)

Fire Koboy

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
++
Burn Baby, Burn...

Fire Koboy

Actually I'm sure my script contains mistakes cause new users just connected and I didn't received anything :(
Burn Baby, Burn...

BlazeXxX

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

SMF spam blocked by CleanTalk