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 my old script Trivia 2000 please

Help for those learning Tcl or writing their own scripts.
I
Ian-Highlander
Op
Posts: 165
Joined: Mon Sep 24, 2001 8:00 pm
Location: Ely, Cambridgeshire

Post by Ian-Highlander »

Resolved this issue and got it working in the end, thanks for your help Sir_Fz.

One further question someone may be able to answer for me. I've used the "stripcodes" command in this new code and on checking Eggdrop documentation this command was only introduced on Eggdrop 1.6.17. Am I right in thinking this will potentially break my script for early versions of Eggdrop, or will earlier versions just ignore that and carry on?

Or is there an alternative thats coded into all versions of Eggdrop?
"Insanity Takes Its Toll, Please Have Exact Change"
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

You're right, [stripcodes] has been introduced in eggdrop1.6.17 and it will not work on earlier version. If I were you, I wouldn't care about that - users should be using the latest eggdrop anyway. But you can resolve that issue by creating your own proc to strip codes.

Code: Select all

proc stripcodes str {
 regsub -all {\003[0-9]{0,2}(,[0-9]{0,2})?} $str "" str
 set str [string map {"\017" "" "\037" "" "\002" "" "\026" "" "\006" "" "\007" ""} $str]
}
Post Reply