[REQ] Send status message to a defined profile
 

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

[REQ] Send status message to a defined profile

Started by Chucky, 15 January, 2007, 11:51:15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Chucky

Greetings yall  8)

I've been searching by several days for some instructions on what to do on this case, and found nothing about it!

Let me explain my situation:

I own a Hub were all users get "the key" on their nick, by getting regged...
What i would like to change is the Hub messages such as kick, ban, hublist pinger, myinfo flooder,etc ,etc to be shown only to a certain defined profile...
I know i have to disable on Ptokax\Options so that regged users dont received the message...

I tried to ask about it and i got this example, but had not understood what "for id,who in pairs" do...
<Chucky> hey..   is there allready any script that does something similiar to this ?
<Chucky> or an example function....to get the ideia of what to do  ^.^
<Chucky> hmm...  there's must existing already a script with message's, for hublist pinger's, for example
<Chucky> *searching on it*
<Some1> Chucky... something like this -->

sProfile = 0	-- profile that gets message
message = "blabla"	-- message

for id,who in pairs(frmHub:GetOnlineUsers(sProfile)) do
	who:SendData(frmHub:GetHubBotName(),message)
end


Maybe i have here the solution to Hublist and havent notice...But what about the other stuff ?

Any Help woud be apreciated ....   Thankx in advanced  ;D

Cêñoßy†ê

#1
heres small example with pinger

Show = {		-- What profile receives message   1=yes 0 =no
	[-1] = 0,	-- unregistered user
	[0] = 1,	-- master (leviathan/robocop)
	[1] = 1,	-- operator (leviathan/robocop)
	[2] = 0,	-- vip (leviathan/robocop)
	[3] = 0,	-- reg (leviathan/robocop)
	[4] = 1,	-- moderator (leviathan/robocop)
	[5] = 1,	-- netfounder (leviathan/robocop)
	[6] = 1,	-- owner (leviathan)
}

BotINFOArrival = function(user,data) -- pinger detection
        -- Find all online users 
	for id,who in pairs(frmHub:GetOnlineUsers()) do
	        -- check what profile can get message
		if Show[who.iProfile] == 1 then
			-- Send the message
			who:SendData(frmHub:GetHubBotName(),"Pinger "..(user.sName or "n/a").." from IP: "..(user.sIP or "n/a").." detected")
		end
	end
end
Powered By Leviathan™ 2nd Generation v. 1.9

Chucky

Thanks a lot, one more time C??o?y??...

Sorry for hiding your nick on my "code", i just didnt knew if you had any problem about it...

That looks great and solves my hublist pinger problem...But what about the rest of the messages? (status, kick,etc)

I guess i might use the same script (?) and just should change the function "BotINFOArrival" to something else...

I'm i right ?   what function should i use ? 

Thanks and keep up with the good work ;)

Chucky

Well....allready solved the kick messages problem... Just missing the status messages  :-\

Chucky

Well...  i have tryed to do some changes on C??o?y?? script, but looks like it's not working....

Can someone please tell me were am i mistaken ?

--Hublist Pinger detection by C??o?y??
--Hublist Pinger identification added by Chucky


Show = {		-- What profile receives message   1=yes 0 =no
	[0] = 1,	-- master (leviathan/robocop)
	[1] = 0,	-- operator (leviathan/robocop)
	[2] = 0,	-- vip (leviathan/robocop)
	[3] = 0,	-- reg (leviathan/robocop)
	[4] = 0,	-- moderator (leviathan/robocop)
	[5] = 0,	-- netfounder (leviathan/robocop)
	[6] = 0,	-- owner (leviathan)
	[-1] = 0,	-- unregistered user
}

BotINFOArrival = function(user,data) -- pinger detection
        -- Find all online users 
	for id,who in pairs(frmHub:GetOnlineUsers()) do
		--identify the pinger
		if (user.sName == dchublist) then 
		SendToAll(frmHub:GetHubBotName(),"O Pinger dchublist entrou no hub !\r\n Ajuda o Hub, votando em http://www.dchublist.com/index.php?page=show&id=6718\r\n")
		else
	       		 -- check what profile can get message
			if Show[who.iProfile] == 1 then
				who:SendData(frmHub:GetHubBotName(),"Pinger "..(user.sName or "n/a").." from IP: "..(user.sIP or "n/a").." detected")
			end
		end
	end
end


Is it possible to do this ?  :-\

zero-cool

Hi,

Replace
if (user.sName == dchublist) then

To
if (user.sName == "dchublist") then


But the best way would be to create a table with HubPingers name. ;)


Regards,

Chucky

#6
True...  But i only know this hublist with vote option....
You know any other where users can vote ?

Btw...  The script is sendind the message, allright...   But it sended kind a 100 times or more on mainchat to everyone...

I've tried end's....return1....something is missing   ???

SMF spam blocked by CleanTalk