PM to unregs
 

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 to unregs

Started by witch, 12 August, 2004, 12:10:02

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

witch

Hi guys!
Looking for script that send text file every 5 min to unregs in PM.

Thanx in advince  :))



Herodes

It is clear that you havent used the search tool ... try that ... there are many around ...

witch

Well Mr. Herodes just to let u know.....i always do use a search tool before i post something here. It is some scripts on the board, but not what i need.

Also insted to tell me about search tool will be more clever from u to link me there if u know it...but if u prefere just to say something on people posts.......he he be my guest....lol

Greetings to Greece  :))



Herodes

#3
there you go ...
--- Periodical PMs to unregs   	?   requested by witch
--- by Herodes 	?   13-8-2004

botsName = "SmartAss"				--- Change this to whatever u want
TxtFile = "unregfile.txt"				--- be sure to have a file corresponding to this one in the 'scripts' 
thecmd = "!pmunregs"				--- change this to whatever u want ...

secs = 1000
mins = 60*secs
timerinterval = 5*mins					--- I hope this is clear enough ... 

function Main()
	tUnregUsers = {n=0};				--- don't touch this one ...
	frmHub:UnregBot(botsName)				--- Unreg the Bot from the NickList, ( using the string defined by the ' botsName ' value )
	frmHub:RegBot(botsName)				--- and Register it again ... ( using the string defined by the ' botsName ' value, again )
	SetTimer(timerinterval)
	StartTimer()
end

function OnTimer()
for index, nick in tUnregUsers do
	SendPmToNick(nick, botsName, ReadTextFile(TxtFile))
end
end

function NewUserConnected(user)
	if user.iProfile == -1 then
		tinsert(tUnregUsers, (getn(tUnregUsers)+1), user.sName)
	end
end

function UserDiconnected(user)
	if user.sName == tUnregUsers then 
		tremove(tUnregUsers, user.sName)
	end
end

function DataArrival(user, data)
if ( ( strsub(data, 1, 1) == "<" ) and user.bOperator )then
	data = strsub(data,1,strlen(data)-1)
	local s,e,cmd = strfind( data, "%b<>%s+(%S+)" )
	if ( cmd == thecmd ) then
		if getn(tUnregUsers) >= 25 then
			user:SendPM(botsName, getn(tUnregUsers).." users have been notified.")
		else 
			user:SendPM(botsName, "The following users have been notified : ")
			for i = 1, getn(tUnregUsers) do
				user:SendPM(botsName, "\t"..tUnregUsers[i])
			end
		end
		for index, nick in tUnregUsers do
			if nick == user.sName then 
			else 	SendPmToNick(nick, botsName, ReadTextFile(TxtFile))
			end
		end
	end
end
end

function ReadTextFile(file)
local message = "\r\n"
readfrom(file, "r")
while 1 do
local 	line = read()
	if ( line == nil ) then break
	else message = message.."\t"..line.."\r\n"
	end
end
readfrom()	
return message
end

Next time dont be a smartass (first time)... I found 1 of my scripts in this forum, in this section  and all I changed was 10 lines ...

You have been here for a while and instead of being a smartass (second time) you could have spend some thinking like everybody else in this forum ...

Greetings received and returned :)

PS: Ooh and it is definately not about knowing how to write lua ... it is just thinking .. trust me..

witch

Syntax error: `end' expected (to close `if' at line 132);
  last token read: `elsemessage' at line 134 in file `D:\PtokaX\NEW\scripts\PMtoUnregs.lua'

Thanx in advince



Herodes

edited above post ... grab again should be ok now ...

witch

Works fine on timer dude! But on cmd shows report that only one user receeve massage...

why is that?



witch

DUDE!!!!!
I was too quick with answer....this script sends message in pm's to all users, unregs, regs. vip's even op's!!! That's sux man!!!! And i hope that was misstake... Please correct it!!!

Thanx



Herodes

No I wont ... sorry it didn't work out ... I got better things to do than waste my time with someone that doesn't talk nice to me ... :(

witch

well i was do my best be pation with u..... but as u wish Mr. Herodes



SMF spam blocked by CleanTalk