| View previous topic :: View next topic |
| Author |
Message |
w00f Halfop
Joined: 04 Oct 2006 Posts: 49
|
Posted: Sat Oct 21, 2006 5:28 pm Post subject: [help] $strip in tcl [Solved] |
|
|
hi there again.
I've started a script , but i'm still a complete n00b in tcl scripting and i don't know how to get one one word from one linked phrase.
script usage:
!add <game-Version> <url> <type>
(someone) !add game-V69 <URL> <Type>
(someone) !find game-V69
(bot) [<Type>] Current version of game is V69 , you can find it at <URL>.
i just need to know how i can "extract" the <version>. cuz all the remaining is done.
The <version> identifier can be one of diverse types of identificators like V1 , GOD , whatever, but it is always in the end , separated for one "-" from the game.name
EDIT: Already Solved the problem using split and lrange, easy :x .
-> I guess i can use this topic for one other problem , tcl has any kind of command to do the same as $strip(mIRC scripting) ?
i need that coz i'm using
bind pub - !find
and if !find is in bold , underlined or colored the bot doesn't do the search.
someone can help me with that ?
tnks in advance.
EDIT: Solved m8's , tks.
Last edited by w00f on Mon Nov 06, 2006 8:58 am; edited 2 times in total |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sun Oct 22, 2006 5:03 am Post subject: |
|
|
From the eggdrop tcl-commands.doc:
stripcodes <strip-flags> <string>
Description: strips specified control characters from the string given.
strip-flags can be any combination of the following:
b - remove all boldface codes
c - remove all color codes
r - remove all reverse video codes
u - remove all underline codes
a - remove all ANSI codes
g - remove all ctrl-g (bell) codes
Returns: the stripped string.
Module: core |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Sun Oct 22, 2006 11:27 am Post subject: |
|
|
You should read his post first rosc2112.
Ontopic:
You would need to bind * to pubm and strip the codes out.
example:
| Code: | bind pubm -|- * find:proc
proc find:proc {nick host hand chan arg} {
set arg [stripcodes bcru $arg]
if {[string equal -nocase "!find" [lindex [split $arg] 0]]} {
myfindproc $nick $host $hand $chan [lrange [split $arg] 1 end]
}
}
|
|
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sun Oct 22, 2006 7:59 pm Post subject: |
|
|
I did read it, that's why I showed the poster the equivalent command for stripping codes.. But, if criticising me elicits a better answer, that's fine by me  |
|
| Back to top |
|
 |
|