courtesy
 

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

courtesy

Started by ignazio, 28 May, 2005, 23:10:25

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ignazio

hi boys and possible to realize a writing that you send a massage to an user as soon as it enters to the hub and even a message written in txt ???

Psycho_Chihuahua

why not use the motd? It triggers on Hub Entry and is read from a file  :D
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

ignazio

hi Psycho_Chihuahua to the raggiones however me already use the mod mene serves one in more  :D

TTB

There is already such a script... Don't know the link, so posted the script:

-- offlinemsg.lua, created by amutex 11.01.2003
-- converted to LUA 5 by jiten
-- thanks to dessamator for the rightclick hint :]
-- thx to nathanos for the fine pm-parsing
-- bits and pieces added and deleted by bolamix over time, kudos to all scripters who helped!
-- attempted conversion to lua5 by bolamix Feb. 27 2005
-- successful conversion to lua5 by Jelf March 9 2005
-- usage: send a PM to the bot with   

path = "messages" -- name of the folder where the message files will be stored
ext = ".msg" -- extension for the message files
command = "!mail"
botname = frmHub:GetHubBotName() -- or use whatever botname you want then uncomment the following 3 lines

--function Main()
--	frmHub:RegBot( botname )
--end

os.execute("mkdir ".."\""..string.gsub(path, "/", "\\").."\"")

function Get2Args(data)
	s,e,whoTo,from,cmd,arg,arg2 = string.find(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)%s+(%S+)%s+(.*)")
	return arg,arg2
end

function ToArrival(user, data)
	s,e,whoTo = string.find(data,"$To:%s+(%S+)")
	if (whoTo == botname) then
		s,e,whoTo,from,cmd = string.find(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)")
		if (cmd == command) then
			arg,arg2 = Get2Args(data)
			local f,e = io.open(path.."/"..arg..ext,"a+")
			if f then
				f:write(""..user.sName.." sent you this message on "..GetDate().." at "..GetTime().." : "..arg2)
				user:SendPM(botname,"Message stored. It will be sent to "..arg.." next time he/she logs in.")
				f:close()
			end
		end
	end
end

function NewUserConnected(curUser)
	UserCmds(curUser)
	local handle = io.open(path.."/"..curUser.sName ..ext,"r")
	if (handle ~= nil) then
		local line = handle:read() 
		curUser:SendPM("#Offline_Message", line)
		handle:close()
	 	os.remove(path.."/"..curUser.sName..ext)
	else
	end
end

OpConnected = NewUserConnected

function GetTime()
	h = os.date("%H")
	m = os.date("%M")
	Time = h..":"..m
	return Time
end

function GetDate()
	d = os.date("%d")
	mm = os.date("%m")
	y = os.date("%y")
	Date = mm.."/"..d.."/"..y
	return Date
end

function UserCmds(curUser)
curUser:SendData("$UserCommand 1 2 offline\\Offline Message$$To: "..botname.." From: %[mynick] $<%[mynick]> !mail %[line:Nick] %[line:Message]||")
end
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

SMF spam blocked by CleanTalk