Request for Hub script to disable PM and chat if even possible.
 

Request for Hub script to disable PM and chat if even possible.

Started by crazytown232001, 05 February, 2011, 02:59:05

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

crazytown232001

I searched the forum for keywords "disable" "PM" and also with "Chat".  I found nothing that resembles what I am wanting.  Basically, I just want to turn off this feature if it is even possible.  The reason being is that I do not want people circumventing the hub and trading files on the side.  Naturally, PM and chat are the best way to trade emails or propose a different hub to use. 

Also, being new to the Hub setup process, could someone explain how I install/run a script on the Hub?

Thanks.

crazytown232001

Thanks for the quick and thorough response, Mutor.  Oddly, I didn't even check the Finished Scripts section.  I wasn't aware that being in the "Request for scripts" section only did a search within the "Request for scripts section".  Now I see why it didn't come up. 

BTW, as I am using the GUI version of PtokaX 4.1.2, is there a way for me to alter a section of this code to make it block everyone from PMing and blocking everyone from chatting without having to resort to the Command Interface?  Sorry to annoy you with beginner questions.  I am trying to learn, but just starting down the path.  Also, just getting into programming, so far from familiar with navigating this code. 

Thanks again.

the-master

sure, change settings under rules, mainchat and pm limits to 0
keep on sharing :)

crazytown232001

#3
Request to Mutor:

Is there any way that you can tell me what code I need to alter to separate the permissions for PmLock and MainLock in Chatlock 2.0?

I am very happy with this script, but am just curious if you could guide me on what I would need to change to make separate variables/profiles for PmLock and MainLock.

ie:
Instead of this:
_____________________________________________________________
-- Profile Permissions, which profiles may chat/pm even when chat/pm is locked.
-- Regarding pm's, if either sender or recipient has permission, pm shall be sent
Profiles = {
   [-1] = false,   -- Unregistered User
   [0] = true,   -- Masters
   [1] = false,   -- Opertors
   [2] = false,   -- VIP
   [3] = false,   -- Registered
   },

_____________________________________________________

Something like this:
--Chat permissions
-- Profile Permissions, which profiles may chat even when chat is locked.

Profiles = {
   [-1] = false,   -- Unregistered User
   [0] = true,   -- Masters
   [1] = false,   -- Opertors
   [2] = true,   -- VIP
   [3] = false,   -- Registered
   },

--PM permissions
-- Profile Permissions, which profiles may PM even when PM is locked.
-- Regarding pm's, if either sender or recipient has permission, pm shall be sent

Profiles = {
   [-1] = false,   -- Unregistered User
   [0] = true,   -- Masters
   [1] = false,   -- Opertors
   [2] = false,   -- VIP
   [3] = false,   -- Registered
   },



If this is possible, I would love to have this option.  I could lock down PMs indefinitely so that all correspondence are public and no shady stuff can go on behind the scenes (ie trying to circumvent the hub for sharing or trading rather than sharing out material), along with everyone being able to participate like a big chat room.

Users would all be VIP, which would be identical setting as Registered users.  I could set the VIP setting to false in PM and true in MainChat.  If users abused the MainChat, I could drop them down to Registered status, which will be set to false for MainChat. 

If this is too much work to guide me through altering the script, thanks anyway for your help thus far.  I would have still been at square on had it not been for your killer ChatLock 2 script.

crazytown232001

#4
Would it be possible to add a second set of variables in for Profiles such as this?

Profiles = {
   [-1] = false,   -- Unregistered User
   [0 ] = true,   -- Masters
   [1] = false,   -- Opertors
   [2] = false,   -- VIP
   [3] = false,   -- Registered

[b]  [4] = false,   -- Unregistered User
   [5] = true,   -- Masters
   [6] = false,   -- Opertors
   [7] = false,   -- VIP
   [8] = false,   -- Registered  [/b] },
_________________________________

and then modify the code (I know it will be really messy, but as long as it works) where we add 5 to the variable dealing with MainChat in order to access the new set of variables:

if to then
      local usr = Core.GetUser(to)
      if usr and Mc.PmLock then
         if not Mc.Profiles[usr.iProfile] and not 
Mc.Profiles[user.iProfile] then
            return Core.SendPmToUser(user,usr.sNick,"<"..Mc.Bot.."> 
Sorry, "..user.sNick..
            ", private messages are disabled for you and 
"..usr.sNick.."."),true
         end                                              |
      end                                                 |
   else                                                   V
      if Mc.MainLock and not Mc.Profiles[user.iProfile[b]+5[/b]] then
         return Core.SendToUser(user,"<"..Mc.Bot.."> Sorry, 
"..user.sNick..
         ", main chat is currently disabled."),true
      end
   end

__________________________________________________________

obviously I know very little about coding, but I am just trying to come up with a general concept of a way to change the script without major overhaul, if even possible.
???
I figure you may be more likely to work with me if I at least put in some effort of my own rather than just demand you build me taylor-made scripts, like I have seen done on multiple past posts. ;D

Thanks again for your efforts so far.  I will really appreciate it if you would be willing to help me with this modification, but as I said before, you have helped me move from 0 to 90% of what I am trying to accomplish, so thanks either way.

crazytown232001

Wow!  Disregard my new request.  I decided to plug in my proposed changes and run it to see if the error messages gave me hints to which variable was which.  Ends up it runs like that and did what I was trying to do (set to separate sets of variables for disabling PM and Chat.  Man my face is red for pestering you when I had what I needed this whole time. :-[

SMF spam blocked by CleanTalk