mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2004
Posts: 16
C
Pikka bird
OP Offline
Pikka bird
C
Joined: Nov 2004
Posts: 16
small example
Code:
 
alias findtext {
  %i = 1
%hledat = $1-
  filter -fk quotes.txt findtext2 $+(*,%hledat,*) 
  unset %i
}

alias findtext2 {
  if ( %i > 3 ) { halt }
  var %line = $1-
  msg $chan $gettok(%line,2-3,32)
  inc %i 
  :konec
} 


this code will search for string in quotes.txt for string $1- and will msg to $chan first three of them.

and now my question, !quotes f0k < when someone write this, on that channel will my script msg latest three quotes including word f0k

[code]
On 1:TEXT:*:#: {
if ( !qoutes == $1 ) {
return $findtext($2-)
}
}
[code]
----> but this not work, and i dont know how to get this working frown

Joined: Dec 2004
Posts: 12
D
Pikka bird
Offline
Pikka bird
D
Joined: Dec 2004
Posts: 12
i think, i'm not sure, the problem you have on ur hands is that you are using an alias... try a custom identifier...
instead of having:
Code:
alias findtext {
  %i = 1
  %hledat = $1-
  filter -fk quotes.txt findtext2 $+(*,%hledat,*) 
  unset %i
}

alias findtext2 {
  if ( %i &gt; 3 ) { halt }
  var %line = $1-
  msg $chan $gettok(%line,2-3,32)
  inc %i 
  :konec
} 


have:

Code:
findtext {
  %i = 1
%hledat = $1-
  filter -fk quotes.txt findtext2 $+(*,%hledat,*) 
  unset %i
}

findtext2 {
  if ( %i &gt; 3 ) { halt }
  var %line = $1-
  msg $chan $gettok(%line,2-3,32)
  inc %i 
  :konec
} 


It's not much of a change, but i'm pretty sure it should fix you problem. Lemme know if it works...

Joined: Nov 2004
Posts: 16
C
Pikka bird
OP Offline
Pikka bird
C
Joined: Nov 2004
Posts: 16
not working smirk iam not sure, if return $findtext($2-) is correct form smirk

Joined: Dec 2004
Posts: 23
E
Ameglian cow
Offline
Ameglian cow
E
Joined: Dec 2004
Posts: 23
be more in depth with what you are asking with more examples and i might have something for you because i don't understand exactly what you're asking the script to do

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Its Typo Time!

On 1:TEXT:*:#: {
if ( !qoutes == $1 ) {
return $findtext($2-)
}
}

Fix that and it might just go. (i didnt check the rest it seemed to complexe for me at this hour)

Last edited by DaveC; 17/12/04 02:41 AM.
Joined: Nov 2004
Posts: 16
C
Pikka bird
OP Offline
Pikka bird
C
Joined: Nov 2004
Posts: 16
Code:
findtxt {
  %i = 1
  filter -fk quotes.txt findtxt2 $+(*,$1-,*) [color:green] this find all rows including $1- word to findtxt2 ffunction [/color] 
  unset %i
}

findtxt2 { [color:green] and this function msg first three finded quotas to chan and then stops [/color]
  if ( %i &gt; 3 ) { halt }
  msg $chan $1-
  inc %i 
}    


and i want to get this working on some trigger command. example: someone write !quotes xmas and this script will msg to chan first three lines from quotes.txt that includes word "xmas"

hope this is more easier to understand

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Code:
on *:text:!quotes *:#:{
  var %a = $+($ticks,.txt)
  filter -ff quotes.txt %a $+(*,$2-,*)
  if !$filtered { msg # No quotes found matching $2- | return }
  filter -ffcr 1-3 %a %a 
  .play # %a 1500
  .remove %a
}

Joined: Nov 2004
Posts: 16
C
Pikka bird
OP Offline
Pikka bird
C
Joined: Nov 2004
Posts: 16
thanks, this works good


Link Copied to Clipboard