:InterCom: for Ops
 

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

:InterCom: for Ops

Started by Herodes, 15 March, 2005, 11:39:49

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Herodes

This is the latest InterCom, a script similar to nErBoS' Whisper.. ( but I'd like to think of it as being more convenient.. )
--- OpInterCom v 2.6
--- by Herodes
--------- --------- --------- --------- --------- --------- ---------
--- Provides an easy way to communicate in the main chat for operators ...
--- Who needs OpChat when you have InterCom ... lol
--- Just type: " [-]  " in the MainChat ...
--- Note : You DO need the ' [-] ' .. :)
--------- --------- --------- --------- --------- --------- ---------
--- 10 / 8 - 2004
--- added ' [+] ' for going into permanent OpsOnly mode..
--- added ' [=] ' for going out of OpsOnly mode...
--- added ' [?] ' for listing the Ops in OpsOnly mode...
--------- --------- --------- --------- --------- --------- ---------
--- 2 / 3 - 2005
--- converted to Lua 5 for the latest PtokaX
--------- --------- --------- --------- --------- --------- ---------
--- 15 / 3 - 2005 
--- added right-click menu ( request by AMediaMan )
--------- --------- --------- --------- --------- --------- ---------


tCommunicators = {}

function OpConnected(user)
	if user.bUserCommand then
		user:SendData("$UserCommand 1 3 :InterCom:\\OpsOnly Mode\\ON$<%[mynick]> [+]||")
		user:SendData("$UserCommand 1 3 :InterCom:\\OpsOnly Mode\\OFF$<%[mynick]> [=]||")
		user:SendData("$UserCommand 1 3 :InterCom:\\OpsOnly Msg$<%[mynick]> [-]%[line:Enter your msg here:]||")
		user:SendData("$UserCommand 1 3 :InterCom:\\List OpsOnly Opers$<%[mynick]> [?]||")
		user:SendData(":InterCom:", "New Right-Click for InterCom is Available..")
	end
end

function ChatArrival(oper, msg)
	if ( oper.bOperator ) then
		local s, e, txt = string.find(msg, "%b<>%s+(.+)")
		if ( string.sub(txt, 1 ,3) == "[-]" ) then 
			local s, e, txt = string.find(txt, "%[-%](.*)")
			SendToOps("OpsOnly", "["..oper.sName.."] "..txt)
			return 1
		elseif ( string.sub(txt, 1 ,3) == "[+]" ) then
			if (tCommunicators[oper.sName] == 1) then
				oper:SendData("OpsOnly", "You are in OpsOnly mode already...")
			elseif (tCommunicators[oper.sName] == nil) then
				tCommunicators[oper.sName] = 1
				oper:SendData("OpsOnly", "You are in OpsOnly mode now ... to go into normal type ' [=] ' ")
				SendToOps("OpsOnly", "*** "..oper.sName.." went into OpsOnly mode...")
			end
			return 1
		elseif ( string.sub(txt, 1, 3) == "[=]" ) then
			if (tCommunicators[oper.sName] == nil) then
				oper:SendData("OpsOnly", "You were not in OpsOnly mode ...")
			elseif (tCommunicators[oper.sName] == 1) then
				tCommunicators[oper.sName] = nil
				oper:SendData("OpsOnly", "You are in normal mainchat mode now ... be carefull!!!")
				SendToOps("OpsOnly", "*** "..oper.sName.." is in normal chat mode now")
			end
			return 1
		elseif ( string.sub(txt, 1,3) == "[?]" ) then
			local msg = ""
			for nick, t in tCommunicators do msg = msg.."\n\t     - "..nick end
			if msg == "" then msg = " None are in OpsOnly mode..." else msg = "\n\t Operators in OpsOnly Mainchat mode :"..msg end
			oper:SendData("OpsOnly", msg )
			return 1
		else 
			for name , v in tCommunicators do
				if (name == oper.sName) then
					SendToOps("OpsOnly", "["..oper.sName.."] "..txt)
					return 1
				end
			end
		end
	end
end

AMediaMan

Hey Herodes very nice ty. This is a great script thnx again and keep up the great work :)



AMediaMan

Herodes

QuoteOriginally posted by AMediaMan
Hey Herodes very nice ty. This is a great script thnx again and keep up the great work :)



AMediaMan
yw AMediaMan,.. if you have any ideas about it feel free to post them ;)

AMediaMan

Ok Herodes ive been thinking hahaha,
and came up with this idea. How about
adding like a reverse effect of
the [-] message command ?  What
i mean is : [-] message is a op's only
message when one is not in [+] op's
only mode. So how about if
you are in [+] op's only mode you can
type [-] message it will go in main chat
like normal.  Just a thought that might
come in handy ;)


AMediaMan

Herodes

Yeah,.. good idea .. should be on its way ;)

AMediaMan

Very cool ;)

Still a great script, we use it all the time lol.



AMediaMan

Herodes

There it is .. ready ( not tested, so almost certain ;)
--- OpInterCom v 2.7
--- by Herodes
--------- --------- --------- --------- --------- --------- ---------
--- Provides an easy way to communicate in the main chat for operators ...
--- Who needs OpChat when you have InterCom ... lol
--- Just type: " [-]  " in the MainChat ...
--- Note : You DO need the ' [-] ' .. :)
--------- --------- --------- --------- --------- --------- ---------
--- 10 / 8 - 2004
--- added ' [+] ' for going into permanent OpsOnly mode..
--- added ' [=] ' for going out of OpsOnly mode...
--- added ' [?] ' for listing the Ops in OpsOnly mode...
--------- --------- --------- --------- --------- --------- ---------
--- 2 / 3 - 2005
--- converted to Lua 5 for the latest PtokaX
--------- --------- --------- --------- --------- --------- ---------
--- 15 / 3 - 2005
--- added right-click menu ( request by AMediaMan )
--------- --------- --------- --------- --------- --------- ---------
--- 28/3 - 2005
--- changed [-] mode switches does the inverse than your mode ( OpsOnly -> Normal and reverse ) ( request by AMediaMan )
--------- --------- --------- --------- --------- --------- ---------

tCommunicators = {}

function OpConnected(user)
	if user.bUserCommand then
		user:SendData("$UserCommand 1 3 :InterCom:\\OpsOnly Mode\\ON$<%[mynick]> [+]||")
		user:SendData("$UserCommand 1 3 :InterCom:\\OpsOnly Mode\\OFF$<%[mynick]> [=]||")
		user:SendData("$UserCommand 1 3 :InterCom:\\OpsOnly Msg$<%[mynick]> [-]%[line:Enter your msg here:]||")
		user:SendData("$UserCommand 1 3 :InterCom:\\List OpsOnly Opers$<%[mynick]> [?]||")
		user:SendData(":InterCom:", "New Right-Click for InterCom is Available..")
	end
end

function ChatArrival(oper, msg)
	if ( oper.bOperator ) then
		local s, e, txt = string.find(msg, "%b<>%s+(.+)")
		if ( string.sub(txt, 1 ,3) == "[-]" ) then
			local s, e, txt = string.find(txt, "%[-%](.*)")
			if (tCommunicators[oper.sName] == 1) then
				SendToAll( oper.sName, txt )
			elseif (tCommunicators[oper.sName] == nil) then
				SendToOps("OpsOnly", "["..oper.sName.."] "..txt)
			end
			return 1
		elseif ( string.sub(txt, 1 ,3) == "[+]" ) then
			if (tCommunicators[oper.sName] == 1) then
				oper:SendData("OpsOnly", "You are in OpsOnly mode already...")
			elseif (tCommunicators[oper.sName] == nil) then
				tCommunicators[oper.sName] = 1
				oper:SendData("OpsOnly", "You are in OpsOnly mode now ... to go into normal type ' [=] ' ")
				SendToOps("OpsOnly", "*** "..oper.sName.." went into OpsOnly mode...")
			end
			return 1
		elseif ( string.sub(txt, 1, 3) == "[=]" ) then
			if (tCommunicators[oper.sName] == nil) then
				oper:SendData("OpsOnly", "You were not in OpsOnly mode ...")
			elseif (tCommunicators[oper.sName] == 1) then
				tCommunicators[oper.sName] = nil
				oper:SendData("OpsOnly", "You are in normal mainchat mode now ... be carefull!!!")
				SendToOps("OpsOnly", "*** "..oper.sName.." is in normal chat mode now")
			end
			return 1
		elseif ( string.sub(txt, 1,3) == "[?]" ) then
			local msg = ""
			for nick, t in tCommunicators do msg = msg.."\n\t     - "..nick end
			if msg == "" then msg = " None are in OpsOnly mode..." else msg = "\n\t Operators in OpsOnly Mainchat mode :"..msg end
			oper:SendData("OpsOnly", msg )
			return 1
		else
			for name , v in tCommunicators do
				if (name == oper.sName) then
					SendToOps("OpsOnly", "["..oper.sName.."] "..txt)
					return 1
				end
			end
		end
	end
end

TiMeTrAVelleR

funktion to talk to 1 person (like in whisper) would make it perfeckt  

Greetz TT

Herodes

QuoteOriginally posted by T?M??r?V?ll?R
funktion to talk to 1 person (like in whisper) would make it perfeckt  

Greetz TT
How the heck did i miss that .. It is in the upcoming already ;)

TiMeTrAVelleR


Herodes

#10
Done,.. :D any more feature request will be welcomed ;)
--- OpInterCom v 3
--- by Herodes
--------- --------- --------- --------- --------- --------- ---------
--- Provides an easy way to communicate in the main chat for operators ...
--- Who needs OpChat when you have InterCom ... lol
--- Just type: " [-]  " in the MainChat ...
--- Note : You DO need the ' [-] ' .. :)
--------- --------- --------- --------- --------- --------- ---------
--- 10 / 8 - 2004
--- added ' [+] ' for going into permanent OpsOnly mode..
--- added ' [=] ' for going out of OpsOnly mode...
--- added ' [?] ' for listing the Ops in OpsOnly mode...
--------- --------- --------- --------- --------- --------- ---------
--- 2 / 3 - 2005
--- converted to Lua 5 for the latest PtokaX
--------- --------- --------- --------- --------- --------- ---------
--- 15 / 3 - 2005
--- added right-click menu ( request by AMediaMan )
--------- --------- --------- --------- --------- --------- ---------
--- 28/3 - 2005
--- changed [-] mode switches does the inverse than your mode ( OpsOnly -> Normal and reverse )
--- added [!]    to talk to a single person ;) ( request by TimeTraveler )
--------- --------- --------- --------- --------- --------- ---------

tCommunicators = {}

function OpConnected(user)
	if user.bUserCommand then
		user:SendData("$UserCommand 1 3 :InterCom:\\OpsOnly Mode\\ON$<%[mynick]> [+]||")
		user:SendData("$UserCommand 1 3 :InterCom:\\OpsOnly Mode\\OFF$<%[mynick]> [=]||")
		user:SendData("$UserCommand 1 3 :InterCom:\\OpsOnly Msg$<%[mynick]> [-]%[line:Enter your msg here:]||")
		user:SendData("$UserCommand 1 2 :InterCom:\\WhisperToUser$<%[mynick]> [!] %[nick] %[line:Enter your msg here:]||")
		user:SendData("$UserCommand 1 3 :InterCom:\\List OpsOnly Opers$<%[mynick]> [?]||")
		user:SendData(":InterCom:", "New Right-Click for InterCom is Available..")
	end
end

function ChatArrival(oper, msg)
	if ( oper.bOperator ) then
		local s, e, txt = string.find(msg, "%b<>%s+(.+)")
		if ( string.sub(txt, 1 ,3) == "[-]" ) then
			local s, e, txt = string.find(txt, "%[-%]%s*(.*)")
			if (tCommunicators[oper.sName] == 1) then
				SendToAll( oper.sName, txt )
			elseif (tCommunicators[oper.sName] == nil) then
				SendToOps("OpsOnly", "["..oper.sName.."] "..txt)
			end
			return 1
		elseif ( string.sub( txt, 1, 3 ) == "[!]" ) then
			local s,e,who, txt = string.find( txt, "%[!%]%s+(%S+)%s*(.*)")
			local w = GetItemByName(who)
			if w then
				w:SendData( "WhisperForYou", "["..oper.sName.."] "..txt)
				oper:SendData("Whispered", "*** "..who.." was whispered with : "..txt)
			else
				oper:SendData( "OpsOnly", "There is no user named "..who..",... try again.")
			end
			return 1
		elseif ( string.sub(txt, 1 ,3) == "[+]" ) then
			if (tCommunicators[oper.sName] == 1) then
				oper:SendData("OpsOnly", "You are in OpsOnly mode already...")
			elseif (tCommunicators[oper.sName] == nil) then


				tCommunicators[oper.sName] = 1
				oper:SendData("OpsOnly", "You are in OpsOnly mode now ... to go into normal type ' [=] ' ")
				SendToOps("OpsOnly", "*** "..oper.sName.." went into OpsOnly mode...")
			end
			return 1
		elseif ( string.sub(txt, 1, 3) == "[=]" ) then
			if (tCommunicators[oper.sName] == nil) then
				oper:SendData("OpsOnly", "You were not in OpsOnly mode ...")
			elseif (tCommunicators[oper.sName] == 1) then
				tCommunicators[oper.sName] = nil
				oper:SendData("OpsOnly", "You are in normal mainchat mode now ... be carefull!!!")
				SendToOps("OpsOnly", "*** "..oper.sName.." is in normal chat mode now")
			end
			return 1
		elseif ( string.sub(txt, 1,3) == "[?]" ) then
			local msg = ""
			for nick, t in tCommunicators do msg = msg.."\n\t     - "..nick end
			if msg == "" then msg = " None are in OpsOnly mode..." else msg = "\n\t Operators in OpsOnly Mainchat mode :"..msg end
			oper:SendData("OpsOnly", msg )
			return 1
		else
			for name , v in tCommunicators do
				if (name == oper.sName) then
					SendToOps("OpsOnly", "["..oper.sName.."] "..txt)
					return 1
				end
			end
		end
	end
end

Herodes

just added a response on success for the whisper-to-user function, that had been req by TimeTraveler...

The script above has been edited..

TiMeTrAVelleR

Works  perfeckt :))  Thanks

Greetzzz  TT

Riptorn

another nice script like this one saves all them soddin popups  ty  :D

Jacksons_Xone

Thanks for this one. Works perfectly in my hub.

Great work

Herodes

Thanks for your comments Riptorn,Jacksons_Xone ;)

MichaelD

Very good script.  Thank you so much. It's working perfectly.  :D

AMediaMan

any ideas why i cant get this to work with PtokaX 17.07 ? im so bummed now :(



AMediaMan

jiten

QuoteOriginally posted by AMediaMan
any ideas why i cant get this to work with PtokaX 17.07 ? im so bummed now :(



AMediaMan
Tried it a while ago and I didn't get any error. All the commands seem to be working well. Maybe if you copy the script all over again... Who knows.

Cheers

SMF spam blocked by CleanTalk