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.

!info script help

Old posts that have not been replied to for several years.
Locked
t
tuShai
Voice
Posts: 9
Joined: Fri Feb 18, 2005 5:02 am

!info script help

Post by tuShai »

Hi everybody. I found that script in the Database. It works well but i have a few probs with it. Hope that somebody can help me.

Code: Select all

bind pub -|- "!info" pub:info

proc pub:info {nick host hand chan arg} {
set fname [open ts2.txt r]
while {![eof $fname]} {
set infos [gets $fname]
putquick "PRIVMSG $chan :$infos"
}
close $fname
}
Well, the prob is, when more then 1 person types !info the bot get crased. is it possible to create a spammprotection that tells, if sombody entered !info and gets the text, the other will get a notice like " Pls be Patient, trigger !info is in use. Try again in a few mins"
And is it also possible that the text comes out timed. well I only know it from msl. there u can make it with

Code: Select all

 timer 1 0 notice $nick 
 timer 1 1 notice $nick 
 timer 1 2 notice $nick 
and so on
Thx for the help
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

try this

Code: Select all

bind pub -|- "!info" pub:info

set inuse 0 

proc pub:info {nick host hand chan arg} {
    global inuse

    if { $inuse == 1 } { 
    putquick "PRIVMSG $chan :Sorry this function is in use please wait 20 seconds and try again"
    return
    }
    set fname [open ts2.txt r]
    while {![eof $fname]} {
    set infos [gets $fname]
    set inuse 1
    putquick "PRIVMSG $chan :$infos"
    utimer 20 {set inuse 0}
    }
    close $fname
}
This isn't tested but should work
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
t
tuShai
Voice
Posts: 9
Joined: Fri Feb 18, 2005 5:02 am

Post by tuShai »

Thats what i am looking For.
Thanx m8

Still a question. Ho can i put 2 triggers in

one for .de (german Text output)
one for .eng (english Text output)

and how can i make the message output a lil bit slowlier

and how to change this part that it reads the german txt file and an english one. atm it works not so well when i code it ;). Thx for ya help

Code: Select all

if { $inuse == 1 } {
    putquick "PRIVMSG $chan :Sorry this function is in use please wait 20 seconds and try again"
    return
    }
    set fname [open ts2.txt r]
    while {![eof $fname]} {
    set infos [gets $fname]
    set inuse 1
    putquick "PRIVMSG $chan :$infos"
    utimer 20 {set inuse 0}
    }
    close $fname 
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

The easiest way would be to create 2 proc's.

Code: Select all

bind pub -|- "!infouk" pub:infouk
set the text file for the english version on this bind and use the german text file on the second proc with

Code: Select all

bind pub -|- "!infode" pub:infode
and to slow it down try using 'putserv' rather than 'putquick'
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
t
tuShai
Voice
Posts: 9
Joined: Fri Feb 18, 2005 5:02 am

Post by tuShai »

Well, i have right now this. buts not working. i dont know why

Code: Select all

bind pub -|- "!infouk" pub:infouk

set inuse 0

proc pub:info {nick host hand chan arg} {
    global inuse

    if { $inuse == 1 } {
    putquick "PRIVMSG $nick :Pls wait 20 Secs. Function is in use"
    return
    }
    set fname [open ts2_eng.txt r]
    while {![eof $fname]} {
    set infos [gets $fname]
    set inuse 1
    putquick "PRIVMSG $nick :$infos"
    utimer 20 {set inuse 0}
    }
    close $fname
}
Hmm works now. needed to change here

Code: Select all

proc pub:[b]info[/b] {nick host hand chan arg} { 
Didnt knew that ;) But one more question. Ho can i make it that this works just for one channel ???? e.g. #xyz ???
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

tuShai wrote:Well, i have right now this. buts not working. i dont know why

Code: Select all

bind pub -|- "!infouk" pub:infouk

set inuse 0

proc pub:info {nick host hand chan arg} {
    global inuse

    if { $inuse == 1 } {
    putquick "PRIVMSG $nick :Pls wait 20 Secs. Function is in use"
    return
    }
    set fname [open ts2_eng.txt r]
    while {![eof $fname]} {
    set infos [gets $fname]
    set inuse 1
    putquick "PRIVMSG $nick :$infos"
    utimer 20 {set inuse 0}
    }
    close $fname
}
Change this in your script

Code: Select all

proc pub:info {nick host hand chan arg} {
to this

Code: Select all

proc pub:infouk {nick host hand chan arg} {
Your binds have to match your proc names else it will not know which proc to call when that !trigger is called. Theres no point just changing its name and not know what its doing :)
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
t
tuShai
Voice
Posts: 9
Joined: Fri Feb 18, 2005 5:02 am

Post by tuShai »

yapp. that was the prob. but still have the channel. i made now this buts not working

Code: Select all

bind pub -|- "!infouk" pub:infouk

set homechan "#xyz" 
if {![info exists homechan]} {set homechan "[lindex [channels] 0]"} 

set inuse 0

proc pub:infouk {nick host hand chan arg} {
    global inuse

    if { $inuse == 1 } {
    putserv "PRIVMSG $nick :Sorry this function is in use please wait 20 seconds and try again"
    return
    }
    set fname [open voiceuk.txt r]
    while {![eof $fname]} {
    set infos [gets $fname]
    set inuse 1
    putserv "PRIVMSG $nick :$infos"
    utimer 20 {set inuse 0}
    }
    close $fname
}
well bad TCler ;)
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Ermm i am presuming that you want this script to only work in your specified channel?

if thats the case use this.

Code: Select all

bind pub -|- "!infouk" pub:infouk

set homechan "#xyz"
set inuse 0

proc pub:infouk {nick host hand chan arg} {
    global inuse homechan

    if { [string tolower $chan] != [string tolower $homechan] } { return }
    if { $inuse == 1 } {
    putserv "PRIVMSG $nick :Sorry this function is in use please wait 20 seconds and try again"
    return
    }
    set fname [open voiceuk.txt r]
    while {![eof $fname]} {
    set infos [gets $fname]
    set inuse 1
    putserv "PRIVMSG $nick :$infos"
    utimer 20 {set inuse 0}
    }
    close $fname
}
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
t
tuShai
Voice
Posts: 9
Joined: Fri Feb 18, 2005 5:02 am

Post by tuShai »

thx works ;)
Locked