Very easy script, but still not working!
 

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

Very easy script, but still not working!

Started by Untouchable, 04 October, 2004, 06:49:04

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Untouchable

Ok, just started to use the NXS-3 script for my hub, but it has no hubowner\op\vip\reg join script, so i decided to make one myself.. works fine for hubowner\ops\vips, but not for regs?



function OpConnected(user)
	
if 
user.iProfile == 0 then
	
	
SendToAll(frmHub:GetHubName(), "-== Attention! The hubowner "..user.sName.."  has entered the hub. ==-")
	
elseif 
user.iProfile == 1 then
	
	
SendToAll(frmHub:GetHubName(), "Attention! Operator "..user.sName.." has just connected to this hub. ")
        elseif 
user.iProfile == 2 then
	
	
SendToAll(frmHub:GetHubName(), "The VIP "..user.sName.." has just connected to this hub")
         elseif 
user.iProfile == 3 then
            SendToAll
(frmHub:GetHubName(), "The registered user "..user.sName.." has just connected")
	
end
end



EDIT: Coulndt get the and ?> out of the post.. its not a part of the script  ;)

WickeD

Hi!
#1
I am new whit script?s, but try to write this line:
"-== Attention! The hubowner "..user.sName.."  has entered the hub. ==-")

like this:
"Attention! The hubowner "..user.sName.."  has entered the hub.")


Can?t say if it works, but try it.

If it not working so ask eny one ens my m8!

//WickeD

blackwings

#2
Here is a quickly made script =

-- ???????????????????????
-- ? Welcome-AI 1.0      ?
-- ? Made by: blackwings ?
-- ???????????????????????

Bot="?Welcome-AI?" 

hubowner = "blackwings"

function Main()
	frmHub:RegBot(Bot)
end

function NewUserConnected(User)
	if GetProfileName(User.iProfile) == "VIP" then
		SendToAll(Bot,"The VIP "..User.sName.." has just connected to this hub")
	elseif GetProfileName(User.iProfile) == "Reg" then
		SendToAll(Bot,"The registered user "..User.sName.." has just connected")
	end
end

function UserDisconnected(User)
	if GetProfileName(User.iProfile) == "VIP" then
		SendToAll(Bot,"The VIP "..User.sName.." has left the hub")
	end
end

function OpConnected(User)
	if GetProfileName(User.iProfile) == "Master" and User.sName == hubowner then
		SendToAll(Bot,"-== Attention! The hubowner "..User.sName.."  has entered the hub. ==-")	
	elseif GetProfileName(User.iProfile) == "Master" then
		SendToAll(Bot,"Attention! Master "..User.sName.." has just connected to this hub.")
	elseif GetProfileName(User.iProfile) == "Moderator" then
		SendToAll(Bot,"Attention! Moderator "..User.sName.." has just connected to this hub.")
	elseif GetProfileName(User.iProfile) == "Operator" then
		SendToAll(Bot,"Attention! Operator "..User.sName.." has just connected to this hub.")
	end
end

function OpDisconnected(User)
	if GetProfileName(User.iProfile) == "Master" and User.sName == hubowner then
		SendToAll(Bot,"The hubowner "..User.sName.."  has left the hub.")	
	elseif GetProfileName(User.iProfile) == "Master" then
		SendToAll(Bot,"Master "..User.sName.." has left the hub.")
	elseif GetProfileName(User.iProfile) == "Moderator" then
		SendToAll(Bot,"Moderator "..User.sName.." has left the this hub.")
	elseif GetProfileName(User.iProfile) == "Operator" then
		SendToAll(Bot,"Operator "..User.sName.." has left the hub.")
	end
end


blackwings

#3
or this one

I added so it was possible to have random welcome and "Good Bye" Messages

-- ?????????????????????????????????????????????????
-- ? Welcome-AI 2.0      			   ?
-- ? Made by blackwings  			   ?
-- ? Added: Random Welcome and Good Bye Messages   ?
-- ?????????????????????????????????????????????????

Bot="?Welcome-AI?" 

hubowner="blackwings"

--######## HERE STARTS THE CONFIGURATION ########--

--????????????????????????????????????????????
------------------------------------------
-- Random welcome message for the hubowner
------------------------------------------
HOWelcome = {
"has entered the hub. ==-", 
"second HubOwner welcome message", 
"third HubOwner welcome message",
}

--------------------------------------------------
-- Random message for when the hubowner disconnect
--------------------------------------------------
HOByeBye = {
"has left the hub", 
"second HubOwner Good Bye message", 
"third HubOwner Good Bye message", 
}
--????????????????????????????????????????????
                   --++++++++++
--????????????????????????????????????????????
--------------------------------------------------------------
-- Random welcome message for the Operators and the Moderators
--------------------------------------------------------------
OPWelcome = {
"has just connected to this hub", 
"second OP & Mod welcome message", 
"third OP & Mod welcome message",
}

----------------------------------------------------------------------
-- Random message for when the Operators and the Moderators disconnect
----------------------------------------------------------------------
OPByeBye = {
"has left the hub", 
"second OP & Mod Good Bye message", 
"third OP & Mod Good Bye message", 
}
--????????????????????????????????????????????
                   --++++++++++
--????????????????????????????????????????????
----------------------------------------
-- Random welcome message for the VIP's
----------------------------------------
VIPWelcome = {
"has just connected to this hub", 
"second VIP welcome message", 
"third VIP welcome message",
}

--------------------------------------------------
-- Random message for when the VIP's disconnect
--------------------------------------------------
VIPByeBye = {
"has left the hub", 
"second VIP Good Bye message", 
"third VIP Good Bye message", 
}
--????????????????????????????????????????????
                   --++++++++++
--????????????????????????????????????????????
--------------------------------------------------
-- Random welcome message for the registered users
--------------------------------------------------
REGWelcome = {
"has just connected", 
"second REG welcome message", 
"third REG welcome message",
}

--------------------------------------------------
-- Random message for when a registered user disconnect
--------------------------------------------------
REGByeBye = {
"has left the hub", 
"second REG Good Bye message", 
"third REG Good Bye message", 
}
--????????????????????????????????????????????

--######## HERE ENDS THE CONFIGURATION ########--

function Main()
	frmHub:RegBot(Bot)
end

function NewUserConnected(User)
	if GetProfileName(User.iProfile) == "VIP" then
		SendToAll(Bot,"The VIP "..User.sName.." "..VIPWelcome[random(1, getn(VIPWelcome))]..".")
	elseif GetProfileName(User.iProfile) == "Reg" then
		SendToAll(Bot,"The registered user "..User.sName.." "..REGWelcome[random(1, getn(REGWelcome))]..".")
	end
end

function UserDisconnected(User)
	if GetProfileName(User.iProfile) == "VIP" then
		SendToAll(Bot,"The VIP "..User.sName.." "..VIPByeBye[random(1, getn(VIPByeBye))]..".")
	elseif GetProfileName(User.iProfile) == "Reg" then
		SendToAll(Bot,"The registered "..User.sName.." "..REGByeBye[random(1, getn(REGByeBye))]..".")
	end
end

function OpConnected(User)
	if GetProfileName(User.iProfile) == "Master" and User.sName == hubowner then
		SendToAll(Bot,"The hubowner "..User.sName.." "..HOWelcome[random(1, getn(HOWelcome))]..".")	
	elseif GetProfileName(User.iProfile) == "Master" then
		SendToAll(Bot,"Master "..User.sName.." "..OPWelcome[random(1, getn(OPWelcome))]..".")
	elseif GetProfileName(User.iProfile) == "Moderator" then
		SendToAll(Bot,"Moderator "..User.sName.." "..OPWelcome[random(1, getn(OPWelcome))]..".")
	elseif GetProfileName(User.iProfile) == "Operator" then
		SendToAll(Bot,"Operator "..User.sName.." "..OPWelcome[random(1, getn(OPWelcome))]..".")
	end
end

function OpDisconnected(User)
	if GetProfileName(User.iProfile) == "Master" and User.sName == hubowner then
		SendToAll(Bot,"The hubowner "..User.sName.." "..HOByeBye[random(1, getn(HOByeBye))]..".")	
	elseif GetProfileName(User.iProfile) == "Master" then
		SendToAll(Bot,"Master "..User.sName.." "..OPByeBye[random(1, getn(OPByeBye))]..".")
	elseif GetProfileName(User.iProfile) == "Moderator" then
		SendToAll(Bot,"Moderator "..User.sName.." "..OPByeBye[random(1, getn(OPByeBye))]..".")
	elseif GetProfileName(User.iProfile) == "Operator" then
		SendToAll(Bot,"Operator "..User.sName.." "..OPByeBye[random(1, getn(OPByeBye))]..".")
	end
end


blackwings

#4
QuoteOriginally posted by Untouchable
Ok, just started to use the NXS-3 script for my hub, but it has no hubowner\op\vip\reg join script, so i decided to make one myself.. works fine for hubowner\ops\vips, but not for regs?
function OpConnected(user)
	if user.iProfile == 0 then
		SendToAll(frmHub:GetHubName(), "-== Attention! The hubowner "..user.sName.."  has entered the hub. ==-")
	elseif user.iProfile == 1 then
		SendToAll(frmHub:GetHubName(), "Attention! Operator "..user.sName.." has just connected to this hub. ")
        elseif user.iProfile == 2 then
		SendToAll(frmHub:GetHubName(), "The VIP "..user.sName.." has just connected to this hub")
         elseif user.iProfile == 3 then
            SendToAll(frmHub:GetHubName(), "The registered user "..user.sName.." has just connected")
	end
end

Made a Lite version of my two earlier post, which do the thing you tried to do.

-- ???????????????????????
-- ? Welcome-AI Lite     ?
-- ? Made by: blackwings ?
-- ???????????????????????

Bot="?Welcome-AI?" 

hubowner = "blackwings"

function Main()
	frmHub:RegBot(Bot)
end

function NewUserConnected(User)
	if GetProfileName(User.iProfile) == "VIP" then
		SendToAll(Bot,"The VIP "..User.sName.." has just connected to this hub")
	elseif GetProfileName(User.iProfile) == "Reg" then
		SendToAll(Bot,"The registered user "..User.sName.." has just connected")
	end
end

function OpConnected(User)
	if GetProfileName(User.iProfile) == "Master" and User.sName == hubowner then
		SendToAll(Bot,"-== Attention! The hubowner "..User.sName.."  has entered the hub. ==-")	
	elseif User.bOperator then
		SendToAll(Bot,"Attention! Operator "..User.sName.." has just connected to this hub.")
	end
end


bastya_elvtars

This seems 2 b the easiest way to do this (not tested!):

function OpConnected(user)

	if user.iProfile == 0 then

		SendToAll(frmHub:GetHubName(), "-== Attention! The hubowner "..user.sName.."  has entered the hub. ==-")

	elseif user.iProfile == 1 then

		SendToAll(frmHub:GetHubName(), "Attention! Operator "..user.sName.." has just connected to this hub. ")

        elseif user.iProfile == 2 then

		SendToAll(frmHub:GetHubName(), "The VIP "..user.sName.." has just connected to this hub")

         elseif user.iProfile == 3 then

            SendToAll(frmHub:GetHubName(), "The registered user "..user.sName.." has just connected")

	end

end

OpConnected=NewUserConnected
Everything could have been anything else and it would have just as much meaning.

SMF spam blocked by CleanTalk