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 yoonohoo, 29 May, 2005, 15:45:08

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

yoonohoo

Can some1 make a script (rightclick) where the user can change their welcome statement.

Like found in Guarding.

Many thanks

It might be simple for you but rocket science for me...

Dessamator

click on my signature !
Ignorance is Bliss.

yoonohoo

I did searched prior to your useless reply but unfortunately couldn't find a simple script.
If you want to help you're most welcome but don't waste my time with foolish replies.

Thank you.

It might be simple for you but rocket science for me...

Dessamator

#3
QuoteOriginally posted by yoonohoo
I did searched prior to your useless reply but unfortunately couldn't find a simple script.
If you want to help you're most welcome but don't waste my time with foolish replies.

Thank you.

have u searched in the finished lua 5 scripts?, have u searched in the lua 5 requested scripts   section ? if so then u really need to fine tune ur searching techniques, either way ,Check here

as for right click, u can add it on ur own , lua 5 check the how to section, if u really cant, then ill be glad to do so !
Ignorance is Bliss.

yoonohoo

Thank you for the link.
Quoteas for right click, u can add it on ur own , lua 5 check the how to section, if u really cant, then ill be glad to do so !
As for lua coding I've seen the "how to" and thats way, way out of my capabilities...see my sig! Me like windows :)) I was even considering using Guarding with only that function enabled (Using already Robocop, Lucifer and R&R).
So if help is at hand: simple script for all users to be able to change their welcome message with rc.
Many thanks.

It might be simple for you but rocket science for me...

bastya_elvtars

Preparing for my exam, so zust posting the needed functions from lawmaker... pray somebody will do it for you. Not a big deal, but unfortunately no time here.

function SendToUser(user,env,who,mesg)
	user:SendData(parseenv(user,env,who)..mesg)
end

function addwelcome(user,data,env)
	if levaddwelcome~=0 then
		if CheckUserLevel(user) >= levaddwelcome then
			local _,_,pt1,pt2=string.find(data,"%b<>%s+%S+%s+(.+)%s:%s(.+)")
			if pt1 and pt2 then
				if announce[user.sName] then
				else
					announce[user.sName]={}
				end
				table.insert(announce[user.sName],pt1.." [USER] "..pt2)
				savewelcome()
				SendToUser(user,env,Bot,"Successfully added the message.")
			else
				SendToUser(user,env,Bot,"Incorrect usage, correct is: +addwelcome pt1 : pt2")
			end
		else
			SendToUser(user,env,Bot,"You do not have sufficient rights to run that command! |")
		end
	else
		SendToUser(user,env,Bot,"That command is disabled.")
	end
end

function showwelcome(user,data,env)
	if levshowwelcome~=0 then
		if CheckUserLevel(user) >= levshowwelcome then
			local _,_,param=string.find(data,"%b<>%s+%S+%s+(%S+)")
			local msg=""
			if param then
				if announce[param] and table.getn(announce[param])>0 then
					msg=msg.."Here you go, announces of "..param..":\r\n==============================\r\n"
					for a=1,table.getn(announce[param]) do
						local u=string.gsub(announce[param][a],"%b[]",param)
						msg=msg..a..". "..u.."\r\n"
					end
					msg=msg.."=============================="
					user:SendPM(Bot,msg)
				else
					SendToUser(user,env,Bot,"Unknown user,or has no messages!")
				end
			else
				if announce[user.sName] and table.getn(announce[user.sName])>0 then
					msg=msg.."Here you go, your announces :\r\n==============================\r\n"
					for a=1,table.getn(announce[user.sName]) do
						local u=string.gsub(announce[user.sName][a],"%b[]",user.sName)
						msg=msg..a..". "..u.."\r\n"
					end
					msg=msg.."=============================="
					user:SendPM(Bot,msg)
				else
					SendToUser(user,env,Bot,"You have no announces!")
				end
			end
		else
			SendToUser(user,env,Bot,"You do not have sufficient rights to run that command! |")
		end
	else
		SendToUser(user,env,Bot,"That command is disabled.")
	end
end

function savewelcome()
	local f=io.open("lawmaker/inifiles/announce.ini","w+")
	local msg="announce={\n"
	for a,b in announce do
		msg=msg.."[\""..a.."\"]={"..parsing(b).."},\n"
	end
	msg=msg.."}"
	f:write(msg)
	f:close()
end

function saveleave()
	local f=io.open("lawmaker/inifiles/leave.ini","w+")
	local msg="goodbye={\n"
	for a,b in goodbye do
		msg=msg.."[\""..a.."\"]={"..parsing(b).."},\n"
	end
	msg=msg.."}"
	f:write(msg)
	f:close()
end

function parsing(arr)
	local msg=""
	for b=1,table.getn(arr) do
		msg=msg.."\""..arr[b].."\","
	end
	return msg
end

function delwelcome(user,data,env)
	if levdelwelcome~=0 then
		if CheckUserLevel(user) >= levdelwelcome then
			local _,_,arg=string.find(data,"%b<>%s+%S+%s+(.+)")
			if arg then
				string.gsub(arg,"(%d+)",function(idx)
									local id=tonumber(idx)
									if announce[user.sName][id] then
										SendToUser(user,env,Bot,"Announce #"..id.." deleted!")
										tos.remove(announce[user.sName],id)
										if table.getn(announce[user.sName])==0 then announce[user.sName]=nil end
										savewelcome()
									else
										SendToUser(user,env,Bot,"Announce #"..id.." not found!")
									end
								end)
			else
				SendToUser(user,env,Bot,"Invalid use! Usage: +delwelcome ")
			end
		else
			SendToUser(user,env,Bot,"You do not have sufficient rights to run that command! |")
		end
	else
		SendToUser(user,env,Bot,"That command is disabled.")
	end
end

function addleave (user,data,env)
	if levaddleave~=0 then
		if CheckUserLevel(user) >= levaddleave then
			local _,_,msg=string.find(data,"%b<>%s+%S+%s+(.+)")
			if msg then
				if goodbye[user.sName] then
				else
					goodbye[user.sName]={}
				end
				table.insert(goodbye[user.sName],"[USER] "..msg)
				saveleave()
				SendToUser(user,env,Bot,"Successfully added the message.")
			else
				SendToUser(user,env,Bot,"Incorrect usage, correct is: +addleave ")
			end
		else
			SendToUser(user,env,Bot,"You do not have sufficient rights to run that command! |")
		end
	else
		SendToUser(user,env,Bot,"That command is disabled.")
	end
end

function delleave(user,data,env)
	if levdelleave~=0 then
		if CheckUserLevel(user) >= levdelleave then
			local _,_,arg=string.find(data,"%b<>%s+%S+%s+(.+)")
			if arg then
				string.gsub(arg,"(%d+)",function(idx)
									local id=tonumber(idx)
									if goodbye[user.sName][id] then
										SendToUser(user,env,Bot,"Announce #"..id.." deleted!")
										tos.remove(goodbye[user.sName],id)
										if table.getn(leave[user.sName])==0 then leave[user.sName]=nil end
										saveleave()
									else
										SendToUser(user,env,Bot,"leave #"..id.." not found!")
									end
								end)
			else
				SendToUser(user,env,Bot,"Invalid use! Usage: +delleave ")
			end
		else
			SendToUser(user,env,Bot,"You do not have sufficient rights to run that command! |")
		end
	else
		SendToUser(user,env,Bot,"That command is disabled.")
	end
end

function showleave(user,data,env)
	if levshowleave~=0 then
		if CheckUserLevel(user) >= levshowleave then
			local _,_,param=string.find(data,"%b<>%s+%S+%s+(%S+)")
			local msg=""
			if param then
				if goodbye[param] and table.getn(goodbye[param])>0 then
					msg=msg.."Here you go, leave leaves of "..param..":\r\n==============================\r\n"
					for a=1,table.getn(goodbye[param]) do
						local u=string.gsub(goodbye[param][a],"%b[]",param)
						msg=msg..a..". "..u.."\r\n"
					end
					msg=msg.."=============================="
					user:SendPM(Bot,msg)
				else
					SendToUser(user,env,Bot,"Unknown user,or has no messages!")
				end
			else
				if goodbye[user.sName] and table.getn(goodbye[user.sName])>0 then
					msg=msg.."Here you go, your leave leaves :\r\n==============================\r\n"
					for a=1,table.getn(goodbye[user.sName]) do
						local u=string.gsub(goodbye[user.sName][a],"%b[]",user.sName)
						msg=msg..a..". "..u.."\r\n"
					end
					msg=msg.."=============================="
					user:SendPM(Bot,msg)
				else
					SendToUser(user,env,Bot,"You have no leaves!")
				end
			end
		else
			SendToUser(user,env,Bot,"You do not have sufficient rights to run that command! |")
		end
	else
		SendToUser(user,env,Bot,"That command is disabled.")
	end return 1
end
Everything could have been anything else and it would have just as much meaning.

yoonohoo

Thank you and good luck

I've just realised Robocop has a line to enter custom cmd
customCMDs = function(user) --// You can put your custome commands here  user:SendData("$UserCommand 1 3 zCUSTOM\\Test$<%[mynick]> !test||")	-- Example line
If that's of any help to make it easier

It might be simple for you but rocket science for me...

SMF spam blocked by CleanTalk