A simple welcome message
 

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

A simple welcome message

Started by bsalsa, 16 February, 2004, 16:48:11

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bsalsa

I am looking for a script that will send a welcome message in main chat of the user to all user/op that connects to the hub like this :

welcome" xxxx:.
your ip is" xxxx .
your isp is :"xxxx.
you have xxxx  gb shared.
you have xxx slots for upload xxx slots for download.
you are connected to :



thanks

bsalsa

every user/op that connects to the hub will get this message in his mainchat window

Woodster

#2
sBotName = "Bot_Name"

frmHub:RegBot(sBotName)

 

function CountMASTERs()
local tmp, online = GetUsersByProfile(GetProfileName(0)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end
end return online.n
end

function CountOPs()
local tmp, online = GetUsersByProfile(GetProfileName(1)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end
end return online.n
end


function CountVIPs()
local tmp, online = GetUsersByProfile(GetProfileName(2)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end
end return online.n
end

function CountRegs()
local tmp, online = GetUsersByProfile(GetProfileName(3)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end
end return online.n
end

function OpConnected(user)
local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$")
usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))

local tmp
tmp = "Welcome to "..frmHub:GetHubName().."\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n"
tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n"
tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Hub Name: "..frmHub:GetHubName().."\r\n"
tmp = tmp.."\t??? Hub Address: ....\r\n"
tmp = tmp.."\t??? Hub Desc: "..frmHub:GetHubDescr().."\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules.  Please Read and Abide by them! \r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Masters Online: "..CountMASTERs().."\r\n"
tmp = tmp.."\t??? Operators Online: "..CountOPs().."\r\n"
tmp = tmp.."\t??? VIPs Online: "..CountVIPs().."\r\n"
tmp = tmp.."\t??? REGs Online: "..CountRegs().."\r\n"
tmp = tmp.."\ \r\n"

user:SendPM(sBotName,tmp)
end


--function NewUserConnected(user)
--   local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$")
--   usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))

function NewUserConnected(user)
i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)$")
-- this if routine is checking so if the share cannot be extracted , shre equals to zero. and
-- prevents nil / 1024 * 1024 * 1024 (which are causing the error)
if share == nil then
share = 0
end
usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))  

local tmp
tmp = "Welcome to "..frmHub:GetHubName().."\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n"
tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n"
tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Hub Name: "..frmHub:GetHubName().."\r\n"
tmp = tmp.."\t??? Hub Address: ....\r\n"
tmp = tmp.."\t??? Hub Desc: "..frmHub:GetHubDescr().."\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules.  Please Read and Abide by them! \r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Users Online: "..frmHub:GetUsersCount().."\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Masters Online: "..CountMASTERs().."\r\n"
tmp = tmp.."\t??? Operators Online: "..CountOPs().."\r\n"
tmp = tmp.."\t??? VIPs Online: "..CountVIPs().."\r\n"
tmp = tmp.."\t??? REGs Online: "..CountRegs().."\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? To see the NEWEST additions, type  !tag \r\n"
tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules.  Read them!! \r\n"
tmp = tmp.."\t??? Be sure to READ EVERYTHING in the Main chat window!! \r\n"
tmp = tmp.."\t??? If you like this hub, don't forget to add it to your favorites by typing /fav in mainchat \r\n"
 
user:SendPM(sBotName,tmp)
end

Hope its what you wanted
Owner of UK...     dc-hubs2     ...UK
Main Address dc-hubs2.ath.cx
Alt Address dc-hubs.no-ip.com
Apart of DC-HUBS NETWORK

Woodster

Sorry not quite what you wanted but it send to everyone via PM
Owner of UK...     dc-hubs2     ...UK
Main Address dc-hubs2.ath.cx
Alt Address dc-hubs.no-ip.com
Apart of DC-HUBS NETWORK

bsalsa

i fixed it to my needs and all is working fine (in mainchat as i wanted)
here is the finished script :


sBotName = "welcome"

frmHub:RegBot(sBotName)



function CountMASTERs()
local tmp, online = GetUsersByProfile(GetProfileName(0)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end
end return online.n
end

function CountOPs()
local tmp, online = GetUsersByProfile(GetProfileName(1)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end
end return online.n
end


function CountVIPs()
local tmp, online = GetUsersByProfile(GetProfileName(2)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end
end return online.n
end

function CountRegs()
local tmp, online = GetUsersByProfile(GetProfileName(3)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end
end return online.n
end

function OpConnected(user)
local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$")
usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))

local tmp
local tmp

tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n"
tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n"
tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n"
tmp = tmp.."\t??? Total Friends Online: "..frmHub:GetUsersCount().."\r\n"

user:SendData(sBotName,tmp)
end


--function NewUserConnected(user)
-- local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$")
-- usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))

function NewUserConnected(user)
i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)$")
-- this if routine is checking so if the share cannot be extracted , shre equals to zero. and
-- prevents nil / 1024 * 1024 * 1024 (which are causing the error)
if share == nil then
share = 0
end
usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))

local tmp

tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n"
tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n"
tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n"
tmp = tmp.."\t??? Total Friends Online: "..frmHub:GetUsersCount().."\r\n"

user:SendData(sBotName,tmp)
end


but i think it can be more short/ less memory....
can anyone  help me make it better ????
thanks

uNiOn

hey m8 did try this script out but when i log on as an operator it shiws me how mutch im sharing,,,,
And when i logg on as an user it says my share is zero [0].... some help here plz

Cheers =)

uNiOn

and oe more thungy it comes as a pm when im op... but comes in the main chat when im an user only... =)

kepp

sBotName = "Bot_Name" 

frmHub:RegBot(sBotName) 

function GetOnline(pro)
local user,t = GetUsersByProfile(pro),0
	for index,val in user do
		if GetItemByName(user) then
		t = t + 1
		end
	end
	return t
end

function OpConnected(user) 
local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$") 
usershare = format("%0.2f", tonumber(share)/(1024*1024*1024)) 

local tmp 
tmp = "Welcome to "..frmHub:GetHubName().."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n" 
tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n" 
tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Hub Name: "..frmHub:GetHubName().."\r\n" 
tmp = tmp.."\t??? Hub Address: ....\r\n" 
tmp = tmp.."\t??? Hub Desc: "..frmHub:GetHubDescr().."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules. Please Read and Abide by them! \r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Masters Online: "..GetOnline("Master").."\r\n" 
tmp = tmp.."\t??? Operators Online: "..GetOnline("Operator").."\r\n" 
tmp = tmp.."\t??? VIPs Online: "..GetOnline("VIP").."\r\n" 
tmp = tmp.."\t??? REGs Online: "..GetOnline("Reg").."\r\n" 
tmp = tmp.."\ \r\n" 

user:SendPM(sBotName,tmp) 
end 


--function NewUserConnected(user) 
-- local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$") 
-- usershare = format("%0.2f", tonumber(share)/(1024*1024*1024)) 

function NewUserConnected(user) 
i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)$") 
-- this if routine is checking so if the share cannot be extracted , shre equals to zero. and 
-- prevents nil / 1024 * 1024 * 1024 (which are causing the error) 
if share == nil then 
share = 0 
end 
usershare = format("%0.2f", tonumber(share)/(1024*1024*1024)) 

local tmp 
tmp = "Welcome to "..frmHub:GetHubName().."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n" 
tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n" 
tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Hub Name: "..frmHub:GetHubName().."\r\n" 
tmp = tmp.."\t??? Hub Address: ....\r\n" 
tmp = tmp.."\t??? Hub Desc: "..frmHub:GetHubDescr().."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules. Please Read and Abide by them! \r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Users Online: "..frmHub:GetUsersCount().."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Masters Online: "..GetOnline("Master").."\r\n" 
tmp = tmp.."\t??? Operators Online: "..GetOnline("Operator").."\r\n" 
tmp = tmp.."\t??? VIPs Online: "..GetOnline("VIP").."\r\n" 
tmp = tmp.."\t??? REGs Online: "..GetOnline("Reg").."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? To see the NEWEST additions, type !tag \r\n" 
tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules. Read them!! \r\n" 
tmp = tmp.."\t??? Be sure to READ EVERYTHING in the Main chat window!! \r\n" 
tmp = tmp.."\t??? If you like this hub, don't forget to add it to your favorites by typing /fav in mainchat \r\n" 

user:SendPM(sBotName,tmp) 
end
Guarding    

uNiOn

It works perfect... but still got the little prob with it... it aint showing users share it still stands zero (0)....  

Cheers

uNiOn

It aint workin like it should.... still got problems with it.... when a normal user logs on it says that they share is 0.00 gb and it comes as pm for op's... can u fix that... thx...


Cheers

SMF spam blocked by CleanTalk