Welcome 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

Welcome script?

Started by YouAlreadyKnow, 17 May, 2006, 01:24:50

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

YouAlreadyKnow

hi i was wondering could some one make me a welcome script

i did a search on this fourm but didnt find any thing

i need the script to say  ''Welcome username To My-Block Privit DVD-r Hub Enjoy Your Stay :)''  when they enter then i want it to show this

?????????? Welcome To My-Block Private DVD-r Hub ??????????
                
                 Your nick is: YouAlreadyKnow
                 Your profile is: Reg
                 Your current IP: **.***.***.**
                 Your client is: DC++
                 Your client version is: 0.674
                 Your current mode is: Active
                 Your total hubs are: 1
                 Your open slots are: 2
                 Your share size is: 222.85 GB
                 Your description is:
                 Your connection is: DSL
                 Your email is: *************

?????????? Welcome To My-Block Private DVD-r Hub ??????????

so if some one can pls make this script for me

thanks for all your help

YAK

6Marilyn6Manson6

#1
--// WelcomeMessage made by 6Marilyn6Manson6 17/05/2006
BotName = "[ITA]WelCoMe"			--frmHub:GetHubBotName(),
------------------------------------------------------
function Main()
	frmHub:RegBot(BotName)
end
--// DoShareUnits
DoShareUnits = function(intSize)
	if intSize ~= 0 then
		local tUnits = { "Bytes", "KiB", "MiB", "GiB", "TiB" }
		intSize = tonumber(intSize);
		local sUnits;
		for index = 1, table.getn(tUnits) do
			if(intSize < 1024) then sUnits = tUnits[index]; break; else intSize = intSize / 1024; end
		end
		return string.format("%0.3f %s",intSize, sUnits);
	else
		return "0 Bytes"
	end
end
------------------------------------------------------
function NewUserConnected(user)
local name,version = getHubVersion()
local timeanddate = os.date("%d-%m-%Y  %H:%M:%S")
local tmp = os.clock() 
local weeks, days, hours, minutes, seconds = math.floor(tmp/604800), math.floor(math.mod(tmp/86400, 7)), math.floor(math.mod(tmp/3600, 24)), math.floor(math.mod(tmp/60, 60)), math.floor(math.mod(tmp/1, 60))
	if frmHub:GetHubTopic() == nil then
		HubTopic = "No Topic Set"
	else
		HubTopic = frmHub:GetHubTopic()
	end
	if user.sMyInfoString then
		local disp = ""
		doGetProfile =  GetProfileName(user.iProfile)
	end
	border1 = "  <=================Welcome To My-Block Private DVD-r Hub: "..user.sName.."========================>"
	disp = "\r\n\r\n"..border1.."\r\n"
	disp = disp.."	?Hub Version:\t\t\t"..name.." "..version.."\r\n"
	disp = disp.."	?Hub Address:			"..frmHub:GetHubAddress()..":"..frmHub:GetHubPort().."\r\n" 
	disp = disp.."	?Hub Name:			"..(frmHub:GetHubName() or "N/A").."\r\n" 
	disp = disp.."	?Hub Description:			"..(frmHub:GetHubDescr() or "N/A").."\r\n"
	disp = disp.."	?Hub Topic:			"..HubTopic.."\r\n"
	disp = disp.."	?Local date and time:		"..timeanddate.."\r\n"
	disp = disp.."\r\n"
	disp = disp.."	?Your Profile:			"..doGetProfile.."\r\n"
	disp = disp.."	?Your Nick:			"..user.sName.."\r\n"
	disp = disp.."	?Your Current IP:			"..(user.sIP or "N/A").."\r\n"
	disp = disp.."	?Your Client Is:			"..(user.sClient or "N/A").."\r\n"
	disp = disp.."	?Your Client Version Is:		"..(user.sClientVersion or "N/A").."\r\n"
	disp = disp.."	?Your Current Mode Is:		"..user.sMode.."\r\n"
	disp = disp.."	?Your Normal Hubs Are:		"..(user.iNormalHubs or "N/A").."\r\n"
	disp = disp.."	?Your ReG-ViP Hubs Are:		"..(user.iRegHubs or "N/A").."\r\n"
	disp = disp.."	?Your OPerator Hubs Are:		"..(user.iOpHubs or "N/A").."\r\n"
	disp = disp.."	?Your Total Hubs Are:		"..(user.iHubs or "N/A").."\r\n"
	disp = disp.."	?Your Open Slots Are:		"..(user.iSlots or "N/A").."\r\n"
	disp = disp.."	?Your Share Size Is:		"..DoShareUnits(user.iShareSize).."\r\n"
	disp = disp.."	?Your Description Is:		"..(user.sDescription or "N/A").."\r\n"
	disp = disp.."	?Your eMail Is:			"..(user.sEmail or "N/A").."\r\n"
	disp = disp.."	?Your Connection Is:		"..(user.sConnection or "N/A").."\r\n"
	disp = disp.."	?There Are Now "..frmHub:GetUsersCount().." of the "..frmHub:GetMaxUsers().." users online after "..weeks.." week(s) "..days.." day(s) "..hours.." hour(s) "..minutes.." minutes and "..seconds.." seconds\r\n\r\n"
	user:SendData(BotName, disp)
	disp = nil
end
------------------------------------------------------
OpConnected=NewUserConnected
--// 6Marilyn6Manson6

YouAlreadyKnow

thank you verry much it was exactly what i needed and u added a few thing (that i like)

thanks for your help

YAK

6Marilyn6Manson6

Quote from: YouAlreadyKnow on 17 May, 2006, 12:04:02
thank you verry much it was exactly what i needed and u added a few thing (that i like)

thanks for your help

YAK

Welcome ;)

jiten

Please note that some user.* return nil or "".

Just as an example and to avoid possible syntax errors, you could use something like this:

(frmHub:GetHubName() or "n/a")


You could also have a look at InfoBot by Mutor and Psycho for more details.

6Marilyn6Manson6


YouAlreadyKnow

i keep geting this

[15:33] Syntax ...block.no-ip.info)\scripts\WelcomeMessage-LUA_5.1.LUA:53: attempt to concatenate field `sEmail' (a nil value)


but i now see you updated the script mabee it will fix it

ill holla back if it does

agian thanks

YAK

Psycho_Chihuahua

#7
Here another way to fix it ;)

--// WelcomeMessage made by 6Marilyn6Manson6 17/05/2006
BotName = "[ITA]WelCoMe"			--frmHub:GetHubBotName(),
------------------------------------------------------
function Main()
	frmHub:RegBot(BotName)
end
--// DoShareUnits
DoShareUnits = function(intSize)
	if intSize ~= 0 then
		local tUnits = { "Bytes", "KiB", "MiB", "GiB", "TiB" }
		intSize = tonumber(intSize);
		local sUnits;
		for index = 1, table.getn(tUnits) do
			if(intSize < 1024) then sUnits = tUnits[index]; break; else intSize = intSize / 1024; end
		end
		return string.format("%0.3f %s",intSize, sUnits);
	else
		return "0 Bytes"
	end
end
------------------------------------------------------
function GetEnable(enable)
	if enable == nil or enable == "" then
		enable = "N/A"
	end
	return enable
end

function NewUserConnected(user)
local name,version = getHubVersion()
local timeanddate = os.date("%d-%m-%Y  %H:%M:%S")
local tmp = os.clock() 
local weeks, days, hours, minutes, seconds = math.floor(tmp/604800), math.floor(math.mod(tmp/86400, 7)), math.floor(math.mod(tmp/3600, 24)), math.floor(math.mod(tmp/60, 60)), math.floor(math.mod(tmp/1, 60))
	if frmHub:GetHubTopic() == nil then
		HubTopic = "No Topic Set"
	else
		HubTopic = frmHub:GetHubTopic()
	end
	if user.sMyInfoString then
		local disp = ""
		doGetProfile =  GetProfileName(user.iProfile)
	end
	border1 = "  <=================Welcome To My-Block Private DVD-r Hub: "..user.sName.."========================>"
	disp = "\r\n\r\n"..border1.."\r\n"
	disp = disp.."	?Hub Version:\t\t\t"..name.." "..version.."\r\n"
	disp = disp.."	?Hub Address:			"..frmHub:GetHubAddress()..":"..frmHub:GetHubPort().."\r\n" 
	disp = disp.."	?Hub Name:			"..GetEnable(frmHub:GetHubName()).."\r\n" 
	disp = disp.."	?Hub Description:			"..GetEnable(frmHub:GetHubDescr()).."\r\n"
	disp = disp.."	?Hub Topic:			"..HubTopic.."\r\n"
	disp = disp.."	?Local date and time:		"..timeanddate.."\r\n"
	disp = disp.."\r\n"
	disp = disp.."	?Your Nick:			"..user.sName.."\r\n"
	disp = disp.."	?Your Profile:			"..doGetProfile.."\r\n"
	disp = disp.."	?Your Current IP:			"..GetEnable(user.sIP).."\r\n"
	disp = disp.."	?Your Client Is:			"..GetEnable(user.sClient).."\r\n"
	disp = disp.."	?Your Client Version Is:		"..GetEnable(user.sClientVersion).."\r\n"
	disp = disp.."	?Your Current Mode Is:		"..user.sMode.."\r\n"
	disp = disp.."	?Your Normal Hubs Are:		"..GetEnable(user.iNormalHubs).."\r\n"
	disp = disp.."	?Your ReG-ViP Hubs Are:		"..GetEnable(user.iRegHubs).."\r\n"
	disp = disp.."	?Your OPerator Hubs Are:		"..GetEnable(user.iOpHubs).."\r\n"		
	disp = disp.."	?Your Total Hubs Are:		"..GetEnable(user.iHubs).."\r\n"
	disp = disp.."	?Your Open Slots Are:		"..GetEnable(user.iSlots).."\r\n"
	disp = disp.."	?Your Share Size Is:		"..DoShareUnits(user.iShareSize).."\r\n"
	disp = disp.."	?Your Description Is:		"..GetEnable(user.sDescription).."\r\n"
	disp = disp.."	?Your Connection Is:		"..GetEnable(user.sConnection).."\r\n"
	disp = disp.."	?Your eMail Is:			"..GetEnable(user.sEmail).."\r\n"
	disp = disp.."	?There Are Now "..GetEnable(frmHub:GetUsersCount()).." of the "..GetEnable(frmHub:GetMaxUsers()).." users online after "..weeks.." week(s) "..days.." day(s) "..hours.." hour(s) "..minutes.." minutes and "..seconds.." seconds\r\n\r\n"
	user:SendData(BotName, disp)
	disp = nil
end
------------------------------------------------------
OpConnected=NewUserConnected
--// 6Marilyn6Manson6
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

6Marilyn6Manson6


6Marilyn6Manson6

Quote from: Psycho_Chihuahua on 20 May, 2006, 22:01:30
Here another way to fix it ;)


Psycho_Chihuahua your post not is correct because:

disp = disp.."	?Your Description Is:		"..user.sDescription.."\r\n"
	disp = disp.."	?Your Connection Is:		"..user.sConnection.."\r\n"


this 2 line (in your post) can give same error of:
[15:33] Syntax ...block.no-ip.info)\scripts\WelcomeMessage-LUA_5.1.LUA:53: attempt to concatenate field `sEmail' (a nil value)
;). See my post :D

Psycho_Chihuahua

i noticed and fixed my post already ;)
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

6Marilyn6Manson6


6Marilyn6Manson6

#12
Exist this:

if frmHub:GetHubTopic() == nil then
		HubTopic = "No Topic Set"
	else
		HubTopic = frmHub:GetHubTopic()
	end


but you recall GetEnable function in this line:

disp = disp.."	?Hub Topic:			"..GetEnable(HubTopic).."\r\n"


I don't understand because you recall function :S

Psycho_Chihuahua

#13
oops  ::) - fixed now hehe

i was busy playing around with InfoBot at the same time.

--[[
	InfoBot 1.50 LUA5/5.1
	By Mutor        02/25/06
	Show hub/user info to new connections, (pulled from another script)
	Extended by Psycho_Chihuahua
	Version 1.1
	added - Shows PtokaX Hubversion and Substring
	Version 1.2
	added - show Script Informations or not (only active scripts are shown)
	Version 1.21
	added - show Windows Version (bluebears PtxUtilities required)
	Version 1.3
	added - Show PtokaX Location
	added - Switch to turn Script Info's on or off
	Version 1.40
	Code shortened by Mutor
	added - Toggle cmd to turn ShowScripts on/off (thnx Mutor - but i had to bugfix it ;) )
	added - RC Menu by Profile to toggle ShowScripts
	Version 1.50
	Added Hubport to Hubaddress
	Added AutoReg Status
	Added Lua 5/5.1 Support
]]--
-- Start Settings
PtxVers = "aa1 Lua 5.1"		-- PtokaX Version Substring
ShowScripts = "off"			-- Show script Informations?  1=true/0=false
ToggleScripts = "!showscripts"	-- Toggle ShowScripts on/off command
HubOwner = "Psycho_Chihuahua"
Greeting = "It's nice of you to stop by..."

-- RC Access to Toggle Cmd (1=allowed/0=deny)
RcAdmin = {
	[0] = 1,    -- =[Master]=
	[1] = 1,    -- =[OP]=
	[2] = 0,    -- =[ViP]=
	[3] = 0,    -- =[Reg]=
	[4] = 0,    -- =[Custom Profile 1]=
	[5] = 0,    -- =[Custom Profile 2]=
   [-1] = 0,   	-- =[UnReg]=
}

-- End Settings
-- DO NOT EDIT ANYTHING BELOW UNLESS YOU KNOW WHAT YOU ARE DOING!! -- I should know - borked it myself ;)

Main = function()
	if _VERSION == "Lua 5.1" then
		libinit = package.loadlib("PxUtilities_l51.dll", "_libinit")
	else
		libinit = loadlib("PxUtilities.dll", "_libinit")
	libinit()
	end
end


function ChatArrival(user, data)
	local s,e,cmd = string.find(data,"^%b<>%s(%p%w+)|")
	if cmd and cmd == ToggleScripts then
			if ShowScripts == "on" then
				ShowScripts = "off"
			else
				ShowScripts = "on"
			end
			user:SendData(frmHub:GetHubBotName(),"ShowScripts is now "..ShowScripts)
			return 1
		end
	end


NewUserConnected = function(user)
    		if RcAdmin[user.iProfile] == 1 then 
				user:SendData("$UserCommand 1 3 "..frmHub:GetHubBotName().."\\InfoBot\\Toggle Showscripts$<%[mynick]> "..ToggleScripts.."&#124;");
			end
				DoInfo(user)
end

OpConnected = NewUserConnected

function GetEnable(enable)
	if enable == nil or enable == "" then
		enable = "not set"
	end
	return enable
end

function AutoRegStatus(enable)
	if enable == nil or enable == "" then
		enable = "not active"
	else enable = "active"
	end
	return enable
end

function minutestoh(minutes) -- gets minutes as arguments, returns a string with formatted time and 4 numbers as units
    if frac(minutes) > 0.5 then minutes=math.ceil(minutes) else minutes=math.floor(minutes) end
      local weeks,days,hours,mins
      local msg=""
        local a1,a2,a3=math.mod(minutes,10080),math.mod(minutes,1440),math.mod(minutes,60)
        if a1==minutes then weeks=0 else weeks=math.floor(minutes/10080) end
        if a2==minutes then days=0 else days=math.floor(a1/1440) end
        if a3==minutes then hours=0 else hours=math.floor(a2/60) end
        mins=math.mod(minutes,60)
        local tmp=
            {
              [" weeks "]=weeks,
              [" days "]=days,
              [" hours "]=hours,
              [" minutes"]=mins
            }
            local tmp2={" weeks "," days "," hours "," minutes"}
        for a,b in ipairs(tmp2) do
          if tmp[b] > 0 then
            msg=msg..tmp[b]..b
          end
        end
        if msg=="" then msg="0" end
        return msg,weeks,days,hours,mins
      end

function frac(num) -- returns fraction of a number (RabidWombat)
  return num - math.floor(num);
end

GetScript = function()
	local tab = {}
	local str = ""
	local x = ""
	for line in io.lines(frmHub:GetPtokaXLocation().."cfg/Scripts.xml") do
	        local s,e,script = string.find(line,"<Name>([%w%s%p]+)</Name>")
	        local s,e,enable = string.find(line,"<Enabled>(%d+)</Enabled>")
	        if script then
	                x = script
		elseif enable then
		        tab[x] = tonumber(enable)
		        x = ""
		end
	end
	for i,v in pairs(tab) do
		if v == 1 then
		        local s,e,version = string.find(i,"%v([%a%d%p]+)%.lua")
		        if not version then version = "-" end
		        str = str.."\tScript Name: "..string.format("%-25.15s",string.gsub(i,"%s.*","")).."\tVer: "..version.."\r\n"
		end
	end
	return str
end

function DoInfo(user)
	local Scripts = ""
	name, ver = getHubVersion()
	SerVer = PXU.GetWindowsVersion()
	local _,W,D,H,M=minutestoh(frmHub:GetUpTime() / 60)
	local Prof
	local Topic
	Prof= GetProfileName(user.iProfile) or "Unregistered User"
	Topic = frmHub:GetHubTopic() or "There is no current topic."
	local art = string.rep("?",40).."\r\n"
	local ul = string.rep("?",14).."\r\n"
	if ShowScripts == "on" then
		Scripts = "\t"..art.."\tScript Information:\r\n\t"..ul..GetScript()
	end
	local tmp = "\r\n\r\n\t"..art.."\tHub Information:\r\n\t"..ul..
	"\tWelcome:\t"..user.sName..", "..Greeting.."\r\n"..
	"\tHub Name: \t"..GetEnable(frmHub:GetHubName())..",  "..Topic.."\r\n"..
	"\tHub Version: \t"..name.." "..ver.." "..PtxVers.."\r\n"..
	"\tServer Version: \t"..SerVer.."\r\n"..
	"\tHub description:\t"..GetEnable(frmHub:GetHubDescr()).."\r\n"..
	"\tHub Address:\t"..frmHub:GetHubAddress()..":"..frmHub:GetHubPort().."\r\n"..
	"\tHub IP:\t\t"..frmHub:GetHubIp().."\r\n"..
	"\tHubOwner:\t"..HubOwner.."\r\n"..
	"\tAutoregister:\t"..AutoRegStatus(frmHub:GetAutoRegister()).."\r\n"..
	"\tUptime:\t\t"..minutestoh(frmHub:GetUpTime() / 60).."\r\n"..
	"\tPeak Users:\t"..GetEnable(frmHub:GetMaxUsersPeak()).."\r\n"..
	"\tHub Share:\t"..string.format("%.2f Tb.",frmHub:GetCurrentShareAmount()/(1024 * 1024 * 1024 * 1024)).."\r\n"..
	"\tThere Are Now:\t"..GetEnable(frmHub:GetUsersCount()).." of "..GetEnable(frmHub:GetMaxUsers()).." max users online.\r\n\r\n"..
	"\t"..art.."\tYour Information:\r\n\t"..ul..
	"\tUsername:\t"..user.sName.."\r\n"..
	"\tUser Profile:\t"..Prof.."\r\n"..
	"\tIP Address:\t"..GetEnable(user.sIP).."\r\n"..
	"\tShare Size:\t"..string.format("%.2f Gb.",user.iShareSize/(1024 * 1024 * 1024)).."\r\n"..
	"\tDC Tag:\t\t"..GetEnable(user.sTag).."\r\n"..
	"\tDescription:\t"..GetEnable(user.sDescription).."\r\n"..
	"\tEmail:\t\t"..GetEnable(user.sEmail).."\r\n"..
	"\tConnection:\t"..GetEnable(user.sConnection).."\r\n\r\n"..
	Scripts..
	"\r\n\t"..art..
	"\t? [ This information is only being shown to you ] ?\r\n\r\n\t"..art
	user:SendData(tmp)
end
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

6Marilyn6Manson6


YouAlreadyKnow

Quote from: Psycho_Chihuahua on 20 May, 2006, 22:01:30
Here another way to fix it ;)

--// WelcomeMessage made by 6Marilyn6Manson6 17/05/2006
BotName = "[ITA]WelCoMe"			--frmHub:GetHubBotName(),
------------------------------------------------------
function Main()
	frmHub:RegBot(BotName)
end
--// DoShareUnits
DoShareUnits = function(intSize)
	if intSize ~= 0 then
		local tUnits = { "Bytes", "KiB", "MiB", "GiB", "TiB" }
		intSize = tonumber(intSize);
		local sUnits;
		for index = 1, table.getn(tUnits) do
			if(intSize < 1024) then sUnits = tUnits[index]; break; else intSize = intSize / 1024; end
		end
		return string.format("%0.3f %s",intSize, sUnits);
	else
		return "0 Bytes"
	end
end
------------------------------------------------------
function GetEnable(enable)
	if enable == nil or enable == "" then
		enable = "N/A"
	end
	return enable
end

function NewUserConnected(user)
local name,version = getHubVersion()
local timeanddate = os.date("%d-%m-%Y  %H:%M:%S")
local tmp = os.clock() 
local weeks, days, hours, minutes, seconds = math.floor(tmp/604800), math.floor(math.mod(tmp/86400, 7)), math.floor(math.mod(tmp/3600, 24)), math.floor(math.mod(tmp/60, 60)), math.floor(math.mod(tmp/1, 60))
	if frmHub:GetHubTopic() == nil then
		HubTopic = "No Topic Set"
	else
		HubTopic = frmHub:GetHubTopic()
	end
	if user.sMyInfoString then
		local disp = ""
		doGetProfile =  GetProfileName(user.iProfile)
	end
	border1 = "  <=================Welcome To My-Block Private DVD-r Hub: "..user.sName.."========================>"
	disp = "\r\n\r\n"..border1.."\r\n"
	disp = disp.."	?Hub Version:\t\t\t"..name.." "..version.."\r\n"
	disp = disp.."	?Hub Address:			"..frmHub:GetHubAddress()..":"..frmHub:GetHubPort().."\r\n" 
	disp = disp.."	?Hub Name:			"..GetEnable(frmHub:GetHubName()).."\r\n" 
	disp = disp.."	?Hub Description:			"..GetEnable(frmHub:GetHubDescr()).."\r\n"
	disp = disp.."	?Hub Topic:			"..HubTopic.."\r\n"
	disp = disp.."	?Local date and time:		"..timeanddate.."\r\n"
	disp = disp.."\r\n"
	disp = disp.."	?Your Nick:			"..user.sName.."\r\n"
	disp = disp.."	?Your Profile:			"..doGetProfile.."\r\n"
	disp = disp.."	?Your Current IP:			"..GetEnable(user.sIP).."\r\n"
	disp = disp.."	?Your Client Is:			"..GetEnable(user.sClient).."\r\n"
	disp = disp.."	?Your Client Version Is:		"..GetEnable(user.sClientVersion).."\r\n"
	disp = disp.."	?Your Current Mode Is:		"..user.sMode.."\r\n"
	disp = disp.."	?Your Normal Hubs Are:		"..GetEnable(user.iNormalHubs).."\r\n"
	disp = disp.."	?Your ReG-ViP Hubs Are:		"..GetEnable(user.iRegHubs).."\r\n"
	disp = disp.."	?Your OPerator Hubs Are:		"..GetEnable(user.iOpHubs).."\r\n"		
	disp = disp.."	?Your Total Hubs Are:		"..GetEnable(user.iHubs).."\r\n"
	disp = disp.."	?Your Open Slots Are:		"..GetEnable(user.iSlots).."\r\n"
	disp = disp.."	?Your Share Size Is:		"..DoShareUnits(user.iShareSize).."\r\n"
	disp = disp.."	?Your Description Is:		"..GetEnable(user.sDescription).."\r\n"
	disp = disp.."	?Your Connection Is:		"..GetEnable(user.sConnection).."\r\n"
	disp = disp.."	?Your eMail Is:			"..GetEnable(user.sEmail).."\r\n"
	disp = disp.."	?There Are Now "..GetEnable(frmHub:GetUsersCount()).." of the "..GetEnable(frmHub:GetMaxUsers()).." users online after "..weeks.." week(s) "..days.." day(s) "..hours.." hour(s) "..minutes.." minutes and "..seconds.." seconds\r\n\r\n"
	user:SendData(BotName, disp)
	disp = nil
end
------------------------------------------------------
OpConnected=NewUserConnected
--// 6Marilyn6Manson6

thanks alot using this update now..so fare so good

thanks for all ur help

YAK

6Marilyn6Manson6

Quote from: Mutor on 21 May, 2006, 05:12:04
DoShareUnits is incomplete, you may want to work on that.

Im sorry Mutor but.. DoShareUnits function is complete and work very nice :D

Markitos

Quote from: Mutor on 21 May, 2006, 05:12:04
DoShareUnits is incomplete, you may want to work on that.
From Scripting:Utilities:Center   ;D
function GetByteUnit(intSize)
local tUnits = { "Bytes", "KB", "MB", "GB", "TB" }
intSize = tonumber(intSize);
local sUnits;
for index = 1, getn(tUnits) do
if(intSize < 1024) then
sUnits = tUnits[index];
break;
else
intSize = intSize / 1024;
end
end
return format("%0.2f %s",intSize, sUnits);
end

6Marilyn6Manson6

#18
Quote from: Markitos on 21 May, 2006, 13:02:55
Quote from: Mutor on 21 May, 2006, 05:12:04
DoShareUnits is incomplete, you may want to work on that.
From Scripting:Utilities:Center? ?;D
function GetByteUnit(intSize)
local tUnits = { "Bytes", "KB", "MB", "GB", "TB" }
intSize = tonumber(intSize);
local sUnits;
for index = 1, getn(tUnits) do
if(intSize < 1024) then
sUnits = tUnits[index];
break;
else
intSize = intSize / 1024;
end
end
return format("%0.2f %s",intSize, sUnits);
end


I think Markitos's function is incomplete...because if user have 0 in shared...this function give error. And for close this thread... in other script I see my same function made of jiten ;)

Here for example:

--$Rev Blocker by jiten
--restriction for those who have less than MinSlots and MinShare
--some ideas taken from leech bot and ShaveShare v4.8 by Herodes

kb = 1024  
mb = 1024 ^ 2 
gb = 1024 ^ 3 

MinShare = 500*mb -- in MBs
MinSlots = 3

function DoShareUnits(intSize)				--- Thanks to kepp and NotRambitWombat 
	if intSize ~= 0 then 
		local tUnits = { "Bytes", "KB", "MB", "GB", "TB" } 
		intSize = tonumber(intSize); 
		local sUnits; 
		for index = 1, table.getn(tUnits) do 
			if(intSize < 1024) then 
				sUnits = tUnits[index]; 
				break; 
			else  
				intSize = intSize / 1024; 
			end 
		end 
		return string.format("%0.1f %s",intSize, sUnits); 
	else 
		return "nothing" 
	end 
end 

function ConnectToMeArrival(curUser,data)
	if curUser.iShareSize < MinShare or curUser.iSlots < MinSlots then
		curUser:SendData("*** You have to share at least "..DoShareUnits(MinShare).." and/or have "..MinSlots.." slots open to be able do download.")
		return 1
	end
end

RevConnectToMeArrival = ConnectToMeArrival


and jiten is a super lua scripter :D

6Marilyn6Manson6

Yes, 2 decimal is ok, all script use 1 or max 2 decimal, but I love 3 decimal :P

Dino

Quote from: 6Marilyn6Manson6 on 17 May, 2006, 13:38:54
Quote from: YouAlreadyKnow on 17 May, 2006, 12:04:02
thank you verry much it was exactly what i needed and u added a few thing (that i like)

Here is the Script in portugese
By me Gasolina dc++
mozhub.no-ip.info:411










--// WelcomeMessage made by 6Marilyn6Manson6 17/05/2006
BotName = "Vibe-Bot" --frmHub:GetHubBotName(),
------------------------------------------------------
function Main()
frmHub:RegBot(BotName)
end
--// DoShareUnits
DoShareUnits = function(intSize)
if intSize ~= 0 then
local tUnits = { "Bytes", "KiB", "MiB", "GiB", "TiB" }
intSize = tonumber(intSize);
local sUnits;
for index = 1, table.getn(tUnits) do
if(intSize < 1024) then sUnits = tUnits[index]; break; else intSize = intSize / 1024; end
end
return string.format("%0.3f %s",intSize, sUnits);
else
return "0 Bytes"
end
end
------------------------------------------------------
function NewUserConnected(user)
local name,version = getHubVersion()
local timeanddate = os.date("%d-%m-%Y  %H:%M:%S")
local tmp = os.clock()
local weeks, days, hours, minutes, seconds = math.floor(tmp/604800), math.floor(math.mod(tmp/86400, 7)), math.floor(math.mod(tmp/3600, 24)), math.floor(math.mod(tmp/60, 60)), math.floor(math.mod(tmp/1, 60))
if frmHub:GetHubTopic() == nil then
HubTopic = "No Topic Set"
else
HubTopic = frmHub:GetHubTopic()
end
if user.sMyInfoString then
local disp = ""
doGetProfile =  GetProfileName(user.iProfile)
end
border1 = "  <=================Seja Bem Vindo ao MoZ-Vibe?: "..user.sName.."========================>"
disp = "\r\n\r\n"..border1.."\r\n"
disp = disp.." ? Soft ware do hubn:\t\t\t"..name.." "..version.."\r\n"
disp = disp.." ? Endere?o do hub: "..frmHub:GetHubAddress()..":"..frmHub:GetHubPort().."\r\n"
disp = disp.." ? Nome do Hub: "..(frmHub:GetHubName() or "N/A").."\r\n"
disp = disp.." ? Descri??o do Hub: "..(frmHub:GetHubDescr() or "N/A").."\r\n"
disp = disp.." ? Topico do hub: "..HubTopic.."\r\n"
disp = disp.." ? Hora e data: "..timeanddate.."\r\n"
disp = disp.."\r\n"
disp = disp.." ? Seu perfil: "..doGetProfile.."\r\n"
disp = disp.." ? Seu Nick: "..user.sName.."\r\n"
disp = disp.." ? O seu  IP: "..(user.sIP or "N/A").."\r\n"
disp = disp.." ? Seu cliente: "..(user.sClient or "N/A").."\r\n"
disp = disp.." ? A vers?o do seu cliente ?: "..(user.sClientVersion or "N/A").."\r\n"
disp = disp.." ? O seu modo ?: "..user.sMode.."\r\n"
disp = disp.." ? Hubs registado como user normal: "..(user.iNormalHubs or "N/A").."\r\n"
disp = disp.." ? Hubs registado como  Reg-Vip : "..(user.iRegHubs or "N/A").."\r\n"
disp = disp.." ? Hubs como Operador: "..(user.iOpHubs or "N/A").."\r\n"
disp = disp.." ? Hubs hubs em que se encontra: "..(user.iHubs or "N/A").."\r\n"
disp = disp.." ? Slot abertos: "..(user.iSlots or "N/A").."\r\n"
disp = disp.." ? O seu share ? de: "..DoShareUnits(user.iShareSize).."\r\n"
disp = disp.." ? A sua descri??o: "..(user.sDescription or "N/A").."\r\n"
disp = disp.." ? O seu e mail ?: "..(user.sEmail or "N/A").."\r\n"
disp = disp.." ? A sua connec??o ?: "..(user.sConnection or "N/A").."\r\n"
disp = disp.." ? Agora est?o "..frmHub:GetUsersCount().." dos Maximos users "..frmHub:GetMaxUsers().." Apos de "..weeks.." semana(s) "..days.." dias(s) "..hours.." houra(s) "..minutes.." minutos e "..seconds.." segundos\r\n\r\n"
user:SendData(BotName, disp)
disp = nil
end
------------------------------------------------------
OpConnected=NewUserConnected
--// 6Marilyn6Manson6

6Marilyn6Manson6

I Love Multilanguage :D

Helios

Syntax F:\recupero\Ptokax\Ptokax\scripts\welcome.lua:53: attempt to concatenate global 'doGetProfile' (a nil value)
lol any1 fix it

Helios

#23
this error is generated by infobot

Syntax F:\recupero\Ptokax\Ptokax\scripts\infobot.lua:187: 'end' expected (to close 'function' at line 147) near '<eof>'

Syntax F:\recupero\Ptokax\Ptokax\scripts\infobot.lua:150: attempt to index global 'PXU' (a nil value)

i use ptokax 3.0.4.0k with lua 5.1

6Marilyn6Manson6

Quote
This stems from bad technique in creating the variable.
Quote

Mmm not is bad technique but only small distraction :D

SMF spam blocked by CleanTalk