| View previous topic :: View next topic |
| Author |
Message |
area57 Voice
Joined: 17 Jan 2007 Posts: 7
|
Posted: Thu Mar 01, 2007 8:13 pm Post subject: Orthography |
|
|
Hello,
i would like to have a script, where the Channelusers can correct the orthography in the chat.
i.e.
| Quote: | [*User1] ersetz test
[*User2] s/test/done
[Bot] User1 would you like to say: ersetz done? |
i know that the egg-fu script has it for change the learnd text, but my try's to take the code running was not good so the Bot is dieing -.-
i hope you understand my request  |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Fri Mar 02, 2007 2:25 pm Post subject: |
|
|
the only real solution for something like that I could think of is:
| Code: | setudef flag correct
bind PUBM -|- * eval:text
proc eval:text {nickname hostname handle channel arguments} {
global lastline;
if {![channel get $channel correct]} {
return 0;
}
if {![info exists lastline($nickname)]} {
set lastline($nickname) $arguments;
return 0;
}
if {[regexp {s/(.*)/(.*)} $arguments -> original new]} {
set line [string map [list $original $new] $lastline($nickname)];
putserv "PRIVMSG $channel :$nickname: did you mean $line?"
return 0;
}
set lastline($nickname) $arguments;
} |
[untested]
Last edited by metroid on Sat Mar 03, 2007 8:38 am; edited 1 time in total |
|
| Back to top |
|
 |
area57 Voice
Joined: 17 Jan 2007 Posts: 7
|
Posted: Fri Mar 02, 2007 6:36 pm Post subject: |
|
|
Hi,
I have tested your script, but it doesn't work
there is no error message or something in the partyline or channel |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Sat Mar 03, 2007 6:36 am Post subject: |
|
|
| did you use .chanset #channel +correct? |
|
| Back to top |
|
 |
area57 Voice
Joined: 17 Jan 2007 Posts: 7
|
Posted: Sat Mar 03, 2007 7:48 am Post subject: |
|
|
| metroid wrote: | | did you use .chanset #channel +correct? |
No i didn't see it
now i get an error message in the Partyline:
| Quote: | | Tcl error [eval:text]: can't read "chan": no such variable |
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
area57 Voice
Joined: 17 Jan 2007 Posts: 7
|
Posted: Sun Mar 04, 2007 5:03 pm Post subject: |
|
|
Ok that works with $channel
but there is a problem if a User posts an url contains anything with "s/" in the url.
And another question, is it possible to change the script so that
all users can correct a posted line from another user on more than one line? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Mar 04, 2007 7:50 pm Post subject: |
|
|
| area57 wrote: | Ok that works with $channel
but there is a problem if a User posts an url contains anything with "s/" in the url. |
What is the problem?
Be clear in your requests please. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|