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.

Orthography

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
a
area57
Voice
Posts: 7
Joined: Wed Jan 17, 2007 4:50 pm

Orthography

Post by area57 »

Hello,

i would like to have a script, where the Channelusers can correct the orthography in the chat.

i.e.
[*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 ;)
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

the only real solution for something like that I could think of is:

Code: Select all

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.
a
area57
Voice
Posts: 7
Joined: Wed Jan 17, 2007 4:50 pm

Post by area57 »

Hi,

I have tested your script, but it doesn't work :(
there is no error message or something in the partyline or channel
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

did you use .chanset #channel +correct?
a
area57
Voice
Posts: 7
Joined: Wed Jan 17, 2007 4:50 pm

Post by area57 »

metroid wrote:did you use .chanset #channel +correct?
No i didn't see it :oops:
now i get an error message in the Partyline:
Tcl error [eval:text]: can't read "chan": no such variable
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Replace $chan with $channel.
a
area57
Voice
Posts: 7
Joined: Wed Jan 17, 2007 4:50 pm

Post by area57 »

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?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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.
Post Reply