Hi, guys!
Who can help me with this? Here is my connection script:
function NewUserConnected(user)
SendToAll("Someone witn nick "..user.sName.." has just entered the hub!")
end
function OpConnected(user)
SendToAll("Operator "..user.sName.." has just entered the hub!")
end
And here is disconnection script:
oprofiles = {
["unreg"] = "Unreg user [user] has left the hub",
["Master"] = "Master with nick [user] has left the hub",
["Operator"] = "Operator with nick [user] has left the hub",
["VIP"] = "VIP with nick [user] has left the hub",
["Reg"] = "Reg with nick [user] has left the hub",}
layout = ""
function UserDisconnected(curUser)
getmessages(curUser, "out")
end
function OpDisconnected(curUser)
getmessages(curUser, "out")
end
function announce(user, string)
local arrTmp = substitute(user, string)
SendToAll(layout..arrTmp)
end
function substitute(user, string)
local arrTmp = gsub(string, "%[usercount%]", frmHub:GetUsersCount())
arrTmp = gsub(arrTmp, "%[crlf%]", "\r\n")
if type(user) == "table" then
local myinfo = user.sMyInfoString
local _, _, desc, speed, email, sharesize = strfind(myinfo, "$ALL %S+ (.*)%$ %$(.+)%$(.*)%$(%d+)%$");
arrTmp = gsub(arrTmp, "%[user%]", user.sName)
end
return arrTmp
end
function getmessages(user, io)
local userprofile = GetProfileName(user.iProfile)
if user.iProfile == -1 then
userprofile = "unreg"
end
if userprofile == nil then userprofile = "LOL" end
if oprofiles["$"..user.sName] then
announce(user, oprofiles["$"..user.sName])
elseif oprofiles[userprofile] then
announce(user, oprofiles[userprofile])
end
end
So I wanted every user could Turn ON and OFF this functions on my hub for himself.
If somebody writes !turn off he will never see both connection and disconnection messages again (but other users will see them)
If somebody writes !turn on he will see this messages again (and the other users will see them too).
So I wanted a script that will write names of the users (on !turn off) who don't want to see both connection and disconnection messages to a file (for example users.dat).
And If the name of the user is written in this file, he will never see this messages again.
But If there are no user name in a file (on !turn on) he will see this messages every time somebody connects/disconnects.
There is Such a Script!
And you Can make it thru DC++ settings
And i don't think you want that :)
[*edit]
Funny...
So, who can help me with that? I need it very much. Plizzzzzzzzzzzzzzz help me :(
it's posible but not a good idea.
it would increase the used resources a lot.
instead of 1 send command you need 1 for every user who has it enabled.
plop
But I don't really know how to make that script. Can you help me with it?
[*edit]
Plizzzz :)
QuoteOriginally posted by NemeziS
But I don't really know how to make that script. Can you help me with it?
[*edit]
Plizzzz :)
i don't mind helping but it's gone be the long way home.
you're gone make it from scratch.
and pls folow my leads so this topic ends up in a good lesson for other ppl.
1st task is very simple (you need some basic skills before starting pattern matching which is needed for the on/off switch).
drop the 2nd script you posted for now, whe'll get back 2 that later.
use the 1st script as a lead and add the same kind of msg for when a user/op leaves.
plop