egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Orthography

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
area57
Voice


Joined: 17 Jan 2007
Posts: 7

PostPosted: Thu Mar 01, 2007 8:13 pm    Post subject: Orthography Reply with quote

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 Wink
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Fri Mar 02, 2007 2:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
area57
Voice


Joined: 17 Jan 2007
Posts: 7

PostPosted: Fri Mar 02, 2007 6:36 pm    Post subject: Reply with quote

Hi,

I have tested your script, but it doesn't work Sad
there is no error message or something in the partyline or channel
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sat Mar 03, 2007 6:36 am    Post subject: Reply with quote

did you use .chanset #channel +correct?
Back to top
View user's profile Send private message
area57
Voice


Joined: 17 Jan 2007
Posts: 7

PostPosted: Sat Mar 03, 2007 7:48 am    Post subject: Reply with quote

metroid wrote:
did you use .chanset #channel +correct?

No i didn't see it Embarassed
now i get an error message in the Partyline:
Quote:
Tcl error [eval:text]: can't read "chan": no such variable
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Mar 03, 2007 7:51 am    Post subject: Reply with quote

Replace $chan with $channel.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
area57
Voice


Joined: 17 Jan 2007
Posts: 7

PostPosted: Sun Mar 04, 2007 5:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Mar 04, 2007 7:50 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber