Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google Log In with Steam Sign In
  • Create Account
Photo

Private message by shrubbot level

- - - - -

  • Please log in to reply
6 replies to this topic

#1
OFFLINE   BECK

BECK

    Advanced Member

  • Subscriber
  • PipPipPipPip
  • 226 posts
61
Getting Better
  • LocationDenver, CO

I looked in the docs, maybe something like this already exists but I couldn't find it. 

 

There are times when sending a PM to a group of people is very useful.  On our server, if I want to communicate with my members, I just do "/m iow blah blah blah".  That usually works -- UNLESS your members are in alias.

 

It would be nice to be able to do something like: "/ml 4 message to all level 4 and above".

 

So its the ml command.  It takes a shrubbot level as the first argument and sends the private message to all players who match that level AND above.   That way, I can communicate with my members without worrying to exclude people based on their name at the time.   I suppose it is somewhat similar to the /ma command, but we have that exclusively for our admins.     But this would be a way for even lower level members to be able to communicate only with their fellow clanmates.

 

Like I said, if something like this already exists, I apologize for posting here, but I couldn't find it. 

 

Thanks! Hope you find this a good suggestion and something easy to implement.



#2
OFFLINE   gaoesa

gaoesa

    Advanced Member

  • Management
  • PipPipPipPip
  • 4391 posts
341
Will become famous
  • LocationFinland

I think this would be easiest to implement with a Lua script. You could make a custom command to shrubbot.cfg such as "ml". This command would then get directed to Lua script, which would send private message to all connected players with level higher then what you have specified. Excluding the player who issued the command. Or you could exclude the level from the command and have something like "mm", which would send it to all connected players having some specified member level and above. Specified in the script.

 

Related links

http://mygamingtalk...._shrubbot_level

 

About implementing this in the shrubbot, it is rather server specific and I would rather see something more generic.



#3
OFFLINE   Purple

Purple

    Advanced Member

  • Banned
  • PipPipPipPip
  • 157 posts
56
Getting Better

This is possible. It has already been done if i'm correct, Micha has a script around for it, I may also still have it. let me know if you still need it i can for sure get it for you :D



#4
OFFLINE   BECK

BECK

    Advanced Member

  • Subscriber
  • PipPipPipPip
  • 226 posts
61
Getting Better
  • LocationDenver, CO

This is possible. It has already been done if i'm correct, Micha has a script around for it, I may also still have it. let me know if you still need it i can for sure get it for you :D

 

Yes, way too busy atm to try and write one myself.   Much appreciated!



#5
OFFLINE   Purple

Purple

    Advanced Member

  • Banned
  • PipPipPipPip
  • 157 posts
56
Getting Better

Yes, way too busy atm to try and write one myself.   Much appreciated!

ill post it for you in about 30 minutes gonna eat dinner real quick and get back to it.



#6
OFFLINE   Purple

Purple

    Advanced Member

  • Banned
  • PipPipPipPip
  • 157 posts
56
Getting Better

Yes, way too busy atm to try and write one myself.   Much appreciated!

--[[
Purple Admin Chat
Version 0.1

--]]

modname = "AdminChat"
version = "0.1"
admin_chat = "ml"
min_level = 3


function et_InitGame(levelTime, randomSeed, restart)
  et.RegisterModname(modname .. " " .. version)
  maxclients = tonumber(et.trap_Cvar_Get("sv_maxclients"))-1
end

function et_ClientCommand(clientNum, command) 
   if command == admin_chat and getlevel(clientNum) then
		if et.trap_Argc() > 1 then
		local message = ""
			for i = 1, et.trap_Argc() - 1, 1 do
				message = message .. et.trap_Argv(i) .. " "
			end
			for i = 0, maxclients, 1 do
				sendstring = playerName(clientNum) .. " ^w(^8AdminChat^w)^8: " .. message
				et.trap_SendServerCommand(i, "chat \"" .. sendstring .. "\"")
				return 1
			end
		end
		elseif command == admin_chat and not getlevel(clientNum) then
			et.trap_SendServerCommand(clientNum, "cpm \"^1 You Are Not Allowed To Use Admin Chat.\n\" " )
		return 1
    end
end

function getlevel(client)
	local lvl = et.G_shrubbot_level(client)
	if lvl >= min_level then
		return true
	end
		return nil
end

function playerName(id)
  local name = et.Info_ValueForKey(et.trap_GetUserinfo(id), "name")
  if name == "" then
    return "*unknown*"
  end
  return name
end


#7
OFFLINE   BECK

BECK

    Advanced Member

  • Subscriber
  • PipPipPipPip
  • 226 posts
61
Getting Better
  • LocationDenver, CO

Thanks, I'll give it a try.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users