PM then timed boot if not cancelled
 

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

PM then timed boot if not cancelled

Started by Stravides, 27 March, 2005, 04:32:25

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Stravides

Greetz ..

 So far still using lua 4... need upgrading also...

I'm looking for some code to assist me in the removal of muppets from my hub.
I have a number of rules that are constantly being infringed, and am getting a little peeved trying to remember who and what I pm, so I want to take the work out of the job.  
What I want is to send a PM to the offending user stating what rules have been broken and telling them they have 10 mins to reply to me or I will kick them automatically.  
Once I send the PM the clock starts ticking for that user, if the alarm is not cancelled 10 mins later the user is to be auto kicked for the rules listed.  
If the OP gets a reply he can cancel the timer on the user.  
I'm thinking that if the user and timestamp were entered into either a table or file and compared to current time it could determine if user was to be rebooted -
I also run a number of timers so I do not want to use Start/Stop timer.  What I have so far is a bit mish/mash..

Rightclick commands
==============
	user:SendData("$UserCommand 1 6 Warn\\PM warning ON$<%[mynick]> !pmwarnon  %[nick] %[line:Enter rule numbers]|") 
	user:SendData("$UserCommand 1 6 Warn\\PM warning OFF$<%[mynick]> !pmwarnoff  %[nick]|") 



function Main() 
	frmHub:RegBot("Smeag") 	
 	LoadFromFile(fUser)
	frmHub:EnableSearchData(1)
	loadchat()
	for name, users in bots do
		frmHub:RegBot(name)
	end
	SendToAll(BOTNameInfo)

	botLen = strlen( BOTName )
	RegTimer(CheckShare, 10*Min)
--	RegTimer(LocalTimer, 1*Min)
	SetTimer(TmrFreq)
	StartTimer()
end 

Existing Timer functions
================

function RegTimer(f, Interval)
	local tmpTrig = Interval / TmrFreq
	assert(Interval >= TmrFreq , "RegTimer(): Please Adjust TmrFreq")
	local Timer = {n=0}
	Timer.func=f
	Timer.trig=tmpTrig
	Timer.count=1
	tinsert(tabTimers, Timer)
end

function LocalTimer()
	frmHub:UnregBot(startchrs ..current ..endchrs)
	time = date("%H:%M")
	current = time
	frmHub:RegBot(startchrs ..current ..endchrs)
end

function OnTimer()
	for i=1, getn(tabTimers) do
		tabTimers[i].count = tabTimers[i].count + 1
		if tabTimers[i].count > tabTimers[i].trig then
			tabTimers[i].count=1
			tabTimers[i]:func()
		end
	end
end


Part of DataArrival
=============

		elseif (cmd == prefix.."pmwarnon") then
			local s,e,nick,message = strfind( data, "%b<>%s+%S+%s+(%S+)%s*(.*)" )
			local vUser = GetItemByName(nick)
			if message == "" then
				user:SendPM(BOTName,"Please supply rules")
			elseif user.iProfile == 0 or user.iProfile == 1 or user.iProfile == 4 then
				vUser:SendPM(user.sName,"You are violating rules "..message..", if you haven't answered this message within the next 10 min, you will be kicked automatically")
				return 1
			end

Any Help is appreciated..
Stravides
For RPG Books, Mp3 & Videos
We host trivia  and the ever failing Smeagolbot

Stravides

#1
Even just the compare timer function would be a great help... think am gonna create a table with

user.sName,
time (HH:MM)
Ban or Kick
and Reason/Rule Broken

Many thanks in advance
Stravides ..
Stravides
For RPG Books, Mp3 & Videos
We host trivia  and the ever failing Smeagolbot

SMF spam blocked by CleanTalk