"Inteligent" add message
 

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

"Inteligent" add message

Started by enema, 28 September, 2004, 19:38:49

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

enema

Hi!

Im woundering if there is such a part of script or code that sends add message in chat only when somebody is acctualy chatting in main? I want this add message to appear only when there are several lines in chat fulled up. So this add message could appear like only once a day (if chat is unused) or even after every minute (if everybody types stuff all the time)

enema

forgot one thing:

Dont make this script for me, I want to make it myself!!!! Just give me part of the script or code (if it exist, lol :D)

Psycho_Chihuahua

well, i know this won't be much help (i'm also noob)
but my guess is that you would need 2 triggers for that.

1. trigger set at x amount of mainchat lines

2. trigger set at a certain interval


greetz
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

BoJlk

#3
There's a GOOD script by Mutor the great  :D

--AdTimer 1.1
--
--by Mutor
--
--Yet another Hub Advert script
--Sends hub Advert on timer or by command
--
--
--User Settings-------------------------------------------------------------------------------------
bot = "HubAd"						-- Name for bot
mins = 120 						-- Interval [in minutes] between Ads
Hubaddy = "mutor.no-ip.com" 				-- Duh?
HubOwner = "Mutor"					-- Duh?
Prefix = "!"						-- Set Command Prefix
AdComm = "ad"						-- Command to send Ad immediately
TZone = " -5 GMT [EST]"					-- Time Zone hub resides in
HubMsg1 = "Here, you can put announcements"		-- Additional notices/info to be sent with ad
HubMsg2 = "or other information or..."			-- Additional notices/info to be sent with ad
HubMsg3 = "Nothing at all !"				-- Additional notices/info to be sent with ad
--End User Settings----------------------------------------------------------------------------------

function Main() 
	SetTimer(mins*60000) 
	StartTimer() 
end 

function DataArrival(user, data)
	s,e,cmd = strfind(data, "%b<>%s+(%S+)(%S+)")
	if (cmd==Prefix..AdComm) and user.bOperator then
		OnTimer()  
	end
end

function OnTimer() 
	local tmp
	tmp = "\r\n\r\n\t---<>-------------------------------------------------------------------------------------<>---\r\n"  
	tmp = tmp.."\t\t[ "..frmHub:GetHubName().." ]\r\n" 
	tmp = tmp.."\t---<>-------------------------------------------------------------------------------------<>---\r\n" 
	tmp = tmp.."\tHub Name: \t"..frmHub:GetHubName().."\r\n"	-- add/remove tabs ' \t '  ...to center hub name 
	tmp = tmp.."\tHub Owner: \t"..HubOwner.."\r\n" 
	tmp = tmp.."\tHub Addy: \t"..Hubaddy.."\r\n" 
	tmp = tmp.."\tHub Time: \t( "..date("%H:%M").." ) -- "..TZone .."\r\n"
	tmp = tmp.."\tHub Desc: \t"..frmHub:GetHubDescr().."\r\n" 
	tmp = tmp.."\tRedirect To: \t"..frmHub:GetRedirectAddress().."\r\n"
	tmp = tmp.."\tReg Server: \t"..frmHub:GetRegServer().."\r\n"  
	tmp = tmp.."\tRedirect All: \t"..RedirAll().."\r\n" 
	tmp = tmp.."\tRedirect Full: \t"..RedirFull().."\r\n" 
	tmp = tmp.."\tMax Users: \t"..frmHub:GetMaxUsers().."\r\n" 
	tmp = tmp.."\tMin Share: \t"..frmHub:GetMinShare().."\r\n"
	tmp = tmp.."\tHub Share: \t"..frmHub:GetCurrentShareAmount().."\r\n"
	tmp = tmp.."\tMasters Online: \t"..cProfile("Master").."\r\n" 
	tmp = tmp.."\tOps Online: \t"..cProfile("Operator").."\r\n" 
	tmp = tmp.."\tVips Online: \t"..cProfile("VIP").."\r\n"
	tmp = tmp.."\tRegs Online: \t"..cProfile("REG").."\r\n"
	tmp = tmp.."\t---<>-------------------------------------------------------------------------------------<>---\r\n" 
	tmp = tmp.."\tTotal Online: \t"..frmHub:GetUsersCount().."\r\n" 
	tmp = tmp.."\t---<>-------------------------------------------------------------------------------------<>---\r\n" 
	tmp = tmp.."\tNotice(s):\r\n"
	tmp = tmp.."\t-- "..HubMsg1.."\r\n"
	tmp = tmp.."\t-- "..HubMsg2.."\r\n"
	tmp = tmp.."\t-- "..HubMsg3.."\r\n"
	tmp = tmp.."\t---<>-------------------------------------------------------------------------------------<>---\r\n" 
	SendToAll(bot,tmp)
end

function RedirAll() 
	local rdstatusall = frmHub:GetRedirectAll()
	local rastatus = ""
	if rdstatusall == 1 then
		rastatus = "on"
	else
		rastatus = "off"
	end
	return rastatus
end 

function RedirFull()
	local rdstatusfull = frmHub:GetRedirectFull()
	local rfstatus = 0
	if rdstatusfull == 1 then
		rfstatus = "on"
	else
		rfstatus = "off"
	end
	return rfstatus
end 

--// Profile Counter
function cProfile(what)
	local disp = ""
	local table,online,offline = GetUsersByProfile(what),0,0
	for i, User in table do 
		if GetItemByName(User) then
			online = online + 1
		else
			offline = offline + 1
		end
	end
	disp = disp.."Online: "..online.."\tOffline: "..offline
	return disp
end

enema

Thanks Bjojlk, but Im afraid robocop can do better than that (sorry Mutor :D )

enema

can you show me, how do those triggers look like, Psycho_Chihuahua? :D I guess I have to ask for one script to friend where those triggers are used a lot.... But he isnt quite awailable now... guess I should wait for nErBoS :D

enema

sorry for mixing up with your nick, BoJlk! It was an accident :-\

[code] Thanks Bjojlk, but Im afraid robocop can do better than that (sorry Mutor :D ) [code/]

Psycho_Chihuahua

Well the script BoJlk just posted is the one i'm trying to mod.

and stuck in the process as well lol so best bet is to wait for one o them lua geniuses round here to come along  :D
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

BoJlk

#8
No offend taken enema

Might as well Call 4 Mutor  :D

Thou i appreciate you work none the less Psycho_Chihuahua

enema

cmon all the smart minds of the forum! reunite! Could You please give me this tiny sh*t so I could finish my first script ever???? PlZ!!

enema

wtf are you talking about??? What final grade?? stop scaring me!!!


ok... now lets have a look... it is gonna ask for a while, but I wanna do this...

enema

Im sorry, but it isint what im looking for. I need a code or trigger or.... whatever.... that sends add message or anything else in mainchat when certain number of lines ar posted in chat. How does chat historian help me?? At least give me a hint! Im a real newbie but at least im trying to learn from professionals....

enema

ok, maybe my english su*ks... i dont know...

this is what I have:

function OnTimer()
if MessageTimer == 1 then
randomtimer = random(2)
	if randomtimer == 1 then
		SendToAll(Bot,"YYYYYYYYY")
		
		elseif randomtimer == 2 then
		
		SendToAll(Bot,"XXXXX")

	end
end

(uh, I hope i will get those "code" things right)

As you can see, it works on timer... but i dont need any timer! I just need a Trigger or something, that send this add in chat if chat is used!!!

enema

Ok, I admit, I cant do it.... can anyone make this script forme, please??? I tried everything, even changing deflood scripts... I just dont know how to make this one  :(

enema

grr... Im disapponted Myself... next time I will try better

SMF spam blocked by CleanTalk