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 

[help] $strip in tcl [Solved]

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
w00f
Halfop


Joined: 04 Oct 2006
Posts: 49

PostPosted: Sat Oct 21, 2006 5:28 pm    Post subject: [help] $strip in tcl [Solved] Reply with quote

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


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Oct 22, 2006 5:03 am    Post subject: Reply with quote

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


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sun Oct 22, 2006 11:27 am    Post subject: Reply with quote

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


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Oct 22, 2006 7:59 pm    Post subject: Reply with quote

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 Razz
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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