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.

looking for a script

Old posts that have not been replied to for several years.
Locked
i
infernal

looking for a script

Post by infernal »

someone knows where i can find a script that arrange trigger for me, but also can print .txt files, like: !help==>print help.txt
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

print = post to the channel or send it to a printer ?
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

Well,

I think he means print = read from file (print is used in C :mrgreen: - similar as echo in php).If he means that, then you can try something like this:

Code: Select all

bind pub -|- "!help" pub:help

proc pub:help {nick host handle chan arg} {

set fileid [open help.txt r]
gets $fileid newvar1
gets $fileid newvar2
putquick "PRIVMSG $chan :$newvar1"
putquick "PRIVMSG $chan :$newvar2"
close $fileid

}
This script will open file help.txt for reading (r) and it will take first 2 lines from file and displayed them in channel :mrgreen:
i
infernal

Post by infernal »

lol, i need more then 20 lines, there about 30 lines in that help file
User avatar
KrzychuG
Master
Posts: 306
Joined: Sat Aug 16, 2003 2:51 pm
Location: Torun, Poland
Contact:

Post by KrzychuG »

This should help

Code: Select all

bind pub -|- "!help" pub:help 

proc pub:help { nick host handle channel arg } { 

  set fname [open help.txt r]
  while {![eof $fname]} {
    set line [gets $fname]
    puthelp "PRIVMSG $channel :$line"
  }
  close $fname
} ;# pub:help
i
infernal

Post by infernal »

well, that works, only he prints it in the channel and not via a pm, how do i do that??

you can always come and look @ it: irc://irc.uicn.net/infernalarts
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

Look tcl-commands.doc :P

Btw, this will msg user:

Code: Select all

bind pub -|- "!help" pub:help 

proc pub:help { nick host handle channel arg } { 

  set fname [open help.txt r] 
  while {![eof $fname]} { 
    set line [gets $fname] 
    puthelp "PRIVMSG $nick :$line" 
  } 
  close $fname 
} ;# pub:help 
i
infernal

Post by infernal »

works now, thank you verry much
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

No Problem :mrgreen:
Locked