This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

!freebie

Old posts that have not been replied to for several years.
Locked
User avatar
devilsoulblack
Halfop
Posts: 62
Joined: Wed Nov 19, 2003 9:18 pm
Location: Chile
Contact:

!freebie

Post by devilsoulblack »

any one have where download tcl script for !freebie when the user tipe in the channel !freebie the egg send text fron a txt list ?
---------
Add [SOLVED] to the thread title if your issue has been.
Search - FAQ
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

bind pub - !freebie my:freebie

proc my:freebie {nick uhost hand chan text} {
  set content [split [read [set f [open "freebie.txt" r]]][close $f] \n] 
  foreach line $content {
    putserv "PRIVMSG $nick :$line"
  }
}
Once the game is over, the king and the pawn go back in the same box.
P
PrImuZ

where put the txt

Post by PrImuZ »

where put the freebie.txt what section ?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

The freebie.txt file (you can change it's name if you want to but you must change in the tcl file too) in the eggdrop's "root" directory.
Once the game is over, the king and the pawn go back in the same box.
User avatar
devilsoulblack
Halfop
Posts: 62
Joined: Wed Nov 19, 2003 9:18 pm
Location: Chile
Contact:

Post by devilsoulblack »

caesar wrote:

Code: Select all

bind pub - !freebie my:freebie

proc my:freebie {nick uhost hand chan text} {
  set content [split [read [set f [open "freebie.txt" r]]][close $f] \n] 
  foreach line $content {
    putserv "PRIVMSG $nick :$line"
  }
}
the problem its when type !freebie the egg send all site to put in the freebie.txt the thin its only send one line to freebie.txt
---------
Add [SOLVED] to the thread title if your issue has been.
Search - FAQ
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

Code: Select all

proc randomline { file } {
  set fp [open $file r] 
  seek $fp 0 end 
  set len [tell $fp] 
  seek $fp [rand $len] 
  gets $fp partial 
  if {[gets $fp line] == -1} { 
    seek $fp 0 
    gets $fp line 
  } 
  return $line
  close $file
}
some old code someone in here provided once, dunno who it was...
H
Hansje

Post by Hansje »

GodOfSuicide wrote:

Code: Select all

proc randomline { file } {
  set fp [open $file r] 
  seek $fp 0 end 
  set len [tell $fp] 
  seek $fp [rand $len] 
  gets $fp partial 
  if {[gets $fp line] == -1} { 
    seek $fp 0 
    gets $fp line 
  } 
  return $line
  close $file
}
some old code someone in here provided once, dunno who it was...
thx m8, where do i have to put this in the script above ?
Locked