PtokaX forum

Lua 5.3/5.2/5.1 Scripts (for PtokaX 0.4.0.0 and newer) => Finished Scripts => Topic started by: [ vAiBhAv?] on 28 June, 2009, 10:01:36

Title: LoginMsg API 2
Post by: [ vAiBhAv?] on 28 June, 2009, 10:01:36
here's the fixed version.. included credits
Title: Re: ConnectStats 1.0d LUA 5.1x [API 2]
Post by: [ vAiBhAv?] on 28 June, 2009, 15:04:43
I Searched For This Name.. Not Getting.. Can You Give Me The Direct Link Of The Script Page ?
Title: Re: LoginMsg API 2
Post by: [ vAiBhAv?] on 28 June, 2009, 15:31:33
Thank You Very Much DUDE !  :)
Title: Re: LoginMsg API 2
Post by: PTGenius on 17 May, 2012, 19:19:09
Hi dudes

The script don?t work fine, Reg users and Vips don?t see the info but i change the profile and if vip our reg have Opkey can see.
Its possible change the script for all users see the info on login?
Title: Re: LoginMsg API 2
Post by: the-master on 18 May, 2012, 08:14:00
--[[

LoginMsg 1.0 LUA 5.0/5.1

By Mutor 01/24/07

Requested by Saurabh

Sends info to new connections on login

Converted To API 2 by [ vAiBhAv?]
]]

function UserConnected(user)
Core.GetUserAllData(user)
local Profile = GetProfileName(user.iProfile)
local Share = Core.GetUserValue(user,16) or 0
local bdr = "\t\t"..string.rep("=",36)..""
local Msg = "\r\n\r\n"..bdr.."\r\n"..
"\t\t? Hub Name : "..SetMan.GetString(0).."\r\n"..
"\t\t? Hub Address : "..SetMan.GetString(2)..":"..SetMan.GetString(3).."\r\n"..
"\t\t? Hub Uptime : "..Core.GetUpTime().." seconds\r\n"..
"\t\t? Registered At : "..SetMan.GetString(7).."\r\n"..
"\t\t? Date And Time : "..os.date("%d %B %Y - %X ").."\r\n"..
"\t\t? Peak Users : "..Core.GetMaxUsersPeak().."\r\n"..
"\t\t? Your Nick : "..user.sNick.."\r\n"..
"\t\t? Your Profile : "..Profile.."\r\n"..
"\t\t? Your Share : "..FormatSize(Share).."\r\n"..
"\t\t? Your IP : "..user.sIP.."\r\n"..bdr
Core.SendToUser(user,Msg)
end
OpConnected,RegConnected,NewUserConnected = UserConnected,UserConnected,UserConnected

-- Format Size By kepp and NotRambitWombat
FormatSize = function(intSize)
local tUnits = { "B", "KB", "MB", "GB", "TB" }
intSize = tonumber(intSize);
if intSize ~= 0 then
local sUnits;
for index = 1, #tUnits do
if(intSize < 1024) then
sUnits = tUnits[index]
break
else
intSize = intSize / 1024
end
end
return string.format("%0.2f %s",intSize, sUnits)
end
return string.format("%0.2f %s",0, tUnits[1])
end

function GetProfileName(nr)
local Prof = ProfMan.GetProfile(nr)
if Prof then
return Prof.sProfileName
else
return "Unregistered User"
end
end
Title: Re: LoginMsg API 2
Post by: Black-Dragon on 19 May, 2012, 01:12:44
hello , its possible pm ?
Title: Re: LoginMsg API 2
Post by: the-master on 19 May, 2012, 06:31:54
Sure, replace    Core.SendToUser(user,Msg)
with   Core.SendPmToUser(user,SetMan.GetString(21),Msg)
Title: Re: LoginMsg API 2
Post by: Black-Dragon on 20 May, 2012, 12:55:43
thx the master