message displayed in box under chat
 

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

message displayed in box under chat

Started by dkt, 19 May, 2005, 19:23:16

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dkt

i want a script to display message in box under chat

Dessamator

a message in a box under chat????, could u explain better?
Ignorance is Bliss.

dkt

QuoteOriginally posted by Dessamator
a message in a box under chat????, could u explain better?

hey m8,
box under chat means the box below where you type in hub
or
where it is written "Stored password sent.."

Dessamator

#3
QuoteOriginally posted by dkt
QuoteOriginally posted by Dessamator
a message in a box under chat????, could u explain better?

hey m8,
box under chat means the box below where you type in hub
or
where it is written "Stored password sent.."

hmm, so u want a simple script that sendsa msg  in something shaped like a box?
Ignorance is Bliss.

Tw?sT?d-d?v

I think dkt means a script that displays a message where the kick messages get displayed(just under the main chat)

jiten

QuoteOriginally posted by (uk)jay
I think dkt means a script that displays a message where the kick messages get displayed(just under the main chat)
Indeed :D

NightLitch

He wants the message to be displayed in the StatusBar under the ChatLine.

I think it can not be done...

//NL
//NL

bastya_elvtars

QuoteOriginally posted by NightLitch
He wants the message to be displayed in the StatusBar under the ChatLine.

I think it can not be done...

//NL

Only if 'Filter kick...' is on, and it should be a RAW like "*** anything"
Everything could have been anything else and it would have just as much meaning.

uffetjur

Status field in dc based klients - earlier used by flooders
Somewhere in Cyberspace

Dessamator

well, in theory it can be done, although all messages will include for eg."x is kicking x because: happy birthday", :), either way thats a client thing , cant be scripted without adding that kicking msg !!
Ignorance is Bliss.

dkt

QuoteOriginally posted by (uk)jay
I think dkt means a script that displays a message where the kick messages get displayed(just under the main chat)

yeah  right  m8

dkt

QuoteOriginally posted by NightLitch
He wants the message to be displayed in the StatusBar under the ChatLine.

I think it can not be done...

//NL

it can be done m8....
just check out the chatter bot 1.3....
theres an option to display in box under hub chat..
but it gives this error
Syntax cannot read lines.tbl: No such file or directory

i have seen this in a hub...i asked the owner of tat hub ...which script is tat ..he said chatter bot 1.2..i searched here on forums for chatter bot 1.2..but didnt found..if any1 founds here pls inform me...u know guys even the current date  day and time is also displayed and also ur edited messages are displayed....

Dessamator

hmmm, maybe hes right on my dc++, it has an option to filter nmdc debug msgs, and kick msgs, maybe if we can emulate an nmdc debug msg, it might work !, then again i might be wrong, some clients other might not do that :)
Ignorance is Bliss.

Dessamator

#13
--By Dessamator
--" Box Msg" sender v1
--Idea from Chatterbot
--request by dkt

bot=frmHub:GetHubBotName() --bots name

function ChatArrival(user,data)
data= string.sub(data,1,string.len(data)-1)
s,e,cmd,msg = string.find(data,"%b<>%s+(%S+)%s+(.*)")
	if msg then
		if cmd =="!sendmsg" and string.len(msg)<120 then
			SendToAll("\t"..msg..string.rep("\t",11).." is kicking because:")
		return 1
		elseif string.len(msg)>120 then
			user:SendData(bot,"Message too long !")              
		return 1
		end
	
	end
end


Done!
"Theory becomes reality", :)
Ignorance is Bliss.

dkt

QuoteOriginally posted by Dessamator
--By Dessamator
--" Box Msg" sender v1
--Idea from Chatterbot
--request by dkt

bot=frmHub:GetHubBotName() --bots name

function ChatArrival(user,data)
data= string.sub(data,1,string.len(data)-1)
s,e,cmd,msg = string.find(data,"%b<>%s+(%S+)%s+(%S+)")
	if msg then
		if cmd =="!sendmsg" and string.len(msg)<120 then
			SendToAll("\t"..msg..string.rep("\t",11).." is kicking because:")
		return 1
		elseif string.len(msg)>120 then
			user:SendData(bot,"Message too long !")               return 1
		end
	
	end
end


Done!
"Theory becomes reality", :)

good one !! working fine !!
but if u type !sendmsg welcome to dkt's hub,  thn it shows only welcome..i mean the only the first word is shown..

i want this script to show as many lines u want stored or saved somewhere to be displayed under hub chat box at regular intervals ( say one minute ).
is it possible ?

Dessamator

hmm, first bug fixed, now u want to send one line at a time, at regular interval, or randomly?
Ignorance is Bliss.

dkt

QuoteOriginally posted by Dessamator
hmm, first bug fixed, now u want to send one line at a time, at regular interval, or randomly?

one line at a time at regular intervals ( for e.g. one minute )

Dessamator

#17
--By Dessamator
--"Box Msg" sender v1.2
--Idea from Chatterbot
--request by dkt

tLines = {n=0}

--Config
bot=frmHub:GetHubBotName() 	--bots name
Filename = "boxmsgs.txt"	-- enter filename
Time = 10 			-- enter time in minutes
TimerOn     =false			-- true to send box msg at intervals
--

function Main()
local file=io.open(Filename,"r")
	if not(file) then
		io.output(Filename)
		io.close()
		io.output()
	end
	if TimerOn then 
		SetTimer(60000*Time)
		StartTimer()	
	end
end

function ChatArrival(user,data)
data= string.sub(data,1,string.len(data)-1)
s,e,cmd,msg = string.find(data,"%b<>%s+(%S+)%s+(.*)")
	if msg then
		if cmd =="!sendmsg" and string.len(msg)<120 then
			SendToAll("\t"..msg..string.rep("\t",11).." is kicking because:")
		return 1
		elseif cmd == "!addboxmsg"  then
			addline(Filename, msg)
			user:SendData(bot,"Done ,added box msg!")
			return 1
		elseif string.len(msg)>120 then
			user:SendData(bot,"Message too long !")              
		return 1
		end
	
	end
end

function OnTimer()
	GetLines(Filename)
	for pos,line in tLines do
		if tonumber(pos) and line and i then
			if tonumber(pos)<=i then
			temp=line
			end
		elseif not(i) or i==table.getn(tLines) then
			i=1
		end

	end
	if temp then
		i=i+1
		SendToAll("\t"..temp..string.rep("\t",11).." is kicking because:")
	end
end


function GetLines(filename)
tLines =nil
tLines = {n=0}
local file = io.open(filename, "r")
	for line in file:lines() do
		table.insert(tLines, line)
	end
		file:close()
end

function addline(filename,msg)
	local file = io.open(filename, "a+")
	file:write("\n"..msg)
	file:close()
end


Done !
Ignorance is Bliss.

dkt

thanks m8..all working fine...gr8 job man !! keep it up :)

Dessamator

ur  welcome ! :]
Ignorance is Bliss.

(NL)waarom

get this error
!sendmsg works
Syntax cannot read lines.tbl: No such file or directory

Dessamator

#21
hmm, i dont get that error, when does it happen, did u use any command? and theres no line.tbl in my script , so i assume u renamed the

Filename = "boxmsgs.txt"


i need more info to be able to solve it, btw try copying it again,im quite sure u copied an older version of the script,or u messed with something in it-

 the script creates the file at start, and thus that should never happen , anyways if copying it again fails, try posting ur modded script here!
Ignorance is Bliss.

Cêñoßy†ê

-- Chatterbot 1.2 [Mod from Mutors Random chatter]
Bot = "????Chatter????"           -- Name for bot -- 
cMenu = "?~Chatter~?"         -- RightClick menu name -- 
Where = 2                     -- Where you want messages go      2=topic  1=main 0=box under chat                      
Mins = 10                     -- Interval [in minutes] between messages          
CommOn = "!advon"             -- Command for Start the script       
CommOff = "!advoff"           -- Command for Stop the script       
StartOn = "0"            -- Start script on start             1=on 0=off 
SendComm = 1                  -- RightClick commands on/off        1=on  0=off 
Version = "1.2" 

SetTo = { 
 [0] = 1,   -- Masters          -- Give right click commands         1=yes 0=no 
 [1] = 1,   -- Operators        -- Give right click commands         1=yes 0=no 
 [4] = 1,   -- Moderator        -- Give right click commands         1=yes 0=no 
 [5] = 1,   -- NetFounder       -- Give right click commands         1=yes 0=no 
} 
local tmp = os.clock() 
   local days, hours, minutes = math.floor(tmp/86400), math.floor(math.mod(tmp/3600, 24)), math.floor(math.mod(tmp/60, 60)) 


Lines = { 
"Check our network forum at [URL]http://knightvision.no-ip.org[/URL]", 
"This hub is member of ?-=[K?igh?Visio?.::.?e?WorX]=-?", 
"We currently have "..string.format("%.2f TB",frmHub:GetCurrentShareAmount()/(1024 * 1024 * 1024 * 1024)).." of stuff here.", 
"Powered With PtokaX DC Hub 0.3.3.0 build 16.09a with Lua 5.02", 
""..frmHub:GetUsersCount().." of "..frmHub:GetMaxUsers().." maximum users connected", 
"Today is "..os.date("%A %d %B %Y ").."", 
"My uptime is now "..days.." Days "..hours.." Hours and "..minutes.." Minutes", 
"This Hub is running with Robocop 10.01c - Made by Optimus", 
"You can add your friends with command !regop  ", 
"Our user record is "..frmHub:GetMaxUsersPeak().." users", 
"Hi.. im ChatterBot V:"..Version.." made by C??o?y??", 
} 

function NewUserConnected(user) 
SendToAll(MyInfoString) 
   if SendComm == 1 and SetTo[user.iProfile] == 1 then 
      user:SendData("$UserCommand 1 3 "..cMenu.."\\?~Chatter bot v"..Version.."~?$<%[mynick]> "..CommOn.."||") 
      user:SendData("$UserCommand 1 3 "..cMenu.."\\Turn chatter on$<%[mynick]> "..CommOn.."||") 
      user:SendData("$UserCommand 1 3 "..cMenu.."\\Turn chatter off$<%[mynick]> "..CommOff.."||") 
      user:SendData("$UserCommand 1 3 "..cMenu.."\\Bot version$<%[mynick]> !cvers||") 
   end 
end 

OpConnected = NewUserConnected 

function Main() 
   SetTimer(Mins*60000) 
   if StartOn == "1" then 
      StartTimer() 
   end 
end 

function ChatArrival(user, data) 
   s,e,cmd = string.find(data, "%b<>%s+(%S+)(%S+)") 
   if (cmd==CommOn) and user.bOperator then 
      user:SendData(Bot," Started ??  Messages will be shown in every "..Mins.." minute/s.  Type '"..CommOff.."' to stop me.") 
      StartTimer() 
   return 1 
   elseif (cmd==CommOff) and user.bOperator then 
      StopTimer()    
      user:SendData(Bot," Stopped ??  Type "..CommOn.." to start me again.") 
   return 1 
        elseif (cmd=="!cvers") and user.bOperator then 
          user:SendData(Bot,"hello i am ChatterBot v: "..Version.." made by C??o?y??") 
        return 1 
   end 
end 

function OnTimer() 
   local RandomChat = Lines[math.random(1, table.getn(Lines))] 
if Where==1 then 
      SendToAll(Bot,"\n\r\n\t"..RandomChat.."\r\n") 
elseif Where==2 then 
      frmHub:SetHubTopic(RandomChat) 
elseif Where==0 then 
      SendToAll("\t"..RandomChat.."\t\t\t\t\t\t\t\t\t\t\t is kicking because:") 
end 
end
Powered By Leviathan™ 2nd Generation v. 1.9

SMF spam blocked by CleanTalk