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 

[solved] Regex help - cant get my head around this

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


Joined: 05 Jan 2010
Posts: 97

PostPosted: Sun Feb 14, 2010 9:48 am    Post subject: [solved] Regex help - cant get my head around this Reply with quote

i have a script running i one channel that has lots of spam info in , that relays certain parts of that info to another channel over the bot net,

but i know need somthing with regex /me is a n00b with regex,

the bots name i want to monitor is inner-b0t and when this line is said on my $chan it will strip out just the request id number, ie :



Code:
 <inner-b0t> That was awesome [*Anonymous*] Shall we do it again? ReqId:[126556]


and then MSG $another_channel

Code:
 -send $req-number


so in $another_channel it would read

Code:
 <inner-b0t> -send 126556   


the line is always the same but the reqid is different and i have no clue how to script this Sad


thanks guys hope someone can help me Smile
_________________
NON geeky!! http://gotcode4u.com/


Last edited by doggo on Mon May 24, 2010 4:26 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
tomekk
Master


Joined: 28 Nov 2008
Posts: 255
Location: Oswiecim / Poland

PostPosted: Mon Feb 15, 2010 12:37 pm    Post subject: Reply with quote

Code:
set the_nick "tomekk"

##############################################
bind pubm -|- "*" check_line

proc check_line { nick uhost hand chan arg } {
        global the_nick

        if {$the_nick == $nick} {
                if {[regsub -all -nocase {.*ReqId:\[(.*)\].*} $arg {\1} arg]} {
                        putquick "PRIVMSG $chan :ReqId echo -> $arg"
                }
        }
}

putlog "whatever.tcl loaded"


Quote:
17:36:48 <@tomekk> That was awesome [*Anonymous*] Shall we do it again? ReqId:[126556]
17:36:48 < botty> ReqId echo -> 126556
Back to top
View user's profile Send private message Visit poster's website
doggo
Halfop


Joined: 05 Jan 2010
Posts: 97

PostPosted: Mon Feb 15, 2010 5:51 pm    Post subject: Reply with quote

Code:
[09:39pm] <<inner-b0t>  That was awesome [*Anonymous*] Shall we do it again? ReqId:[126675]
[09:39pm] <hub> -sendnzb 126675


thanks tomekk your a star Smile


just one more quick question Razz

how would implement a 2 sec delay for the PRIVMSG response

thanks again too it works a treat Very Happy

edit:

would it be possible for it to ignore this line


Code:
<inner-b0t>  Request Expired after 30 days ReqId:[122673]


as it responds in channel with

Code:
 [12:20am] <inner-b0t> Request Expired after 30 days ReqId:[122673] [FULL 0 this.is.a.test]
[12:20am] <hub> -sendnzb 122673] [FULL 0 this.is.a.test


thanks for the help Very Happy
_________________
NON geeky!! http://gotcode4u.com/
Back to top
View user's profile Send private message Visit poster's website
tomekk
Master


Joined: 28 Nov 2008
Posts: 255
Location: Oswiecim / Poland

PostPosted: Tue Feb 16, 2010 6:38 am    Post subject: Reply with quote

ignore, change:
Code:

if {[regsub -all -nocase {.*ReqId:\[(.*)\].*} $arg {\1} arg]} {


to

Code:

if {[regsub -all -nocase {.*again\?\s+ReqId:\[(.*)\].*} $arg {\1} arg]} {


'sleep'
http://tmml.sourceforge.net/doc/tcl/after.html

or try something with TCL timers

cheers
Back to top
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Feb 16, 2010 6:53 am    Post subject: Reply with quote

Send the message after two seconds.
Code:
utimer 2 [list puthelp "PRIVMSG $chan :ReqId echo -> $arg"]

_________________
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 -> 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