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.

question/problem tcl script

Old posts that have not been replied to for several years.
Locked
n
netux
Voice
Posts: 19
Joined: Fri Jul 30, 2004 8:42 pm

question/problem tcl script

Post by netux »

hi, any1 ever try to run the exercice script from suninet tcl guide 11.7 example found at: http://www.suninet.nl/tclguide/example-ch11.tcl ?
i'm trying to learn tcl for eggdrop so i started from the tutorials in links of egghelp, but i think that is something wrong on this code because it should add the !greeting's for every user but it seems that it only suports 1 user. i paste and copy it and what hapent is:

1 user nick bla uses !greeting lalalala
no problem in till here

2 user nick ble uses !gretting lelelele
and it will be save over the 1st greeting

can some1 pls correct that code as it is a guide tutorial i think its important.
and is there a command to replace words or lines in files?
tks in advanced.
try using the same structure of the example so i can understand faster.
PS: any more tutorials guides similar to susinet guide? eggdrop oriented?
TKS
edit: after reading 2 first posts :D
Last edited by netux on Sat Jul 31, 2004 8:04 am, edited 1 time in total.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

I suggest you contact the author (_SunMar_) marijn at suninet dot nl :)
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
n
netux
Voice
Posts: 19
Joined: Fri Jul 30, 2004 8:42 pm

Post by netux »

Alchera wrote:I suggest you contact the author (_SunMar_) marijn at suninet dot nl :)
already done that, and search forum(s) and google..... last chance was posting here.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Alternatively:

You can set +greet on channel and add users in the bots
USER file and set an info line for each user seperately.

This is time consuming, but it is better than TCL. However
you would have to add every user in the USER file whom you
want to greet.

See help regarding this in partyline with the bot.
:mrgreen: :wink:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
n
netux
Voice
Posts: 19
Joined: Fri Jul 30, 2004 8:42 pm

Post by netux »

awyeah i dont want the greet script, im just trying to lear how to deal with files.
i got stuck in the replace tryed lreplace and string replace but cant figure how they work even after reading the syntax :/ dam english.
maybe you can help me.
make simple because im still learning :D
what im trying is:

if {[file exists lbsettings.db]} {
putlog "checking settings"
set lbfr [open lbsettings.db r+]
while {![eof $lbfr]} {
gets $lbfr line
if {[lindex $line 0] == "language"} {
if {[lindex $line 1] != "en"} {
set lang "en"
set line [lreplace $line [lindex $line 1] $lang]
puts $lbfr $line
close $lbfr
putlog "language restored to default"
}
}
}
}

databse is in this format:
language en
im trying to check it and if isnt en change it back to en
i pretend to add other lines to database latter so dont use delete and create another.
i want is to change the "en" if it isnt "en"
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Look up the commands:

[1] string map
[2] lreplace

In the tcl manual and you can get information regarding this.
I am not sure about string replace for this though. :mrgreen:

Take a look at this:
http://forum.egghelp.org/viewtopic.php?t=7891

Search for 'lreplace', 'string map' and 'string replace' in this forum
you can find many results regarding this.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
n
netux
Voice
Posts: 19
Joined: Fri Jul 30, 2004 8:42 pm

Post by netux »

tks
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

As you're on a learning curve, you may want to peruse through the Tcl/Tk 8.5 Manual
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Locked