mass 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

mass message

Started by antobach, 24 June, 2006, 10:57:24

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

antobach

esiste uno script che invia un determinato file txt a tempo..?????? e uno script che ricerca tutti i film musica ecc ecc nel propio hub? grazie a tutti.

6Marilyn6Manson6

Quote from: antobach on 24 June, 2006, 10:57:24
esiste uno script che invia un determinato file txt a tempo..?????? e uno script che ricerca tutti i film musica ecc ecc nel propio hub? grazie a tutti.

Anto qui richiedi gli script in inglese perk? ( penso ) sono l'unico italiano qui :)
Anto request your script in english please because ( I think ) I'm only italian here :)

6Marilyn6Manson6

--- File in PM by 6Marilyn6Manson6 23/10/2005

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

secs = 1000 
mins = 60*secs

function Main() 
	frmHub:RegBot(botsName)--- and Register it again ... ( using the string defined by the ' botsName ' value, again ) 
end 

function ChatArrival( user, data) 
	if user.bOperator then
		data = string.sub(data,1,-2) 
		local s,e,cmd = string.find( data, "%b<>%s+(%S+)" ) 
		if (cmd == thecmd) then 
			SendEm()
		end
	end
end
 
function SendEm()
	local sText = ReadTextFile(TxtFile) 
	for i, user in frmHub:GetOnlineUsers() do 
		if user.iProfile == -1 then
			user:SendPM(botsName, sText)
		end
	end
end

function ReadTextFile(file) 
	local f=io.open(file, "r");
	if f then local m=f:read("*all");f:close;return m;end;
	return "file isn't there";
end
--// 6Marilyn6Manson6

antobach

Lo so 6Marilyn6Manson6 ma non saprei dove altro cercare..... cmq sei gentilissimo grazie.

antobach

[12:54] Syntax C:\Documents and Settings\user\Desktop\ptokax\scripts\invia file.lua:35: function arguments expected near `;'
Quote



mi da questo errore cosa vuol dire?

CrazyGuy

try replacing

function SendEm()
	local sText = ReadTextFile(TxtFile) 
	for i, user in frmHub:GetOnlineUsers() do 
		if user.iProfile == -1 then
			user:SendPM(botsName, sText)
		end
	end
end

function ReadTextFile(file) 
	local f=io.open(file, "r");
	if f then local m=f:read("*all");f:close;return m;end;
	return "file isn't there";
end


with

function SendEm()
	local sText = ReadTextFile(TxtFile) 
	if sText ~= nil then
		for i, user in frmHub:GetOnlineUsers() do 
			if user.iProfile == -1 then
				user:SendPM(botsName, sText)
			end
		end
	end
end

function ReadTextFile(file) 
	local f=io.open(file, "r")
	if f ~= nil then
		local m=f:read("*all")
		f:close()
		return m
	else
		return nil
	end
end


antobach


6Marilyn6Manson6

Quote from: antobach on 24 June, 2006, 15:50:56
nada nn funge. >:(

Che versione del PtokaX usi?
What's PtokaX version you use?

antobach

l'ultima 0.3.5.0.lua5.0.2.dbg.

Thor

Here is an another version: rewritten txt_show by bastya elvtars. I don't really know, what antobach request.... Maybe this:
folder = frmHub:GetPtokaXLocation().."scripts/massmessages/"

function ChatArrival(curUser,data)
	data = string.sub(data,1,-2)
	local _,_,cmd,file = string.find(data,"%b<>%s+(%S+)%s*(%S*)")
	if cmd == "!loadfile" and curUser.bOperator then
		local f=io.open(folder..file..".txt","r")
		local Botname = frmHub:GetHubBotName()
		if f then
			local contents = string.gsub(f:read("*a"),string.char(10), "\r\n")
			for i,v in frmHub:GetOnlineUsers(-1) do
				v:SendPM(Botname,"\r\n"..contents.."\r\n")
			end
			f:close()
		else
			curUser:SendData(Botname,"There is no file "..file.." on the "..folder.." folder!")
		end
		return 1
	end
end

antobach

So che non mi capite ma vi ringrazio lo stesso... rimane il fatto che a tutto questo non ho capito un tubo.... :'(
Dove devo inserirre tutti sti script....

antobach

6Marilyn6Manson6 tu che mi capisci riesci a mettermi insieme tutto questo io in realt? non ho capito un tubo di niente... grazie....

6Marilyn6Manson6

Quote from: antobach on 24 June, 2006, 18:23:15
6Marilyn6Manson6 tu che mi capisci riesci a mettermi insieme tutto questo io in realt? non ho capito un tubo di niente... grazie....

Dentro la cartella scripts del PtokaX ci metti questo script creato da Hungarista. Dopodich? sempre dentro la cartella scripts crei una cartella di nome   massmessages   e ci metti dentro il tuo file TXT che intendi caricare... fallo a hub chiuso, e con il comando   !loadfile   puoi vedere il file TXT... Scusa se oggi son scappato ma era successa una piccola urgenza ^^

antobach

grazie gentilissimo come sempre... adesso provo... .. ehehehe ti far? sapere.

antobach

bho sar? stupido io non saprei ma non fa nulla e al comando !loadfile mi dice "There is no file  on the C:/Documents and Settings/user/Desktop/ptokax/scripts/massmessages/ folder!" Ma e impossibile perch? dentro la cartella massmessages ho messo un file txt di tutti i film ma lui non la trova... vacci a capire...

antobach

C iao 6Marilyn6Manson6 volevo dirti che il bot di Hungarista NON FUNZIONA e poi ho notato che non ? un bot a tempo ma a comando, L'ho provato anche sulla versione del ptokax 0.3.4.0 e non funge lo stesso...
non esiste altri script in merito? grazie.

antobach

Hello 6Marilyn6Manson6 I wanted dirti that the bot of Hungarista IT DOES NOT WORK and then I have noticed that is not a bot to time but to commando, I have tried It also on the version of ptokax the 0.3.4.0 and does not act as the same one... does not exist other scripts in merit? thanks


PS:excused to painful English and but use a translator... ehehehe

6Marilyn6Manson6

Prova questo:

-- txtlist.lua 
--
--  script to (auto)update inbuild txtfiles commands 
--  and show the list of commands to users
--  ( shows files only if you have txtxfiles enabled in PtokaX gui )
-- UwV

bot = frmHub:GetHubBotName()
prefix = "!"    --set the prefix for your hub here
command = "!txtlist"   -- command icluding prefix
autoupdate = "yes"		-- enable auto updating  "yes" = yes anything else is no
timerinterval  = 60   -- update dirlist.txt  every in minutes

function ChatArrival(user, data)
	local s,e,cmd = string.find(data, "^%b<>%s+(%S+)|")
	if cmd == command then
		user = user.sName 
		ShowList(user)
		return 1
	end
end

dir = frmHub:GetPtokaXLocation().."texts/"
file = "txtfiles.dsn"

function ShowList(user)
	local handle = io.open( file, "r" )
	local t = {}
	local tosend = "Well "..user.." here you go then,..\r\n\r\n           ---------- Your Available .txt Commands ---------\r\n"
	for line in handle:lines() do
		if string.find ( line,"^(%S+)%.txt$" ) then
			local _,_,filename = string.find( line,"^([^%.]+)" )
			t[filename] = line
			tosend = tosend.."            "..prefix..""..filename.."\t\t ( "..line.." )\r\n"
		end
	end
	handle:close()
	tosend = tosend.."\r\n           ----------  Please Use them "..user.."   ---------\r\n"
	SendPmToNick(user, bot, tosend  )
end

function OnTimer()
	os.execute("dir \""..dir.."\" /A-D-S-H /B /O:N > "..file.."")		-- show no Dir's,  no System and no Hidden files in Bare format Ordered by Name
end

function Main()
	if autoupdate  == "yes" then
		SetTimer(60000 * timerinterval)
		StartTimer()
	end
	OnTimer()  -- do timer function once anyway to make our file
end


Metti il tuo file TXT dentro la cartella texts del PtokaX e prova se funziona

6Marilyn6Manson6

Oppure provi questo:

-- Txtshow by bastya_elvtars
-- At preconfigured times it shows a text file.

Botname="Texter"

HubAD=
 {
   ["18:00"]="blabla.txt",
   ["22:33"]="thx.txt",
   ["01:21"]="ReadMe.txt",
 }
--[[["HH:MM"]="filename.txt",

Can even be 18:33 if this is your perversion :)
Does not have to be a textfile reachable by command as well. :)
A textfile can be bound to any number of timestamps.
Just comment a line if you do not need it any longer, or rename the file to a non-existant.
Or, delete the file (if a file does not exist, there are gonna be no errors).
]]  

-- The folder where your text files reside
-- Warning: NOT \ but /
folder="I:/!!!px2!!!"

-- // Don't edit below.

Timer=0

function OnTimer()
 local now=os.date("%H:%M")
 if Timer~=60 then
   Timer=Timer+1
 else
   if HubAD[now] then
	local f=io.open(folder.."/"..HubAD[now],"r")
	if f then
	local contents = string.gsub(f:read("*a"),string.char(10), "\r\n")
	SendToAll(Botname,"\r\n"..contents.."\r\n")
	 f:close()
	end
   end
   Timer=0
 end
end

function Main()
 SetTimer(1000)
 StartTimer()
end

antobach

Boys of Nothing not anybody of it goes of of it... not the I succeed a to send not txt of file in not time of determined, thanks for the devoted time I hope me that you will resolve... also of you excuse for the bad English but I use not the translator.
Grazie 6Marilyn6Manson6 ma vedi se ne trovi uno che funge....  :'(

SMF spam blocked by CleanTalk