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 ArtificialInsanety, 14 January, 2008, 10:06:36

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ArtificialInsanety

Hey guys, can someone please make a little script that welcomes registered users only(ex: profiles:registered,vip,op,master) in the kickbar and the message is seen by all users when a registered user enters hub.

thanks
/AI

Mr.T

#1
Here is a script lua 5.1

--[[
Statbar Messages 1.0
Nillan 2007-03-06
Thnx CrazyGuy fo helping me as always :)
This will send login and kick/ban messages to the statbar for everyone to see
--]]

sBotName = ""

function Main()
sBotName = frmHub:GetHubBotName()
end


NewUserConnected = function(User)
	if User.iProfile == -1 then
		local sWelcome = "Welcome "..User.sName.." , nice to have you here 				is kicking because:"
		SendToAll(sBotName ,sWelcome)
	else
		local sOPWelcome = "Welcome "..GetProfileName(User.iProfile).."  "..User.sName.."  nice to have you back 				is kicking because:"
		SendToAll(sBotName ,sOPWelcome)
	end
	return 1
end
 
OpConnected = NewUserConnected

function ChatArrival(User, Data)
	if User.iProfile >= 0 then
		local _,_,sCmd,sWhat = string.find(Data, "%b<>%s%p(%S+)%s(.*)|")
		if (sCmd == "drop") then
			local _,_,sWho,sWhy = string.find(sWhat, "(%S+)%s(.*)")
			if sWhy == nil then
				sWho = sWhat
				sWhy = "No reason given"
			end
			local sKickMessage = "User "..sWho.." was removed by: "..User.sName.."  because: "..sWhy.." 				is kicking because:"
			SendToAll(sBotName ,sKickMessage)
		elseif sCmd and string.find(sCmd, "ban") then
			local _,_,sWho,sWhy = string.find(sWhat, "(%S+)%s(.*)")
			if sWhy == nil then
				sWho = sWhat
				sWhy = "No reason given"
			end
			local sKickMessage = "User "..sWho.."  was kicked and banned by: "..User.sName.."  because: "..sWhy.." 				is kicking because:"
			SendToAll(sBotName ,sKickMessage)
		end
	end
end 


function ToArrival(User, Data)
	if User.iProfile >= 0 then
		local _,_,sTo,sPM = string.find(Data, "To%:%s(%S+)%sFrom%:%s%S+%s%$%b<>%s(.*)|")
		if sTo == sBotName then
		-- command is sent to Bot
			local _,_,sCmd,sWhat = string.find(sPM, "%p(%S+)%s(.*)")
			if (sCmd == "drop") then
				local _,_,sWho,sWhy = string.find(sWhat, "(%S+)%s(.*)")
				if sWhy == nil then
					sWho = sWhat
					sWhy = "No reason given"
				end
				local sKickMessage = "User "..sWho.."  was kicked by: "..User.sName.."  because: "..sWhy.." 				is kicking because:"
				SendToAll(sBotName ,sKickMessage)
			elseif string.find(sCmd, "ban") then
				local _,_,sWho,sWhy = string.find(sWhat, "(%S+)%s(.*)")
				if sWhy == nil then
					sWho = sWhat
					sWhy = "No reason given"
				end
				local sKickMessage = "User "..sWho.." was kicked and banned by: "..User.sName.."  because: "..sWhy.." 				is kicking because:"
				SendToAll(sBotName ,sKickMessage)
			end
		end
	end
end

speedX

#2
Mr.T  please use the "code" tags to post any code.
Thanking You,

speedX

Mr.T

where is the code tag cant find it
:)

Tw?sT?d-d?v

[ code ] opens   [ / code ] closes

remove spaces between [ & code

ArtificialInsanety

Thank you guys ,the script works great

SMF spam blocked by CleanTalk