egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

posting from txt file

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Votex
Voice


Joined: 21 Jun 2014
Posts: 23

PostPosted: Sat May 09, 2015 1:52 pm    Post subject: posting from txt file Reply with quote

Hello there, could someone please help me making a tcl script that can post txt , urls from txt file that another app (corn job) will do on the same server

also i need the post be timed
like between each post and another will be like 3 mins or so.

also i want the this tcl to mark each txt or url the bot post to be like posted
and never posted it again .

if someone could help me with that, it would be great .
thank you . Very Happy
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Sat May 09, 2015 3:01 pm    Post subject: Reply with quote

See if you can get the file read to your channel with this script -> http://forum.egghelp.org/viewtopic.php?t=19179
Use one of the last 2 examples in that string, depending on your tcl version.
_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
Votex
Voice


Joined: 21 Jun 2014
Posts: 23

PostPosted: Sat May 09, 2015 3:31 pm    Post subject: Reply with quote

SpiKe^^ wrote:
See if you can get the file read to your channel with this script -> http://forum.egghelp.org/viewtopic.php?t=19179
Use one of the last 2 examples in that string, depending on your tcl version.


hello the script works like a charm , but i want it to read - without me typing !readfile more like auto read file with timer between each sentence and another , coloring maybe
like coloring the title - and the url each one with a different color
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Sat May 09, 2015 5:30 pm    Post subject: Reply with quote

Quote:
but i want it to read - without me typing !readfile more like auto read file with timer between each sentence
The script at or near the end of that forum string does that.
You must read the entire string as the script finished off with all the options discussed throughout the forum string..
Code:
# EditTextFile+TimedReadLine Version 1.0 #

 # author:  SpiKe^^ #
 # e-mail:  spike<at>mytclscripts<dot>com #
 # webpage: http://mytclscripts.com/ #

...and from the settings in that script.......
 
########### Timed Public Read Setting ###########

 # Set the channel(s) for the timed public read line #
 set eTxFile(tchan) {#yourchannel #anotherchannel #someotherchan}

 # Set number of minutes between each timed public read line #
 # Set this to "0" to disable all timed public read lines
 # Note: file errors will be sent to the first channel in eTxFile(tchan)
 set eTxFile(timed) "5"


Quote:
, coloring maybe
like coloring the title - and the url each one with a different color
You really need a functioning script before you worry about its darn colors
_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
Votex
Voice


Joined: 21 Jun 2014
Posts: 23

PostPosted: Sun May 10, 2015 2:30 pm    Post subject: Reply with quote

it works for me
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Sun May 10, 2015 3:21 pm    Post subject: Reply with quote

What about...
Votex wrote:
also i want the this tcl to mark each txt or url the bot post to be like posted
and never posted it again .
...and...
Votex wrote:
coloring maybe
like coloring the title - and the url each one with a different color


We can still modify the script to be more like what you were looking for.
Explain further what else this script may need.
Show an example of what the read file may look like and how the displayed lines should look.
_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
Votex
Voice


Joined: 21 Jun 2014
Posts: 23

PostPosted: Mon May 11, 2015 3:53 am    Post subject: Reply with quote

i want to create a txt file that content the following
title - url
i want the bot be auto post them
one line at a time , not mention never post a line never again as it will be mark as posted if it possible with the bot

also if its possible i want the script to be able to make a timer
between each sentence and another like 300 sec or so.

the out put in the channel should be like this
title - url
example : Ore Monogatari!! Mosaic - http://i.imgur.com/nDgEynW.jpg

Explain: Title -> Ore Monogatari!! Mosaic - Then url -> http://i.imgur.com/nDgEynW.jpg
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Mon May 11, 2015 10:17 pm    Post subject: TimedReadLinkFile Version 1.0 (11May2015) Reply with quote

Code:

# TimedReadLinkFile Version 1.0 (11May2015) #

# author:  SpiKe^^ #
# e-mail:  spike<at>mytclscripts<dot>com #
# webpage: http://mytclscripts.com/ #

# This file is Copyrighted under the GNU Public License. #
# http://www.gnu.org/copyleft/gpl.html #


########### Begin Script Settings ###########

# Set the full route & file name of the file to read from #
set trlf(file) {/usr/home/spike/eggdrop/scripts/filename.txt}

# Set the channel(s) for the timed public read link #
set trlf(chan) {#yourchannel #anotherchannel #someotherchan}

# Set number of minutes between each timed public read link #
set trlf(time) "5"


############ End Script Settings ############

set trlf(chan) [split [string tolower $trlf(chan)]]

if {![info exists trlf(runnin)]} {
  if {$trlf(time)>"3"} {  timer 3 [list trlfReadFile]
  } else {  timer $trlf(time) [list trlfReadFile]  }
  set trlf(runnin) 1
}

proc trlfReadFile {} {  global trlf
  timer $trlf(time) [list trlfReadFile]

  set fl $trlf(file)
  if {![file exists $fl]} {  return  }

  set ofl [open $fl "r"]
  set lines [read -nonewline $ofl]
  close $ofl
  set lines [split $lines "\n"]

  if {![llength $lines]} {  file delete -- $fl  ;  return  }

  set lines [lassign $lines next]

  if {[set idx [string last " - " $next]] < 1} {
    set next "\00305$next"
  } else {
    set title "\00305[string range $next 0 [incr idx -1]]\003 - "
    incr idx 4
    if {[string length $next] > $idx} {
      set url "\00313[string range $next $idx end]\003"
    } else {  set url ""  }
    set next ${title}${url}
  }

  foreach ch $trlf(chan) {  puthelp "PRIVMSG $ch :$next"  }

  if {![llength $lines]} {  file delete -- $fl  ;  return  }

  set ofl [open $fl "w"]
  puts $ofl [join $lines "\n"]
  close $ofl
  return
}

putlog "TimedReadLinkFile Ver. 1.0 by SpiKe^^ loaded."


_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
Votex
Voice


Joined: 21 Jun 2014
Posts: 23

PostPosted: Mon May 09, 2016 12:17 pm    Post subject: Reply with quote

sorry for my late late reply

the script is working just fine

but it reads the txt file all over again once i update it (the TXT file ) with new links.

so I‘m asking if its possible to do the following

- make the tcl script read each lines and never read it again ( Even if i update the txt file with new links )
- add !s command for searching in the txt file
example:
!s Ore Monogatari!! Mosaic
or
!s Ore
or even
!s any part of the title

then the bot will repost any results matching the key word or the acutal title i searched for using notice command

and give me the results like this

in Notice !s ( Ore Monogatari!! Mosaic - http://i.imgur.com/nDgEynW.jpg )
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber