why doesnt this send as PM when set?
 

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

why doesnt this send as PM when set?

Started by Psycho_Chihuahua, 28 September, 2004, 00:22:15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Psycho_Chihuahua

Hi there, i got this Hub AD Timer script from Mutor (i think)....

well i did some adjustment as you see and i've been trying to get it to be able to send the tmp data as a PM as well instead of just in mainchat...

well it sends a privat message to nick atm but in mainchat.... what did i muck up here?

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 Zeit: \t( "..date("%H:%M").." ) -- "..TZone .."\r\n"
		tmp = tmp.."\tHub Desc: \t"..frmHub:GetHubDescr().."\r\n" 
		tmp = tmp.."\tUmleite Nach: \t"..frmHub:GetRedirectAddress().."\r\n"
		tmp = tmp.."\tReg Server: \t"..frmHub:GetRegServer().."\r\n"  
		tmp = tmp.."\tRedirect Alle: \t"..RedirAll().."\r\n" 
		tmp = tmp.."\tRedirect Voll: \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\t"..CountMaster().."\r\n" 
		tmp = tmp.."\tOps Online: \t\t"..CountOPs().."\r\n" 
		tmp = tmp.."\tVips Online: \t\t"..CountVIPs().."\r\n"
		tmp = tmp.."\tRegs Online: \t\t"..CountRegUsers().."\r\n"
		tmp = tmp.."\t---<>-------------------------------------------------------------------------------------<>---\r\n" 
		tmp = tmp.."\tTotal Online: \t\t"..frmHub:GetUsersCount().."\r\n" 
		tmp = tmp.."\t---<>-------------------------------------------------------------------------------------<>---\r\n" 
		tmp = tmp.."\tInfo(s):\r\n"
		tmp = tmp.."\t-- "..HubMsg1.."\r\n"
		tmp = tmp.."\t-- "..HubMsg2.."\r\n"
		tmp = tmp.."\t-- "..HubMsg3.."\r\n"
		tmp = tmp.."\t-- "..HubMsg4.."\r\n"
		tmp = tmp.."\t---<>-------------------------------------------------------------------------------------<>---\r\n" 
		if SendToMain==0 then
		SendPmToAll(bot,tmp) else
		SendToAll(bot,tmp)
end
end
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

bastya_elvtars

Do not forget 2 reister the bot for real PM:

function Main()
frmHub:RegBot(bot)
end
Everything could have been anything else and it would have just as much meaning.

Psycho_Chihuahua

#2
QuoteOriginally posted by bastya_elvtars
Do not forget 2 reister the bot for real PM:

function Main()
frmHub:RegBot(bot)
end

Duh'

Oh Shit ur right  :D  thnx Bastya didnt even think o that

**Edit**

still sends the PM in Main

Script
--AdTimer 1.0
--
--by Mutor
--
--Yet another Hub Advert script
--Sends hub Advert on timer or by command
--
--
assert(dofile("Werbung/Settings.cfg"),"settings file error")

function Main()
frmHub:RegBot(bot)
end

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 Zeit: \t( "..date("%H:%M").." ) -- "..TZone .."\r\n"
		tmp = tmp.."\tHub Desc: \t"..frmHub:GetHubDescr().."\r\n" 
		tmp = tmp.."\tUmleite Nach: \t"..frmHub:GetRedirectAddress().."\r\n"
		tmp = tmp.."\tReg Server: \t"..frmHub:GetRegServer().."\r\n"  
		tmp = tmp.."\tRedirect Alle: \t"..RedirAll().."\r\n" 
		tmp = tmp.."\tRedirect Voll: \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\t"..CountMaster().."\r\n" 
		tmp = tmp.."\tOps Online: \t\t"..CountOPs().."\r\n" 
		tmp = tmp.."\tVips Online: \t\t"..CountVIPs().."\r\n"
		tmp = tmp.."\tRegs Online: \t\t"..CountRegUsers().."\r\n"
		tmp = tmp.."\t---<>-------------------------------------------------------------------------------------<>---\r\n" 
		tmp = tmp.."\tTotal Online: \t\t"..frmHub:GetUsersCount().."\r\n" 
		tmp = tmp.."\t---<>-------------------------------------------------------------------------------------<>---\r\n" 
		tmp = tmp.."\tInfo(s):\r\n"
		tmp = tmp.."\t-- "..HubMsg1.."\r\n"
		tmp = tmp.."\t-- "..HubMsg2.."\r\n"
		tmp = tmp.."\t-- "..HubMsg3.."\r\n"
		tmp = tmp.."\t-- "..HubMsg4.."\r\n"
		tmp = tmp.."\t---<>-------------------------------------------------------------------------------------<>---\r\n" 
		if SendToMain==0 then
		SendPmToAll(bot,tmp) else
		SendToAll(bot,tmp)
end
end

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

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

function CountMaster() 
	local tmp, count = GetUsersByProfile(GetProfileName(0)), 0;
	if tmp then
		for id = 0, getn(tmp) do
			if GetItemByName(tmp[id]) then
				count = count + 1;
			end
		end 
	end
	return count
end 

function CountOPs() 
	local tmp, count = GetUsersByProfile(GetProfileName(1)), 0;
	if tmp then
		for id = 0, getn(tmp) do
			if GetItemByName(tmp[id]) then
				count = count + 1;
			end
		end 
	end
	return count
end 
function CountVIPs() 
	local tmp, count = GetUsersByProfile(GetProfileName(2)), 0;
	if tmp then
		for id = 0, getn(tmp) do
			if GetItemByName(tmp[id]) then
				count = count + 1;
			end
		end 
	end
	return count
end 
function CountRegUsers() 
	local tmp, count = GetUsersByProfile(GetProfileName(3)), 0;
	if tmp then
		for id = 0, getn(tmp) do
			if GetItemByName(tmp[id]) then
				count = count + 1;
			end
		end 
	end
	return count
end

and settings
--User Settings-------------------------------------------------------------------------------------
bot = "HubInfo"						-- Name des bots
mins = 180 						-- Interval [in minuten] zwischen Ads
Hubaddy = "helvetia.ath.cx" 				-- Doh?
HubOwner = "Johnnie"					-- Doh?
Prefix = "+"					-- Prefix f?r den Befehl
AdComm = "werbung"						-- Befehl um Ad direkt zu senden
TZone = " +1 GMT [EST]"					-- Zeit Zone des hubs
SendToMain = 0						--Im Main senden [wenn 0 dann als PM]
HubMsg1 = "Hilfe rund um DC++ und Hubsoft gibts in diesen Foren"		-- Helft mit die Foren zu unterst?tzen 
HubMsg2 = "Auf Deutsch	--> [URL]http://www.dc-stammtisch.de[/URL]"			-- Helft mit - anderen zu Helfen
HubMsg3 = "Auf Englisch	--> [URL]http://board.univ-angers.fr[/URL]"				-- Helft mit die Foren zu unterst?tzen
HubMsg4 = "Auf Englisch	--> [URL]http://lua.uknnet.com/[/URL]"				-- Helft mit - anderen zu Helfen
--End User Settings----------------------------------------------------------------------------------

I dont know what could be wrong
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

bastya_elvtars

   --AdTimer 1.0
    -- 
    --by Mutor
    -- 
    --Yet another Hub Advert script
    --Sends hub Advert on timer or by command
    -- 
    -- 
    assert(dofile("Werbung/Settings.cfg"),"settings file error")



    function Main()
    frmHub:RegBot(bot)
    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 Zeit: \t( "..date("%H:%M").." ) -- "..TZone .."\r\n"
    tmp = tmp.."\tHub Desc: \t"..frmHub:GetHubDescr().."\r\n"
    tmp = tmp.."\tUmleite Nach: \t"..frmHub:GetRedirectAddress().."\r\n"
    tmp = tmp.."\tReg Server: \t"..frmHub:GetRegServer().."\r\n"
    tmp = tmp.."\tRedirect Alle: \t"..RedirAll().."\r\n"
    tmp = tmp.."\tRedirect Voll: \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\t"..CountMaster().."\r\n"
    tmp = tmp.."\tOps Online: \t\t"..CountOPs().."\r\n"
    tmp = tmp.."\tVips Online: \t\t"..CountVIPs().."\r\n"
    tmp = tmp.."\tRegs Online: \t\t"..CountRegUsers().."\r\n"
    tmp = tmp.."\t---<>-------------------------------------------------------------------------------------<>---\r\n"
    tmp = tmp.."\tTotal Online: \t\t"..frmHub:GetUsersCount().."\r\n"
    tmp = tmp.."\t---<>-------------------------------------------------------------------------------------<>---\r\n"
    tmp = tmp.."\tInfo(s):\r\n"
    tmp = tmp.."\t-- "..HubMsg1.."\r\n"
    tmp = tmp.."\t-- "..HubMsg2.."\r\n"
    tmp = tmp.."\t-- "..HubMsg3.."\r\n"
    tmp = tmp.."\t-- "..HubMsg4.."\r\n"
    tmp = tmp.."\t---<>-------------------------------------------------------------------------------------<>---\r\n"
    if SendToMain==0 then
	SendPmToAll(bot,tmp)
    else
	SendToAll(bot,tmp)
    end
end

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

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

    function CountMaster()
    local tmp, count = GetUsersByProfile(GetProfileName(0)), 0;
    if tmp then
    for id = 0, getn(tmp) do
    if GetItemByName(tmp[id]) then
    count = count + 1;
    end
    end
    end
    return count
    end

    function CountOPs()
    local tmp, count = GetUsersByProfile(GetProfileName(1)), 0;
    if tmp then
    for id = 0, getn(tmp) do
    if GetItemByName(tmp[id]) then
    count = count + 1;
    end
    end
    end
    return count
    end
    function CountVIPs()
    local tmp, count = GetUsersByProfile(GetProfileName(2)), 0;
    if tmp then
    for id = 0, getn(tmp) do
    if GetItemByName(tmp[id]) then
    count = count + 1;
    end
    end
    end
    return count
    end
    function CountRegUsers()
    local tmp, count = GetUsersByProfile(GetProfileName(3)), 0;
    if tmp then
    for id = 0, getn(tmp) do
    if GetItemByName(tmp[id]) then
    count = count + 1;
    end
    end
    end
    return count
    end



and settings

code:

    --User Settings-------------------------------------------------------------------------------------
    bot = "HubInfo" -- Name des bots
    mins = 180 -- Interval [in minuten] zwischen Ads
    Hubaddy = "helvetia.ath.cx" -- Doh?
    HubOwner = "Johnnie" -- Doh?
    Prefix = "+" -- Prefix f?r den Befehl
    AdComm = "werbung" -- Befehl um Ad direkt zu senden
    TZone = " +1 GMT [EST]" -- Zeit Zone des hubs
    SendToMain = 0 --Im Main senden [wenn 0 dann als PM]
    HubMsg1 = "Hilfe rund um DC++ und Hubsoft gibts in diesen Foren" -- Helft mit die Foren zu unterst?tzen
    HubMsg2 = "Auf Deutsch --> [URL]http://www.dc-stammtisch.de[/URL]" -- Helft mit - anderen zu Helfen
    HubMsg3 = "Auf Englisch --> [URL]http://board.univ-angers.fr[/URL]" -- Helft mit die Foren zu unterst?tzen
    HubMsg4 = "Auf Englisch --> [URL]http://lua.uknnet.com/[/URL]" -- Helft mit - anderen zu Helfen
    --End User Settings----------------------------------------------------------------------------------
Everything could have been anything else and it would have just as much meaning.

Psycho_Chihuahua

Thnx a lot M8

that was a real quick answer  :D
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

SMF spam blocked by CleanTalk