PtokaX forum

Archive => Archived 5.0 boards => Finished Scripts => Topic started by: Herodes on 15 March, 2005, 11:39:49

Title: :InterCom: for Ops
Post by: Herodes on 15 March, 2005, 11:39:49
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
Title:
Post by: AMediaMan on 16 March, 2005, 02:35:50
Hey Herodes very nice ty. This is a great script thnx again and keep up the great work :)



AMediaMan
Title:
Post by: Herodes on 16 March, 2005, 09:01:47
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 ;)
Title: an idea
Post by: AMediaMan on 25 March, 2005, 02:09:05
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 only mode. So how about if
you are in type [-] message it will go in main chat
like normal.  Just a thought that might
come in handy ;)


AMediaMan
Title:
Post by: Herodes on 25 March, 2005, 11:46:30
Yeah,.. good idea .. should be on its way ;)
Title:
Post by: AMediaMan on 27 March, 2005, 00:47:54
Very cool ;)

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



AMediaMan
Title:
Post by: Herodes on 28 March, 2005, 14:34:05
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
Title:
Post by: TiMeTrAVelleR on 28 March, 2005, 15:09:13
funktion to talk to 1 person (like in whisper) would make it perfeckt  

Greetz TT
Title:
Post by: Herodes on 28 March, 2005, 15:11:30
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 ;)
Title:
Post by: TiMeTrAVelleR on 28 March, 2005, 15:23:35
;)
Title:
Post by: Herodes on 28 March, 2005, 15:36:41
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
Title:
Post by: Herodes on 28 March, 2005, 17:55:49
just added a response on success for the whisper-to-user function, that had been req by TimeTraveler...

The script above has been edited..
Title:
Post by: TiMeTrAVelleR on 28 March, 2005, 18:26:40
Works  perfeckt :))  Thanks

Greetzzz  TT
Title: niceeeeeeeeeeee
Post by: Riptorn on 19 April, 2005, 23:02:46
another nice script like this one saves all them soddin popups  ty  :D
Title:
Post by: Jacksons_Xone on 27 April, 2005, 11:08:47
Thanks for this one. Works perfectly in my hub.

Great work
Title:
Post by: Herodes on 27 April, 2005, 18:47:27
Thanks for your comments Riptorn,Jacksons_Xone ;)
Title:
Post by: MichaelD on 28 April, 2005, 17:51:16
Very good script.  Thank you so much. It's working perfectly.  :D
Title: need help
Post by: AMediaMan on 23 May, 2005, 04:41:24
any ideas why i cant get this to work with PtokaX 17.07 ? im so bummed now :(



AMediaMan
Title:
Post by: jiten on 23 May, 2005, 07:52:52
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