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 

Read from .txt file...
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
DjBeNNeTT
Voice


Joined: 18 Feb 2006
Posts: 27
Location: Telford, Shropshire, UK

PostPosted: Sun Apr 23, 2006 1:16 pm    Post subject: Reply with quote

OMFG! lol. I'm blind.

Works perfect. Thanks Very Happy

Code:
set sex "scripts/sex.txt"

bind pub - !sex sex:msg

proc sex:msg {nick uhost hand chan arg} {
  global sex
  set sexmsg [string range [randomline $sex] 0 end]
  puthelp "privmsg $chan :[subst -nocommands $sexmsg]"
}

proc randomline f {
 set data [split [read [set file [open $f]]][close $file] \n]
 set position [rand [llength $data]]
 lindex $data $position
}

_________________
DjBeNNeTT

Kewlsounds Radio:
http://kewlsounds.com
irc://irc.quakenet.org/#kewlsounds
Back to top
View user's profile Send private message Visit poster's website
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Sun Apr 23, 2006 5:52 pm    Post subject: Reply with quote

Sir_Fz wrote:
Try Notepad++.

Both Wordpad and Word add invisible controls at the end of each carriage return and therefore Tcl code generated with either are prone to error generation/mis-reading. Text editors that leave scripts in Unix format are error free.
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
DjBeNNeTT
Voice


Joined: 18 Feb 2006
Posts: 27
Location: Telford, Shropshire, UK

PostPosted: Sun Apr 23, 2006 6:32 pm    Post subject: Reply with quote

Weird, i've never experianced a problem with wordpad.
I know that Notepad shows the squares for the next line command thingy.. (lol). Where in wordpad it converts it so that it is a next line, but when i save it, it seems perfectly happy.
_________________
DjBeNNeTT

Kewlsounds Radio:
http://kewlsounds.com
irc://irc.quakenet.org/#kewlsounds
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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