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

Welcome Message

Started by MX-10, 09 January, 2004, 15:46:38

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MX-10

I'm looking for a boot that puts welcome message like this

Welcome MX-10
Your ISP is:
Your Share is:
Min Share is:

Sorry For bad English.
From
MX-10
Iceland

Woody

Bot = "Welcome"
function Main()
frmHub:RegBot(Bot)
end

function NewUserConnected(curUser)
readfrom("Welcome.txt")
local message = ""
while 1 do
local line = read()
if (line == nil) then break else
message = message..line.."\r\n"
end
end
curUser:SendPM(Bot,message)
end

whether it works or not is a different questions, but thats what i had in the archives from previous go at hub :)

if anyone has a better script please post a reply :)

NightLitch

here try this one:

-- Quick Welcome Bot By: NightLitch 2004
-------------------------------------------------------------------
kb = 1024
mb = kb*kb
gb = kb*kb*kb
-------------------------------------------------------------------
ISP = {"[BBB]","[Sunet]"} 

BotName = "ZeusRage"
-------------------------------------------------------------------
MinShare = frmHub:GetMinShare()
function NewUserConnected(curUser)
	if checkISP(curUser) then
		GetISP = val
	else
		GetISP = "N/A"
	end
	s,e, vShare = strfind(curUser.sMyInfoString,"$+(%d+)$+|+")
	curUser:SendData(BotName,"Welcome "..curUser.sName) 	
	curUser:SendData(BotName,"Your ISP is: <"..GetISP..">") 	
	curUser:SendData(BotName,"Your Share is: <"..format("%0.2f", tonumber(vShare)/gb).."> Gb") 	
	curUser:SendData(BotName,"Min Share is: <"..MinShare.."> Gb") 	
end

function checkISP(curUser)
	for key,val in ISP do
		if strfind(strlower(curUser.sName), strlower(val),1,1) then
			return 1,val
		end
	end
end

and someone else Plop or anyone... how do I calulate the
HubSoft Share so it is right ???
//NL

Woody

Both of them do not seem to work for me??

any ideas or any other .lua??

NightLitch

#4
Well The One I created works Great...

------------------------------------------------------------------------
-- Quick Welcome Bot By: NightLitch 2004
-- Set The same value in MinShare as the
-- one you have in HubSoft...
-------------------------------------------------------------------
kb = 1024
mb = kb*kb
gb = kb*kb*kb
-------------------------------------------------------------------
ISP = {"[BBB]","[Sunet]","[Bostream]", "[Swe]"} 

BotName = "ZeusRage"

MinShare = 20
-------------------------------------------------------------------
function NewUserConnected(curUser)
	if checkISP(curUser) then
		GetISP = val
	else
		GetISP = "N/A"
	end
	s,e, vShare = strfind(curUser.sMyInfoString,"$+(%d+)$+|+")
	curUser:SendData(BotName,"Welcome "..curUser.sName) 	
	curUser:SendData(BotName,"Your ISP is: <"..GetISP..">") 	
	curUser:SendData(BotName,"Your Share is: <"..format("%0.2f", tonumber(vShare)/gb).."> Gb") 	
	curUser:SendData(BotName,"Min Share is: <"..MinShare.."> Gb") 	
end

function checkISP(curUser)
	for key,val in ISP do
		if strfind(strlower(curUser.sName), strlower(val),1,1) then
			return 1,val
		end
	end
end
------------------------------------------------------------------------

Here's a link for it if you don't managed to copy it right:

Download
//NL

MX-10

From
MX-10
Iceland

NightLitch

a little update with Woody's Script:

-- Quick Welcome Bot By: NightLitch 2004
-- Set The same value in MinShare as the
-- one you have in HubSoft...
-------------------------------------------------------------------
kb = 1024
mb = kb*kb
gb = kb*kb*kb
-------------------------------------------------------------------
ISP = {"[BBB]","[Sunet]","[Bostream]", "[Swe]"} -- Type in more ISP's

BotName = "ZeusRage" -- set Botname

MinShare = 20 -- set the min. Share to the one in HubSoft

SetWelcome = "on"  -- set on or off

WelcomeFile = "Welcome.txt" -- set the file
-------------------------------------------------------------------
function Main() 
	frmHub:RegBot(BotName) 
end 
-------------------------------------------------------------------
function NewUserConnected(curUser)
	if checkISP(curUser) then
		GetISP = val
	else
		GetISP = "N/A"
	end
	s,e, vShare = strfind(curUser.sMyInfoString,"$+(%d+)$+|+")
	curUser:SendData(BotName,"Welcome "..curUser.sName) 	
	curUser:SendData(BotName,"Your ISP is: <"..GetISP..">") 	
	curUser:SendData(BotName,"Your Share is: <"..format("%0.2f", tonumber(vShare)/gb).."> Gb") 	
	curUser:SendData(BotName,"Min Share is: <"..MinShare.."> Gb") 
	if SetWelcome == "on" then
		ReadFile(WelcomeFile)
		curUser:SendPM(BotName,message) 
	end
end
-------------------------------------------------------------------
function checkISP(curUser)
	for key,val in ISP do
		if strfind(strlower(curUser.sName), strlower(val),1,1) then
			return 1,val
		end
	end
end
-------------------------------------------------------------------
function ReadFile(file)
	readfrom(file) 
	local message = "" 
	while 1 do 
		local line = read() 
		if (line == nil) then 
			break 
		else 
			message = message..line.."\r\n" 
		end 
	end 
	return message
end 
-------------------------------------------------------------------
-- By NightLitch

Download
//NL

Woody

let me check i am getting this rite, i create a file called Welcome.txt that has my welcome message rite.....

i create that in the scripts folder???

if so i have done all that and still no welcome message apon arrival

NightLitch

try this one:

-- Quick Welcome Bot By: NightLitch 2004
-- Set The same value in MinShare as the
-- one you have in HubSoft...
-------------------------------------------------------------------
kb = 1024
mb = kb*kb
gb = kb*kb*kb
-------------------------------------------------------------------
ISP = {"[BBB]","[Sunet]","[Bostream]", "[Swe]"} -- Type in more ISP's

BotName = "ZeusRage" -- set Botname

MinShare = 20 -- set the min. Share to the one in HubSoft

SetWelcome = "on"  -- set on or off

WelcomeFile = "Welcome.txt" -- set the file
-------------------------------------------------------------------
function Main() 
	frmHub:RegBot(BotName) 
end 
-------------------------------------------------------------------
function NewUserConnected(curUser)
	if checkISP(curUser) then
		GetISP = val
	else
		GetISP = "N/A"
	end
	s,e, vShare = strfind(curUser.sMyInfoString,"$+(%d+)$+|+")
	curUser:SendData(BotName,"Welcome "..curUser.sName) 	
	curUser:SendData(BotName,"Your ISP is: <"..GetISP..">") 	
	curUser:SendData(BotName,"Your Share is: <"..format("%0.2f", tonumber(vShare)/gb).."> Gb") 	
	curUser:SendData(BotName,"Min Share is: <"..MinShare.."> Gb") 
	if SetWelcome == "on" then
		ReadFile(curUser,WelcomeFile)
	end
end
-------------------------------------------------------------------
function checkISP(curUser)
	for key,val in ISP do
		if strfind(strlower(curUser.sName), strlower(val),1,1) then
			return 1,val
		end
	end
end
-------------------------------------------------------------------
function ReadFile(curUser,file)
	readfrom(file) 
	while 1 do 
		line = read() 
		if line == nil then break end 
		curUser:SendPM(curUser,line) 
	end 
	readfrom() 
end 
-------------------------------------------------------------------
-- By NightLitch
//NL

Woody

Nope still not working!

where exactly to i say the txt file?????
and is it Welcome.txt or welcome.txt?????

plop

QuoteOriginally posted by NightLitch
kb = 1024
mb = kb*kb
gb = kb*kb*kb
format("%0.2f", tonumber(vShare)/gb)

and someone else Plop or anyone... how do I calulate the
HubSoft Share so it is right ???
thats 100% correct.
you could make it a tiny bit faster by:
gb = 1073741824
won't make a big difference do, but you can drop 2 globals (mb isn't used @ all so that can be removed anyway).

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

SMF spam blocked by CleanTalk