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.

help with quote script

Old posts that have not been replied to for several years.
Locked
User avatar
EmOuBi
Voice
Posts: 9
Joined: Wed Nov 24, 2004 4:30 pm

help with quote script

Post by EmOuBi »

I found this simple quote script but I want someone to modify it :wink:
The bot will tell jokes about blondes when someone types !blonde in the chan. The problem is that some jokes are 300-400+ letters and they are not displaying all.

I want if the joke is more then 200 symbols to wrap it. For example if the joke is:

Code: Select all

<botnick> This is a very long joke about one blonde and you will not see it 
The bot must say like this:

Code: Select all

<botnick> This is a very long
<botnick> joke about one blonde
<botnick> and you will not see it

Here's the quote.tcl :

Code: Select all

bind pub -|- !blonde pub_disc

proc pub_disc {nick mask hand channel args} {
   global disc
   puthelp "PRIVMSG $channel :[lindex $disc [rand [llength $disc]]]"
   }
set disc {
"blaaaa blaaaaaaaaaa blaaaaaaa"
"abbsabsabsa ds dgdgdgdgd d ssddddddddgggg"
"saggggggggggsgasggsa sag gsa gdd gd dh hd"
}
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

put a

Code: Select all

\n
in where you want the line to break to a new line

HTH
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
User avatar
EmOuBi
Voice
Posts: 9
Joined: Wed Nov 24, 2004 4:30 pm

Post by EmOuBi »

I tryed, it's not working :(
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

odd it works ok in my scripts. make sure your \n 's are inside your " " and rehash your bot.
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
User avatar
EmOuBi
Voice
Posts: 9
Joined: Wed Nov 24, 2004 4:30 pm

Post by EmOuBi »

When I put \n it only break the line.
"This is a\n joke blabla" comes
<botnick> This is a

And that's all. The "joke blabla" is not shown
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Try changing puthelp to putserv. The script looks fine and I cant see why its not working. Any other guys spot something I have missed?
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
User avatar
EmOuBi
Voice
Posts: 9
Joined: Wed Nov 24, 2004 4:30 pm

Post by EmOuBi »

The script is working, it just do not wraps the big jokes :wink:
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

^DooM^ wrote:Try changing puthelp to putserv. The script looks fine and I cant see why its not working. Any other guys spot something I have missed?
you missed the fact that any output to server (using putserv, puthelp or putqucik) is truncated on the first occurance of \n
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Ahh thanks demond.

Code: Select all

bind pub -|- !blonde pub_disc

proc pub_disc {nick mask hand channel args} {
   global disc
   set strBuffer ""
   set strJoke "[lindex $disc [rand [llength $disc]]]"
   append strBuffer "$strJoke\n"
   puthelp "PRIVMSG $channel :$strBuffer"
}

set disc {
"blaaaa blaaaaaaaaaa blaaaaaaa"
"abbsabsabsa ds dgdgdgdgd d ssddddddddgggg"
"saggggggggggsgasggsa sag gsa gdd gd dh hd"
} 
Try this (Not tested).
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
User avatar
EmOuBi
Voice
Posts: 9
Joined: Wed Nov 24, 2004 4:30 pm

Post by EmOuBi »

Nope. It's still truncated :(
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Have a look here.
Locked