Hi,
I'd like a script that sends a PM to every user on connect.
Thanks!! :D
Can u explain more about what u are wanting(if possible give some examples pls)?
I would like a script that send a message like this:
"Register yourself now!!" in PM to every not register user on login.
do you understand? :)
This is the most simple script which sends reg message on connect if not reg user..
sBot = "RegtoHub" -- Reg message send with this name. Use " "
ShowBot = 1 -- If it is 0, the bot can not see like an op in the user list and the message send to main(Dc++). Don't use " "
RegMsg = "Please Register to Hub" -- Reg message. Change with your reg message. Use " "
function Main()
if ShowBot == 1 then
frmHub:RegBot(sBot)
end
end
function NewUserConnected(curUser)
if curUser.bRegistered ~= 1 then
curUser:SendPM(sBot,RegMsg)
end
end
If it s what u want good uses
Changed RegBot location as bastya_elvtars' warning. (thx)
1) Please use RegBot in Main() to save resources, enough to reg only once. :)
2) user.bRegistered can NEVER be 1, it's a boolean, it can be true or false. Use like:
if user.bRegistered then -- yes, it is
if not user.bRegistered then -- nope, it ain't
No offences, just advice. ;-)
QuoteOriginally posted by bastya_elvtars
user.bRegistered can NEVER be 1, it's a boolean, it can be true or false. Use like:
I try this code now and it gives 1
function NewUserConnected(curUser)
a = curUser.bRegistered
curUser:SendPM(sBot,a)
end
thx again for first one..
;)
function NewUserConnected(curUser)
if user.iProfile == -1 then
curUser:SendPM(sBot,RegMsg)
end
end
From Lua manual;
In Lua, both nil and false make a condition false; any other value makes it true.
So user.bRegistered will return nil as false and a non-nil value as true (ive never seen it return true as anything but 1)